Commit ee886eaf authored by Laurent Aimar's avatar Laurent Aimar Committed by Derk-Jan Hartman

Used AVCodecContext::ticks_per_frame when available.

It fixes a regression with interpolated timestamps for some
mpeg-I/II and for h264.
(cherry picked from commit 06105bd1)
Signed-off-by: default avatarDerk-Jan Hartman <hartman@videolan.org>
parent c36f1f2f
......@@ -1046,9 +1046,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