]> git.sesse.net Git - x264/commitdiff
Fix use of deprecated libavcodec functions
authorAnton Mitrofanov <BugMaster@narod.ru>
Fri, 15 Jul 2011 11:06:37 +0000 (15:06 +0400)
committerFiona Glaser <fiona@x264.com>
Mon, 18 Jul 2011 16:16:32 +0000 (09:16 -0700)
Replace avcodec_open with avcodec_open2. Now requires libavcodec 53.6.0 or newer.

configure
input/lavf.c

index 9ce13bc18f0c087f2f543bf138cc52c717d7bb9d..88a272576afb0caee121a8859e7e348c3793562f 100755 (executable)
--- 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
index 424d3cb0568b182ec711f145c4eab0e42db03ede..ee773b056e826c125ddc330d8686794626bfade6 100644 (file)
@@ -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 */