[x264-devel] Use AVMEDIA_TYPE_VIDEO instead of deprecated CODEC_TYPE_VIDEO

Anton Khirnov git at videolan.org
Tue Apr 26 07:49:11 CEST 2011


x264 | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Apr 20 10:53:44 2011 +0200| [f5db2e4a90d536b6665e7a5913ad4648fc918077] | committer: Jason Garrett-Glaser

Use AVMEDIA_TYPE_VIDEO instead of deprecated CODEC_TYPE_VIDEO

Fixes build with lavf/lavc 53.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=f5db2e4a90d536b6665e7a5913ad4648fc918077
---

 configure    |    5 ++---
 input/lavf.c |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 1a7cb33..29b6e85 100755
--- a/configure
+++ b/configure
@@ -724,15 +724,14 @@ if [ "$lavf" = "auto" ] ; then
     fi
     LAVF_LIBS="-L. $LAVF_LIBS"
     if cc_check libavformat/avformat.h "$LAVF_CFLAGS $LAVF_LIBS" "avcodec_decode_video2(0,0,0,0);" ; then
-        # libvautil/pixdesc.h included the private header intreadwrite.h until r21854
-        if cc_check libavutil/pixdesc.h "$LAVF_CFLAGS $LAVF_LIBS" ; then
+        if cpp_check libavcodec/avcodec.h "$LAVF_CFLAGS $LAVF_LIBS" "LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,64,0)" ; then
             if [ "$swscale" = "yes" ]; then
                 lavf="yes"
             else
                 echo "Warning: libavformat is not supported without swscale support"
             fi
         else
-            echo "Warning: libavutil is too old, update to ffmpeg r21854+"
+            echo "Warning: libavcodec is too old, update to ffmpeg r22735+"
         fi
     fi
 fi
diff --git a/input/lavf.c b/input/lavf.c
index 2f26aa9..185ecfb 100644
--- a/input/lavf.c
+++ b/input/lavf.c
@@ -158,7 +158,7 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c
     FAIL_IF_ERROR( av_find_stream_info( h->lavf ) < 0, "could not find input stream info\n" )
 
     int i = 0;
-    while( i < h->lavf->nb_streams && h->lavf->streams[i]->codec->codec_type != CODEC_TYPE_VIDEO )
+    while( i < h->lavf->nb_streams && h->lavf->streams[i]->codec->codec_type != AVMEDIA_TYPE_VIDEO )
         i++;
     FAIL_IF_ERROR( i == h->lavf->nb_streams, "could not find video stream\n" )
     h->stream_id       = i;



More information about the x264-devel mailing list