]> git.sesse.net Git - vlc/commitdiff
* modules/codec/ffmpeg/video.c: use frame rate info from demuxer (if available) to...
authorGildas Bazin <gbazin@videolan.org>
Mon, 16 May 2005 15:11:56 +0000 (15:11 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 16 May 2005 15:11:56 +0000 (15:11 +0000)
modules/codec/ffmpeg/video.c

index 44e21e7d11a3893ffba75339ac20946655b9f7ce..e6d7b6a0a54b4f7df6427b9708c7175c95aff190 100644 (file)
@@ -663,7 +663,16 @@ picture_t *E_(DecodeVideo)( decoder_t *p_dec, block_t **pp_block )
 
             /* interpolate the next PTS */
 #if LIBAVCODEC_BUILD >= 4754
-            if( p_sys->p_context->time_base.den > 0 )
+            if( p_dec->fmt_in.video.i_frame_rate > 0 &&
+                p_dec->fmt_in.video.i_frame_rate_base > 0 )
+            {
+                p_sys->i_pts += I64C(1000000) *
+                    (2 + p_sys->p_ff_pic->repeat_pict) *
+                    p_dec->fmt_in.video.i_frame_rate_base *
+                    p_block->i_rate / INPUT_RATE_DEFAULT /
+                    (2 * p_dec->fmt_in.video.i_frame_rate);
+            }
+            else if( p_sys->p_context->time_base.den > 0 )
             {
                 p_sys->i_pts += I64C(1000000) *
                     (2 + p_sys->p_ff_pic->repeat_pict) *