[FFmpeg-cvslog] lavf: limit "Adjusting PTS forward" code to video streams
Michael Niedermayer
git at videolan.org
Sun Jul 8 22:30:11 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jul 8 22:18:34 2012 +0200| [d8ce478c43d9096bcf38b50c849e9ed45647542d] | committer: Michael Niedermayer
lavf: limit "Adjusting PTS forward" code to video streams
It can end up slightly messing up a series of valid timestamps
after a invalid one.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d8ce478c43d9096bcf38b50c849e9ed45647542d
---
libavformat/utils.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 70f8d46..b1b48fe 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1096,6 +1096,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
int64_t old_diff= FFABS(st->cur_dts - duration - pkt->pts);
int64_t new_diff= FFABS(st->cur_dts - pkt->pts);
if( old_diff < new_diff && old_diff < (duration>>3)
+ && st->codec->codec_type == AVMEDIA_TYPE_VIDEO
&& (!strcmp(s->iformat->name, "mpeg") ||
!strcmp(s->iformat->name, "mpegts"))){
pkt->pts += duration;
More information about the ffmpeg-cvslog
mailing list