From 4752bb67296a48deba87af427ce96b6b3db1d8e4 Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Wed, 9 Mar 2005 19:57:28 +0000 Subject: [PATCH] * modules/codec/ffmpeg/video.c: take input rate into account when interpolating next pts. --- modules/codec/ffmpeg/video.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/codec/ffmpeg/video.c b/modules/codec/ffmpeg/video.c index 526b7c3555..9f5f8f32d8 100644 --- a/modules/codec/ffmpeg/video.c +++ b/modules/codec/ffmpeg/video.c @@ -27,6 +27,7 @@ *****************************************************************************/ #include #include +#include /* hmmm, just for INPUT_RATE_DEFAULT */ /* ffmpeg header */ #ifdef HAVE_FFMPEG_AVCODEC_H @@ -172,8 +173,8 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec, p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * ( av_q2d(p_context->sample_aspect_ratio) * p_context->width / p_context->height ); - p_dec->fmt_out.video.i_sar_num = p_context->sample_aspect_ratio.num; - p_dec->fmt_out.video.i_sar_den = p_context->sample_aspect_ratio.den; + p_dec->fmt_out.video.i_sar_num = p_context->sample_aspect_ratio.num; + p_dec->fmt_out.video.i_sar_den = p_context->sample_aspect_ratio.den; #else p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * p_context->aspect_ratio; @@ -657,7 +658,8 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block ) { p_sys->i_pts += I64C(1000000) * (2 + p_sys->p_ff_pic->repeat_pict) * - p_sys->p_context->frame_rate_base / + p_sys->p_context->frame_rate_base * + p_block->i_rate / INPUT_RATE_DEFAULT / (2 * p_sys->p_context->frame_rate); } -- 2.39.2