Commit 06105bd1 authored by Laurent Aimar's avatar Laurent Aimar

Used AVCodecContext::ticks_per_frame when available.

It fixes a regression with interpolated timestamps for some
mpeg-I/II and for h264.
parent 50151993
......@@ -1118,9 +1118,17 @@ static void ffmpeg_NextPts( decoder_t *p_dec )
}
else if( p_sys->p_context->time_base.den > 0 )
{
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,20,0)
int i_tick = i_tick = p_sys->p_context->ticks_per_frame;
if( i_tick <= 0 )
i_tick = 1;
#else
int i_tick = 1;
#endif
p_sys->i_pts += INT64_C(1000000) *
(2 + p_sys->p_ff_pic->repeat_pict) *
p_sys->p_context->time_base.num /
i_tick * p_sys->p_context->time_base.num /
(2 * p_sys->p_context->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