1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

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@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-07-08 22:18:34 +02:00
parent 299387ebf4
commit d8ce478c43

View 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;