[vlc-commits] avcodec: use framerate as time_base seems to be debrecated in 0.56

Ilkka Ollakka git at videolan.org
Sat Oct 10 18:06:24 CEST 2015


vlc/vlc-2.2 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Aug  9 23:54:31 2015 +0300| [92d60aadef1787e209e6c8c05969ae53c2d8d01f] | committer: Ilkka Ollakka

avcodec: use framerate as time_base seems to be debrecated in 0.56

Libav/ffmpeg seems to store littlebit different values in framerate, so
there is #if to check that. Not sure if it's good idea at all to do that
like this.

(cherry picked from commit 302f74f91bf596169cb9164adb2ede891d0c98b8)
Signed-off-by: Ilkka Ollakka <ileoo at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=92d60aadef1787e209e6c8c05969ae53c2d8d01f
---

 modules/codec/avcodec/video.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 111ba0f..0ecd7fe 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -191,6 +191,17 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
         p_dec->fmt_out.video.i_frame_rate_base =
             p_dec->fmt_in.video.i_frame_rate_base;
     }
+#if LIBAVCODEC_VERSION_CHECK( 56, 5, 0, 7, 100 )
+    else if( p_context->framerate.num > 0 && p_context->framerate.den > 0 )
+    {
+        p_dec->fmt_out.video.i_frame_rate = p_context->framerate.num;
+        p_dec->fmt_out.video.i_frame_rate_base = p_context->framerate.den;
+# if LIBAVCODEC_VERSION_MICRO <  100
+        // for some reason libav don't thinkg framerate presents actually same thing as in ffmpeg
+        p_dec->fmt_out.video.i_frame_rate_base *= __MAX( p_context->ticks_per_frame, 1 );
+# endif
+    }
+#endif
     else if( p_context->time_base.num > 0 && p_context->time_base.den > 0 )
     {
         p_dec->fmt_out.video.i_frame_rate = p_context->time_base.den;



More information about the vlc-commits mailing list