[vlc-devel] commit: Used AVCodecContext::ticks_per_frame when available. ( Laurent Aimar )

git version control git at videolan.org
Fri Jun 19 01:09:25 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Jun 19 00:47:57 2009 +0200| [06105bd193c8b7f002087197a1f4d7258aca3d3c] | committer: Laurent Aimar 

Used AVCodecContext::ticks_per_frame when available.

It fixes a regression with interpolated timestamps for some
mpeg-I/II and for h264.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=06105bd193c8b7f002087197a1f4d7258aca3d3c
---

 modules/codec/avcodec/video.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index d2cd8c9..81f485e 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -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);
     }
 }




More information about the vlc-devel mailing list