summaryrefslogtreecommitdiff
path: root/libavformat/rtspdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-23 21:39:29 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-23 21:43:18 +0100
commit83f18410bdcf149b58fb669cda65b1cdcdebf695 (patch)
treefe767f6d5f7e1961d5b36b74ebc4caf8920083eb /libavformat/rtspdec.c
parentcce8f750d91c013da00f5191ad537450172acc0c (diff)
parentcdcc370293a159c321e41af7f0eef141c62d698d (diff)
Merge commit 'cdcc370293a159c321e41af7f0eef141c62d698d'
* commit 'cdcc370293a159c321e41af7f0eef141c62d698d': rtsp: punch holes again after pause See: 22bb5bd7a3b55c25bfef130ad89e8574dd47af1d Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtspdec.c')
-rw-r--r--libavformat/rtspdec.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index f4255f24d2..12aa122b4b 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -506,6 +506,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++) {
@@ -542,9 +554,6 @@ static int rtsp_read_play(AVFormatContext *s)
AVStream *st = NULL;
if (!rtpctx || rtsp_st->stream_index < 0)
continue;
- if (CONFIG_RTPDEC &&
- !(rt->server_type == RTSP_SERVER_WMS && i > 1) && s->iformat)
- ff_rtp_send_punch_packets(rtsp_st->rtp_handle);
st = s->streams[rtsp_st->stream_index];
rtpctx->range_start_offset =