[FFmpeg-cvslog] r21857 - in trunk/libavformat: rtpdec.c rtpdec.h
rbultje
subversion
Wed Feb 17 00:00:03 CET 2010
Author: rbultje
Date: Wed Feb 17 00:00:03 2010
New Revision: 21857
Log:
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>.
Modified:
trunk/libavformat/rtpdec.c
trunk/libavformat/rtpdec.h
Modified: trunk/libavformat/rtpdec.c
==============================================================================
--- trunk/libavformat/rtpdec.c Tue Feb 16 23:50:50 2010 (r21856)
+++ trunk/libavformat/rtpdec.c Wed Feb 17 00:00:03 2010 (r21857)
@@ -79,8 +79,6 @@ static int rtcp_parse_packet(RTPDemuxCon
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(AVFormat
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(RTPDemuxCont
/* 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;
}
}
Modified: trunk/libavformat/rtpdec.h
==============================================================================
--- trunk/libavformat/rtpdec.h Tue Feb 16 23:50:50 2010 (r21856)
+++ trunk/libavformat/rtpdec.h Wed Feb 17 00:00:03 2010 (r21857)
@@ -169,7 +169,6 @@ struct RTPDemuxContext {
/* rtcp sender statistics receive */
int64_t last_rtcp_ntp_time; // TODO: move into statistics
- int64_t first_rtcp_ntp_time; // TODO: move into statistics
uint32_t last_rtcp_timestamp; // TODO: move into statistics
/* rtcp sender statistics */
More information about the ffmpeg-cvslog
mailing list