[x264-devel] Fix use of deprecated libavcodec functions

Anton Mitrofanov git at videolan.org
Sat Jul 23 02:38:51 CEST 2011


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Fri Jul 15 15:06:37 2011 +0400| [3765dfdd27bd206a800a61c38c0a6639d762db3b] | committer: Jason Garrett-Glaser

Fix use of deprecated libavcodec functions
Replace avcodec_open with avcodec_open2. Now requires libavcodec 53.6.0 or newer.

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

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

diff --git a/configure b/configure
index 9ce13bc..88a2725 100755
--- a/configure
+++ b/configure
@@ -744,7 +744,7 @@ if [ "$lavf" = "auto" ] ; then
         done
     fi
     LAVF_LIBS="-L. $LAVF_LIBS"
-    if cc_check libavformat/avformat.h "$LAVF_CFLAGS $LAVF_LIBS" "avformat_open_input(0,0,0,0);" ; then
+    if cc_check libavformat/avformat.h "$LAVF_CFLAGS $LAVF_LIBS" "avformat_open_input(0,0,0,0); avcodec_open2(0,0,0);" ; then
         if [ "$swscale" = "yes" ]; then
             lavf="yes"
         else
diff --git a/input/lavf.c b/input/lavf.c
index 424d3cb..ee773b0 100644
--- a/input/lavf.c
+++ b/input/lavf.c
@@ -170,7 +170,7 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c
     /* lavf is thread unsafe as calling av_read_frame invalidates previously read AVPackets */
     info->thread_safe  = 0;
     h->vfr_input       = info->vfr;
-    FAIL_IF_ERROR( avcodec_open( c, avcodec_find_decoder( c->codec_id ) ),
+    FAIL_IF_ERROR( avcodec_open2( c, avcodec_find_decoder( c->codec_id ), NULL ),
                    "could not find decoder for video stream\n" )
 
     /* prefetch the first frame and set/confirm flags */



More information about the x264-devel mailing list