diff rtsp.c @ 5665:93b0d64bf0c9 libavformat

When using RTP-over-UDP, send dummy packets during stream setup, similar to what e.g. RealPlayer does. This allows proper port forwarding setup in NAT- based environments. Patch by Martin Storsj <$firstname at $firstname dot st>.
author rbultje
date Tue, 16 Feb 2010 22:50:50 +0000
parents ebf397240c91
children 9b2e63adc0fa
line wrap: on
line diff
--- a/rtsp.c	Tue Feb 16 19:26:49 2010 +0000
+++ b/rtsp.c	Tue Feb 16 22:50:50 2010 +0000
@@ -1146,6 +1146,12 @@
                 err = AVERROR_INVALIDDATA;
                 goto fail;
             }
+            /* 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 (!(rt->server_type == RTSP_SERVER_WMS && i > 1))
+                rtp_send_punch_packets(rtsp_st->rtp_handle);
             break;
         }
         case RTSP_LOWER_TRANSPORT_UDP_MULTICAST: {