From 3765dfdd27bd206a800a61c38c0a6639d762db3b Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Fri, 15 Jul 2011 15:06:37 +0400 Subject: [PATCH] Fix use of deprecated libavcodec functions Replace avcodec_open with avcodec_open2. Now requires libavcodec 53.6.0 or newer. --- configure | 2 +- input/lavf.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 */ -- 2.47.3