summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-02-16 22:50:50 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2010-02-16 22:50:50 +0000
commit9c8fa20d7e60760f117c2123a51137db1ac91682 (patch)
tree1167eca1e68c73f232872ebab1f925d4e0b673e7 /libavformat/rtsp.c
parentfe74099aee7b2c4f918194c4ed560e244677df7a (diff)
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>. Originally committed as revision 21856 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 8bc940dd92..f379b781b0 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1146,6 +1146,12 @@ static int make_setup_request(AVFormatContext *s, const char *host, int port,
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: {