From 34583e1bbe3fd233a32e4a17421358e8c1853702 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 26 Feb 2009 13:15:22 +0000 Subject: [PATCH] Fix next_pts computation to consider repeat_pict. Originally committed as revision 17613 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 79ad1a4263..f757eb5019 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -1261,8 +1261,9 @@ static int output_packet(AVInputStream *ist, int ist_index, goto discard_packet; } if (ist->st->codec->time_base.num != 0) { + int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : 1; ist->next_pts += ((int64_t)AV_TIME_BASE * - ist->st->codec->time_base.num) / + ist->st->codec->time_base.num * ticks) / ist->st->codec->time_base.den; } len = 0; @@ -1289,8 +1290,9 @@ static int output_packet(AVInputStream *ist, int ist_index, break; case CODEC_TYPE_VIDEO: if (ist->st->codec->time_base.num != 0) { + int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : 1; ist->next_pts += ((int64_t)AV_TIME_BASE * - ist->st->codec->time_base.num) / + ist->st->codec->time_base.num * ticks) / ist->st->codec->time_base.den; } break;