From 88041dfe447b0239779f0af66e212e04a1d14da8 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Wed, 21 Jul 2010 00:18:51 +0200 Subject: [PATCH] Force avcodec to be at least 52.25.0 and avfomat 52.30.0... They are more than 1 year old... --- configure.ac | 4 ++-- modules/codec/avcodec/avcodec.c | 10 ++-------- modules/codec/avcodec/fourcc.c | 8 -------- modules/codec/avcodec/video.c | 4 ---- modules/demux/avformat/demux.c | 10 ---------- modules/demux/avformat/mux.c | 4 ---- 6 files changed, 4 insertions(+), 36 deletions(-) diff --git a/configure.ac b/configure.ac index 23e05664f8..8a8701ea7a 100644 --- a/configure.ac +++ b/configure.ac @@ -2635,7 +2635,7 @@ AC_ARG_ENABLE(avcodec, [ --enable-avcodec libavcodec codec (default enabled)]) if test "${enable_avcodec}" != "no" then - PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 52.2.0 libavutil], + PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 52.25.0 libavutil], [ VLC_SAVE_FLAGS CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}" @@ -2745,7 +2745,7 @@ AC_ARG_ENABLE(avformat, [ --enable-avformat libavformat containers (default enabled)]) if test "${enable_avformat}" != "no" then - PKG_CHECK_MODULES(AVFORMAT,[libavformat libavutil], + PKG_CHECK_MODULES(AVFORMAT,[libavformat > 52.30.0 libavutil], [ VLC_SAVE_FLAGS CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}" diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c index 0a242bd0a2..b3b3feb54c 100644 --- a/modules/codec/avcodec/avcodec.c +++ b/modules/codec/avcodec/avcodec.c @@ -48,10 +48,8 @@ #include "avcodec.h" #include "avutil.h" -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 52, 2, 0 ) -# error You must update libavcodec to a version >= 52.2.0 -#elif LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 52, 25, 0 ) -# warning You should update libavcodec to get subtitle support +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 52, 25, 0 ) +# error You must update libavcodec to a version >= 52.25.0 #endif /***************************************************************************** @@ -314,13 +312,11 @@ static int OpenDecoder( vlc_object_t *p_this ) i_result = InitAudioDec ( p_dec, p_context, p_codec, i_codec_id, psz_namecodec ); break; -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 25, 0 ) case SPU_ES: p_dec->pf_decode_sub = DecodeSubtitle; i_result = InitSubtitleDec( p_dec, p_context, p_codec, i_codec_id, psz_namecodec ); break; -#endif default: i_result = VLC_EGENERIC; } @@ -353,11 +349,9 @@ static void CloseDecoder( vlc_object_t *p_this ) case VIDEO_ES: EndVideoDec ( p_dec ); break; -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 25, 0 ) case SPU_ES: EndSubtitleDec( p_dec ); break; -#endif } if( p_sys->p_context ) diff --git a/modules/codec/avcodec/fourcc.c b/modules/codec/avcodec/fourcc.c index 9d51e582aa..5eb13651fa 100644 --- a/modules/codec/avcodec/fourcc.c +++ b/modules/codec/avcodec/fourcc.c @@ -128,12 +128,8 @@ static const struct { VLC_CODEC_RV10, CODEC_ID_RV10, VIDEO_ES }, { VLC_CODEC_RV13, CODEC_ID_RV10, VIDEO_ES }, { VLC_CODEC_RV20, CODEC_ID_RV20, VIDEO_ES }, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 8, 0 ) { VLC_CODEC_RV30, CODEC_ID_RV30, VIDEO_ES }, -#endif -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 5, 0 ) { VLC_CODEC_RV40, CODEC_ID_RV40, VIDEO_ES }, -#endif { VLC_CODEC_RPZA, CODEC_ID_RPZA, VIDEO_ES }, @@ -347,9 +343,7 @@ static const struct { VLC_CODEC_VORBIS, CODEC_ID_VORBIS, AUDIO_ES }, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 6, 0 ) { VLC_CODEC_QCELP, CODEC_ID_QCELP, AUDIO_ES }, -#endif { VLC_CODEC_SPEEX, CODEC_ID_SPEEX, AUDIO_ES }, #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 34, 0 ) { VLC_CODEC_TWINVQ, CODEC_ID_TWINVQ, AUDIO_ES }, @@ -370,9 +364,7 @@ static const struct { VLC_CODEC_SHORTEN, CODEC_ID_SHORTEN, AUDIO_ES }, -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 22, 0 ) { VLC_CODEC_TRUEHD, CODEC_ID_TRUEHD, AUDIO_ES }, -#endif { VLC_CODEC_MLP, CODEC_ID_MLP, AUDIO_ES }, diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c index 8ea735fc03..755b1d77a4 100644 --- a/modules/codec/avcodec/video.c +++ b/modules/codec/avcodec/video.c @@ -658,13 +658,9 @@ picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block ) } else if( p_context->time_base.den > 0 ) { -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,20,0) int i_tick = p_context->ticks_per_frame; if( i_tick <= 0 ) i_tick = 1; -#else - int i_tick = 1; -#endif p_sys->i_pts += INT64_C(1000000) * (2 + p_sys->p_ff_pic->repeat_pict) * diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c index 91608f032a..60c9941387 100644 --- a/modules/demux/avformat/demux.c +++ b/modules/demux/avformat/demux.c @@ -59,10 +59,6 @@ # define HAVE_FFMPEG_CODEC_ATTACHMENT 1 #endif -#if (LIBAVFORMAT_VERSION_INT >= ((52<<16)+(15<<8)+0) ) -# define HAVE_FFMPEG_CHAPTERS 1 -#endif - /***************************************************************************** * demux_sys_t: demux descriptor *****************************************************************************/ @@ -273,11 +269,7 @@ int OpenDemux( vlc_object_t *p_this ) fmt.i_bitrate = cc->bit_rate; fmt.audio.i_channels = cc->channels; fmt.audio.i_rate = cc->sample_rate; -#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) - fmt.audio.i_bitspersample = cc->bits_per_sample; -#else fmt.audio.i_bitspersample = cc->bits_per_coded_sample; -#endif fmt.audio.i_blockalign = cc->block_align; psz_type = "audio"; break; @@ -472,7 +464,6 @@ int OpenDemux( vlc_object_t *p_this ) ( p_sys->ic->duration != (int64_t)AV_NOPTS_VALUE ) ? p_sys->ic->duration * 1000000 / AV_TIME_BASE : -1 ); -#ifdef HAVE_FFMPEG_CHAPTERS if( p_sys->ic->nb_chapters > 0 ) p_sys->p_title = vlc_input_title_New(); for( i = 0; i < p_sys->ic->nb_chapters; i++ ) @@ -491,7 +482,6 @@ int OpenDemux( vlc_object_t *p_this ) (i_start_time != -1 ? i_start_time : 0 ); TAB_APPEND( p_sys->p_title->i_seekpoint, p_sys->p_title->seekpoint, s ); } -#endif return VLC_SUCCESS; } diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c index a09aab4d68..af69662b8a 100644 --- a/modules/demux/avformat/mux.c +++ b/modules/demux/avformat/mux.c @@ -151,11 +151,7 @@ int OpenMux( vlc_object_t *p_this ) return VLC_EGENERIC; } -#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(0<<8)+0) p_sys->oc->pb = &p_sys->io; -#else - p_sys->oc->pb = p_sys->io; -#endif p_sys->oc->nb_streams = 0; p_sys->b_write_header = true; -- 2.39.2