summaryrefslogtreecommitdiffstats
path: root/libavformat/rtpdec.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2010-02-16 23:00:03 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2010-02-16 23:00:03 +0000
commitfc78b0cb7e115ae494861c37a9928cff74df8db9 (patch)
treeb1340541cd80664989a11b01458b107acc313c40 /libavformat/rtpdec.c
parent9c8fa20d7e60760f117c2123a51137db1ac91682 (diff)
downloadffmpeg-streaming-fc78b0cb7e115ae494861c37a9928cff74df8db9.zip
ffmpeg-streaming-fc78b0cb7e115ae494861c37a9928cff74df8db9.tar.gz
Remove first_rtcp_ntp_time. This is used to prevent overflow of the timestamp,
but doesn't actually do that. What's worse, it creates timestamp adjustments that are different per stream within a session, leading to a/v sync issues. See discussion in thread "[FFmpeg-devel] rtp streaming x264+audio issues (and some ideas to fix them)". Patch suggested by Luca Abeni <lucabe72 email it>. Originally committed as revision 21857 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r--libavformat/rtpdec.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index dfc5b0b..af744093a 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -79,8 +79,6 @@ static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, int l
if (buf[1] != 200)
return -1;
s->last_rtcp_ntp_time = AV_RB64(buf + 8);
- if (s->first_rtcp_ntp_time == AV_NOPTS_VALUE)
- s->first_rtcp_ntp_time = s->last_rtcp_ntp_time;
s->last_rtcp_timestamp = AV_RB32(buf + 16);
return 0;
}
@@ -327,7 +325,6 @@ RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *r
return NULL;
s->payload_type = payload_type;
s->last_rtcp_ntp_time = AV_NOPTS_VALUE;
- s->first_rtcp_ntp_time = AV_NOPTS_VALUE;
s->ic = s1;
s->st = st;
s->rtp_payload_data = rtp_payload_data;
@@ -431,7 +428,7 @@ static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestam
/* compute pts from timestamp with received ntp_time */
delta_timestamp = timestamp - s->last_rtcp_timestamp;
/* convert to the PTS timebase */
- addend = av_rescale(s->last_rtcp_ntp_time - s->first_rtcp_ntp_time, s->st->time_base.den, (uint64_t)s->st->time_base.num << 32);
+ addend = av_rescale(s->last_rtcp_ntp_time, s->st->time_base.den, (uint64_t)s->st->time_base.num << 32);
pkt->pts = addend + delta_timestamp;
}
}
OpenPOWER on IntegriCloud