diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-03 15:03:49 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-03 15:15:06 +0100 |
commit | 730945d941aec27d40c51d74850166228cec9ea1 (patch) | |
tree | 648f21aff8fae9161563157033455eae36fc9356 /ffmpeg.c | |
parent | 28a11a67d2129f1e290f8e8fdb3970801be0cfc2 (diff) | |
download | ffmpeg-730945d941aec27d40c51d74850166228cec9ea1.tar.gz |
ffmpeg: use standard duration calculation code in the stream copy case.
Fixes a.mkv non monotonic timestamps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -2053,8 +2053,10 @@ static int output_packet(InputStream *ist, ist->st->codec->sample_rate; break; case AVMEDIA_TYPE_VIDEO: - if (ist->st->codec->time_base.num != 0) { - int ticks = ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame; + if (pkt->duration) { + ist->next_pts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); + } else if(ist->st->codec->time_base.num != 0) { + int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame; ist->next_pts += ((int64_t)AV_TIME_BASE * ist->st->codec->time_base.num * ticks) / ist->st->codec->time_base.den; |