diff mbox series

[FFmpeg-devel,v2] libavformat/rtsp: Pass protocol options for udp multicast

Message ID 20200419171441.2844-1-haupt.wolfgang@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,v2] libavformat/rtsp: Pass protocol options for udp multicast | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Wolfgang Haupt April 19, 2020, 5:14 p.m. UTC
Protocol options like buffer_size need to be passed to the
underlying transport implementation for udp multicasts as well.
---
 libavformat/rtsp.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 07ac371903..b56bebfde6 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1617,6 +1617,7 @@  int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
             char url[1024], namebuf[50], optbuf[20] = "";
             struct sockaddr_storage addr;
             int port, ttl;
+            AVDictionary *opts = map_to_opts(rt);
 
             if (reply->transports[0].destination.ss_family) {
                 addr      = reply->transports[0].destination;
@@ -1633,8 +1634,12 @@  int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
                         namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST);
             ff_url_join(url, sizeof(url), "rtp", NULL, namebuf,
                         port, "%s", optbuf);
-            if (ffurl_open_whitelist(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
-                           &s->interrupt_callback, NULL, s->protocol_whitelist, s->protocol_blacklist, NULL) < 0) {
+            err = ffurl_open_whitelist(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
+                           &s->interrupt_callback, &opts, s->protocol_whitelist, s->protocol_blacklist, NULL);
+            av_dict_free(&opts);
+
+            if (err < 0)
+            {
                 err = AVERROR_INVALIDDATA;
                 goto fail;
             }