From f5db2e4a90d536b6665e7a5913ad4648fc918077 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 20 Apr 2011 10:53:44 +0200 Subject: [PATCH] Use AVMEDIA_TYPE_VIDEO instead of deprecated CODEC_TYPE_VIDEO Fixes build with lavf/lavc 53. --- configure | 5 ++--- input/lavf.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 1a7cb330..29b6e854 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 2f26aa9e..185ecfb9 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; -- 2.47.3