Commit 730945d9 authored by Michael Niedermayer's avatar Michael Niedermayer

ffmpeg: use standard duration calculation code in the stream copy case.

Fixes a.mkv non monotonic timestamps
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 28a11a67
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment