From: Anton Mitrofanov Date: Fri, 15 Jul 2011 11:06:37 +0000 (+0400) Subject: Fix use of deprecated libavcodec functions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa50e72e7c723927325d031ab47b24e069dde4e3;p=libx264 Fix use of deprecated libavcodec functions Replace avcodec_open with avcodec_open2. Now requires libavcodec 53.6.0 or newer. --- diff --git a/configure b/configure index 9ce13bc1..88a27257 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 424d3cb0..ee773b05 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 */