lavf: limit "Adjusting PTS forward" code to video streams
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 8 Jul 2012 20:18:34 +0000 (22:18 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 8 Jul 2012 20:29:34 +0000 (22:29 +0200)
It can end up slightly messing up a series of valid timestamps
after a invalid one.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/utils.c

index 70f8d46..b1b48fe 100644 (file)
@@ -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;