]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtspdec.c
tls: Pass AVOptions dictionaries through to the chained protocol
[ffmpeg] / libavformat / rtspdec.c
index 1f90590c89deb959c09abf2e266173660b7c19bf..659c76842369bacb4e0e2964ea6d6aeefc60f6d5 100644 (file)
@@ -114,7 +114,7 @@ static int rtsp_send_reply(AVFormatContext *s, enum RTSPStatusCode code,
         av_strlcat(message, extracontent, sizeof(message));
     av_strlcat(message, "\r\n", sizeof(message));
     av_dlog(s, "Sending response:\n%s", message);
-    ffurl_write(rt->rtsp_hd, message, strlen(message));
+    ffurl_write(rt->rtsp_hd_out, message, strlen(message));
 
     return 0;
 }
@@ -504,6 +504,18 @@ static int rtsp_read_play(AVFormatContext *s)
     av_log(s, AV_LOG_DEBUG, "hello state=%d\n", rt->state);
     rt->nb_byes = 0;
 
+    if (rt->lower_transport == RTSP_LOWER_TRANSPORT_UDP) {
+        for (i = 0; i < rt->nb_rtsp_streams; i++) {
+            RTSPStream *rtsp_st = rt->rtsp_streams[i];
+            /* Try to initialize the connection state in a
+             * potential NAT router by sending dummy packets.
+             * RTP/RTCP dummy packets are used for RDT, too.
+             */
+            if (rtsp_st->rtp_handle &&
+                !(rt->server_type == RTSP_SERVER_WMS && i > 1))
+                ff_rtp_send_punch_packets(rtsp_st->rtp_handle);
+        }
+    }
     if (!(rt->server_type == RTSP_SERVER_REAL && rt->need_subscription)) {
         if (rt->transport == RTSP_TRANSPORT_RTP) {
             for (i = 0; i < rt->nb_rtsp_streams; i++) {