]> git.sesse.net Git - ffmpeg/commitdiff
avformat/rtsp: support buffer_size and pkt_size options for RTP
authorJiangjie Gao <gaojiangjie@live.com>
Tue, 9 Mar 2021 06:21:19 +0000 (14:21 +0800)
committerMarton Balint <cus@passwd.hu>
Fri, 19 Mar 2021 22:13:26 +0000 (23:13 +0100)
And forward it to the underlying UDP protocol.

Fixes ticket #7517.

Signed-off-by: Jiangjie Gao <gaojiangjie@live.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
doc/protocols.texi
libavformat/rtsp.c

index 78afe6ec8ead656f777f34407b7399813987c7f8..d3f6cbefcfec2bc8bdf422e6a7aebbbdd742c436 100644 (file)
@@ -1033,6 +1033,9 @@ Set the local RTCP port to @var{n}.
 @item pkt_size=@var{n}
 Set max packet size (in bytes) to @var{n}.
 
+@item buffer_size=@var{size}
+Set the maximum UDP socket buffer size in bytes.
+
 @item connect=0|1
 Do a @code{connect()} on the UDP socket (if set to 1) or not (if set
 to 0).
index 9a2933346eddc860b2f9ae9a4e8ff2331d8146a7..25bdf475b3a8bca3dedbd50dae9a16f47550bc6b 100644 (file)
@@ -2506,12 +2506,15 @@ static int rtp_read_header(AVFormatContext *s)
     RTSPState *rt = s->priv_data;
     const char *p;
     AVBPrint sdp;
+    AVDictionary *opts = NULL;
 
     if (!ff_network_init())
         return AVERROR(EIO);
 
+    opts = map_to_opts(rt);
     ret = ffurl_open_whitelist(&in, s->url, AVIO_FLAG_READ,
-                     &s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist, NULL);
+                     &s->interrupt_callback, &opts, s->protocol_whitelist, s->protocol_blacklist, NULL);
+    av_dict_free(&opts);
     if (ret)
         goto fail;