Commit e7fc1ae0 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Upgrade requirements for libavcodec and libavutil

parent ee5be2d0
......@@ -2309,7 +2309,7 @@ dnl
AC_ARG_ENABLE(avcodec,
[ --enable-avcodec libavcodec codec (default enabled)])
AS_IF([test "${enable_avcodec}" != "no"], [
PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [
PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 54.25.0 libavutil >= 52.0.0], [
dnl PKG_CHECK_EXISTS([libavcodec < 56],, [
dnl AC_MSG_ERROR([libavcodec versions 56 and later are not supported yet.])
dnl ])
......
......@@ -42,12 +42,6 @@
#include "chroma.h"
#include "avcommon.h"
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 53, 34, 0 )
# error You must update libavcodec to a version >= 53.34.0
#elif LIBAVCODEC_VERSION_INT < AV_VERSION_INT( 54, 25, 0 )
# warning You should update libavcodec to a version >= 54.25.0
#endif
/*****************************************************************************
* decoder_sys_t: decoder descriptor
*****************************************************************************/
......
......@@ -109,9 +109,6 @@ static inline void vlc_init_avcodec(vlc_object_t *obj)
vlc_init_avutil(obj);
#if LIBAVCODEC_VERSION_MAJOR < 54
avcodec_init();
#endif
avcodec_register_all();
vlc_avcodec_unlock();
......
......@@ -36,449 +36,6 @@
( (LIBAVCODEC_VERSION_MICRO < 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
(LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
#if LIBAVCODEC_VERSION_MAJOR < 54
# define AV_PICTURE_TYPE_B FF_B_TYPE
# define AV_PICTURE_TYPE_I FF_I_TYPE
# define AV_PICTURE_TYPE_P FF_P_TYPE
# define AV_SAMPLE_FMT_NONE SAMPLE_FMT_NONE
# define AV_SAMPLE_FMT_U8 SAMPLE_FMT_U8
# define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16
# define AV_SAMPLE_FMT_S32 SAMPLE_FMT_S32
# define AV_SAMPLE_FMT_FLT SAMPLE_FMT_FLT
# define AV_SAMPLE_FMT_DBL SAMPLE_FMT_DBL
#ifndef AV_CH_FRONT_LEFT
# define AV_CH_FRONT_LEFT CH_FRONT_LEFT
#endif
#ifndef AV_CH_FRONT_RIGHT
# define AV_CH_FRONT_RIGHT CH_FRONT_RIGHT
#endif
#ifndef AV_CH_FRONT_CENTER
# define AV_CH_FRONT_CENTER CH_FRONT_CENTER
#endif
#ifndef AV_CH_LOW_FREQUENCY
# define AV_CH_LOW_FREQUENCY CH_LOW_FREQUENCY
#endif
#ifndef AV_CH_BACK_LEFT
# define AV_CH_BACK_LEFT CH_BACK_LEFT
#endif
#ifndef AV_CH_BACK_RIGHT
# define AV_CH_BACK_RIGHT CH_BACK_RIGHT
#endif
#ifndef AV_CH_FRONT_LEFT_OF_CENTER
# define AV_CH_FRONT_LEFT_OF_CENTER CH_FRONT_LEFT_OF_CENTER
#endif
#ifndef AV_CH_FRONT_RIGHT_OF_CENTER
# define AV_CH_FRONT_RIGHT_OF_CENTER CH_FRONT_RIGHT_OF_CENTER
#endif
#ifndef AV_CH_BACK_CENTER
# define AV_CH_BACK_CENTER CH_BACK_CENTER
#endif
#ifndef AV_CH_SIDE_LEFT
# define AV_CH_SIDE_LEFT CH_SIDE_LEFT
#endif
#ifndef AV_CH_SIDE_RIGHT
# define AV_CH_SIDE_RIGHT CH_SIDE_RIGHT
#endif
#ifndef AV_CH_TOP_CENTER
# define AV_CH_TOP_CENTER CH_TOP_CENTER
#endif
#ifndef AV_CH_TOP_FRONT_LEFT
# define AV_CH_TOP_FRONT_LEFT CH_TOP_FRONT_LEFT
#endif
#ifndef AV_CH_TOP_FRONT_CENTER
# define AV_CH_TOP_FRONT_CENTER CH_TOP_FRONT_CENTER
#endif
#ifndef AV_CH_TOP_FRONT_RIGHT
# define AV_CH_TOP_FRONT_RIGHT CH_TOP_FRONT_RIGHT
#endif
#ifndef AV_CH_TOP_BACK_LEFT
# define AV_CH_TOP_BACK_LEFT CH_TOP_BACK_LEFT
#endif
#ifndef AV_CH_TOP_BACK_CENTER
# define AV_CH_TOP_BACK_CENTER CH_TOP_BACK_CENTER
#endif
#ifndef AV_CH_TOP_BACK_RIGHT
# define AV_CH_TOP_BACK_RIGHT CH_TOP_BACK_RIGHT
#endif
#ifndef AV_CH_STEREO_LEFT
# define AV_CH_STEREO_LEFT CH_STEREO_LEFT
#endif
#ifndef AV_CH_STEREO_RIGHT
# define AV_CH_STEREO_RIGHT CH_STEREO_RIGHT
#endif
#endif /* LIBAVCODEC_VERSION_MAJOR < 54 */
#if !LIBAVCODEC_VERSION_CHECK(54, 25, 0, 51, 100)
#define AVCodecID CodecID
enum {
AV_CODEC_ID_NONE,
/* video codecs */
AV_CODEC_ID_MPEG1VIDEO,
AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
AV_CODEC_ID_MPEG2VIDEO_XVMC,
AV_CODEC_ID_H261,
AV_CODEC_ID_H263,
AV_CODEC_ID_RV10,
AV_CODEC_ID_RV20,
AV_CODEC_ID_MJPEG,
AV_CODEC_ID_MJPEGB,
AV_CODEC_ID_LJPEG,
AV_CODEC_ID_SP5X,
AV_CODEC_ID_JPEGLS,
AV_CODEC_ID_MPEG4,
AV_CODEC_ID_RAWVIDEO,
AV_CODEC_ID_MSMPEG4V1,
AV_CODEC_ID_MSMPEG4V2,
AV_CODEC_ID_MSMPEG4V3,
AV_CODEC_ID_WMV1,
AV_CODEC_ID_WMV2,
AV_CODEC_ID_H263P,
AV_CODEC_ID_H263I,
AV_CODEC_ID_FLV1,
AV_CODEC_ID_SVQ1,
AV_CODEC_ID_SVQ3,
AV_CODEC_ID_DVVIDEO,
AV_CODEC_ID_HUFFYUV,
AV_CODEC_ID_CYUV,
AV_CODEC_ID_H264,
AV_CODEC_ID_INDEO3,
AV_CODEC_ID_VP3,
AV_CODEC_ID_THEORA,
AV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CAVS,
AV_CODEC_ID_JPEG2000,
AV_CODEC_ID_VMNC,
AV_CODEC_ID_VP5,
AV_CODEC_ID_VP6,
AV_CODEC_ID_VP6F,
AV_CODEC_ID_TARGA,
AV_CODEC_ID_DSICINVIDEO,
AV_CODEC_ID_TIERTEXSEQVIDEO,
AV_CODEC_ID_TIFF,
AV_CODEC_ID_GIF,
#if LIBAVCODEC_VERSION_MAJOR == 53
AV_CODEC_ID_FFH264,
#endif
AV_CODEC_ID_DXA,
AV_CODEC_ID_DNXHD,
AV_CODEC_ID_THP,
AV_CODEC_ID_SGI,
AV_CODEC_ID_C93,
AV_CODEC_ID_BETHSOFTVID,
AV_CODEC_ID_PTX,
AV_CODEC_ID_TXD,
AV_CODEC_ID_VP6A,
AV_CODEC_ID_AMV,
AV_CODEC_ID_VB,
AV_CODEC_ID_PCX,
AV_CODEC_ID_SUNRAST,
AV_CODEC_ID_INDEO4,
AV_CODEC_ID_INDEO5,
AV_CODEC_ID_MIMIC,
AV_CODEC_ID_RL2,
#if LIBAVCODEC_VERSION_MAJOR == 53
AV_CODEC_ID_8SVX_EXP,
AV_CODEC_ID_8SVX_FIB,
#endif
AV_CODEC_ID_ESCAPE124,
AV_CODEC_ID_DIRAC,
AV_CODEC_ID_BFI,
AV_CODEC_ID_CMV,
AV_CODEC_ID_MOTIONPIXELS,
AV_CODEC_ID_TGV,
AV_CODEC_ID_TGQ,
AV_CODEC_ID_TQI,
AV_CODEC_ID_AURA,
AV_CODEC_ID_AURA2,
AV_CODEC_ID_V210X,
AV_CODEC_ID_TMV,
AV_CODEC_ID_V210,
AV_CODEC_ID_DPX,
AV_CODEC_ID_MAD,
AV_CODEC_ID_FRWU,
AV_CODEC_ID_FLASHSV2,
AV_CODEC_ID_CDGRAPHICS,
AV_CODEC_ID_R210,
AV_CODEC_ID_ANM,
AV_CODEC_ID_BINKVIDEO,
AV_CODEC_ID_IFF_ILBM,
AV_CODEC_ID_IFF_BYTERUN1,
AV_CODEC_ID_KGV1,
AV_CODEC_ID_YOP,
AV_CODEC_ID_VP8,
AV_CODEC_ID_PICTOR,
AV_CODEC_ID_ANSI,
AV_CODEC_ID_A64_MULTI,
AV_CODEC_ID_A64_MULTI5,
AV_CODEC_ID_R10K,
AV_CODEC_ID_MXPEG,
AV_CODEC_ID_LAGARITH,
AV_CODEC_ID_PRORES,
AV_CODEC_ID_JV,
AV_CODEC_ID_DFA,
AV_CODEC_ID_WMV3IMAGE,
AV_CODEC_ID_VC1IMAGE,
#if LIBAVCODEC_VERSION_MAJOR == 53
AV_CODEC_ID_G723_1,
AV_CODEC_ID_G729,
#endif
AV_CODEC_ID_UTVIDEO,
AV_CODEC_ID_BMV_VIDEO,
AV_CODEC_ID_VBLE,
AV_CODEC_ID_DXTORY,
AV_CODEC_ID_V410,
AV_CODEC_ID_XWD,
AV_CODEC_ID_CDXL,
AV_CODEC_ID_XBM,
AV_CODEC_ID_ZEROCODEC,
AV_CODEC_ID_MSS1,
AV_CODEC_ID_MSA1,
AV_CODEC_ID_TSCC2,
AV_CODEC_ID_MTS2,
AV_CODEC_ID_CLLC,
/* various PAV_CM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
AV_CODEC_ID_PCM_S16LE = 0x10000,
AV_CODEC_ID_PCM_S16BE,
AV_CODEC_ID_PCM_U16LE,
AV_CODEC_ID_PCM_U16BE,
AV_CODEC_ID_PCM_S8,
AV_CODEC_ID_PCM_U8,
AV_CODEC_ID_PCM_MULAW,
AV_CODEC_ID_PCM_ALAW,
AV_CODEC_ID_PCM_S32LE,
AV_CODEC_ID_PCM_S32BE,
AV_CODEC_ID_PCM_U32LE,
AV_CODEC_ID_PCM_U32BE,
AV_CODEC_ID_PCM_S24LE,
AV_CODEC_ID_PCM_S24BE,
AV_CODEC_ID_PCM_U24LE,
AV_CODEC_ID_PCM_U24BE,
AV_CODEC_ID_PCM_S24DAUD,
AV_CODEC_ID_PCM_ZORK,
AV_CODEC_ID_PCM_S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ODEC_ID_RA_144 = 0x13000,
AV_CODEC_ID_RA_288,
/* various DPAV_CM codecs */
AV_CODEC_ID_ROQ_DPCM = 0x14000,
AV_CODEC_ID_INTERPLAY_DPCM,
AV_CODEC_ID_XAN_DPCM,
AV_CODEC_ID_SOL_DPCM,
/* audio codecs */
AV_CODEC_ID_MP2 = 0x15000,
AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
AV_CODEC_ID_AAC,
AV_CODEC_ID_AC3,
AV_CODEC_ID_DTS,
AV_CODEC_ID_VORBIS,
AV_CODEC_ID_DVAUDIO,
AV_CODEC_ID_WMAV1,
AV_CODEC_ID_WMAV2,
AV_CODEC_ID_MACE3,
AV_CODEC_ID_MACE6,
AV_CODEC_ID_VMDAUDIO,
#if LIBAVCODEC_VERSION_MAJOR == 53
AV_CODEC_ID_SONIC,
AV_CODEC_ID_SONIC_LS,
#endif
AV_CODEC_ID_FLAC,
AV_CODEC_ID_MP3ADU,
AV_CODEC_ID_MP3ON4,
AV_CODEC_ID_SHORTEN,
AV_CODEC_ID_ALAC,
AV_CODEC_ID_WESTWOOD_SND1,
AV_CODEC_ID_GSM, ///< as in Berlin toast format
AV_CODEC_ID_QDM2,
AV_CODEC_ID_COOK,
AV_CODEC_ID_TRUESPEECH,
AV_CODEC_ID_TTA,
AV_CODEC_ID_SMACKAUDIO,
AV_CODEC_ID_QCELP,
AV_CODEC_ID_WAVPACK,
AV_CODEC_ID_DSICINAUDIO,
AV_CODEC_ID_IMC,
AV_CODEC_ID_MUSEPACK7,
AV_CODEC_ID_MLP,
AV_CODEC_ID_GSM_MS, /* as found in WAV */
AV_CODEC_ID_ATRAC3,
#if LIBAVCODEC_VERSION_MAJOR < 56
AV_CODEC_ID_VOXWARE,
#endif
AV_CODEC_ID_APE,
AV_CODEC_ID_NELLYMOSER,
AV_CODEC_ID_MUSEPACK8,
AV_CODEC_ID_SPEEX,
AV_CODEC_ID_WMAVOICE,
AV_CODEC_ID_WMAPRO,
AV_CODEC_ID_WMALOSSLESS,
AV_CODEC_ID_ATRAC3P,
AV_CODEC_ID_EAC3,
AV_CODEC_ID_SIPR,
AV_CODEC_ID_MP1,
AV_CODEC_ID_TWINVQ,
AV_CODEC_ID_TRUEHD,
AV_CODEC_ID_MP4ALS,
AV_CODEC_ID_ATRAC1,
AV_CODEC_ID_BINKAUDIO_RDFT,
AV_CODEC_ID_BINKAUDIO_DCT,
AV_CODEC_ID_AAC_LATM,
AV_CODEC_ID_QDMC,
AV_CODEC_ID_CELT,
#if LIBAVCODEC_VERSION_MAJOR > 53
AV_CODEC_ID_G723_1,
AV_CODEC_ID_G729,
AV_CODEC_ID_8SVX_EXP,
AV_CODEC_ID_8SVX_FIB,
#endif
AV_CODEC_ID_BMV_AUDIO,
AV_CODEC_ID_RALF,
AV_CODEC_ID_IAC,
AV_CODEC_ID_ILBC,
/* subtitle codecs */
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
AV_CODEC_ID_DVD_SUBTITLE = 0x17000,
AV_CODEC_ID_DVB_SUBTITLE,
AV_CODEC_ID_TEXT, ///< raw UTF-8 text
AV_CODEC_ID_XSUB,
AV_CODEC_ID_SSA,
AV_CODEC_ID_MOV_TEXT,
AV_CODEC_ID_HDMV_PGS_SUBTITLE,
AV_CODEC_ID_DVB_TELETEXT,
AV_CODEC_ID_SRT,
/* other specific kind of codecs (generally used for attachments) */
AV_CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
AV_CODEC_ID_TTF = 0x18000,
AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
* stream (only used by libavformat) */
AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
* stream (only used by libavformat) */
AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information.
};
#endif /* LIBAVCODEC_VERSION < 54.25 */
#if LIBAVCODEC_VERSION_MAJOR < 54
# define avcodec_alloc_context3(a) avcodec_alloc_context()
# define avcodec_open2(a, b, c) avcodec_open(a, b)
# define err_recognition error_recognition
#endif
#endif /* HAVE_LIBAVCODEC_AVCODEC_H */
#ifdef HAVE_LIBAVUTIL_AVUTIL_H
......@@ -492,18 +49,10 @@ enum {
( (LIBAVUTIL_VERSION_MICRO < 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
(LIBAVUTIL_VERSION_MICRO >= 100 && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
#if LIBAVUTIL_VERSION_MAJOR < 52 && !defined(AV_CPU_FLAG_MMXEXT)
# define AV_CPU_FLAG_MMXEXT AV_CPU_FLAG_MMX2
#endif
#if !LIBAVUTIL_VERSION_CHECK( 52, 11, 0, 32, 100 )
# define AV_PIX_FMT_FLAG_HWACCEL PIX_FMT_HWACCEL
#endif
#if !LIBAVUTIL_VERSION_CHECK( 51, 44, 0, 76, 100 )
# define av_pix_fmt_desc_get(a) &av_pix_fmt_descriptors[a]
#endif
#endif /* HAVE_LIBAVUTIL_AVUTIL_H */
#ifdef HAVE_LIBAVFORMAT_AVFORMAT_H
......@@ -513,11 +62,6 @@ enum {
( (LIBAVFORMAT_VERSION_MICRO < 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
(LIBAVFORMAT_VERSION_MICRO >= 100 && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
#if LIBAVFORMAT_VERSION_MAJOR < 54
# define AVDictionaryEntry AVMetadataTag
# define av_dict_get av_metadata_get
#endif
#endif
#endif
......@@ -86,17 +86,13 @@ static const struct
{VLC_CODEC_I420_9B, PIX_FMT_YUV420P9BE, 0, 0, 0 },
{VLC_CODEC_I420_10L, PIX_FMT_YUV420P10LE, 0, 0, 0 },
{VLC_CODEC_I420_10B, PIX_FMT_YUV420P10BE, 0, 0, 0 },
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,13,0)
{VLC_CODEC_I422_9L, PIX_FMT_YUV422P9LE, 0, 0, 0 },
{VLC_CODEC_I422_9B, PIX_FMT_YUV422P9BE, 0, 0, 0 },
#endif
{VLC_CODEC_I422_10L, PIX_FMT_YUV422P10LE, 0, 0, 0 },
{VLC_CODEC_I422_10B, PIX_FMT_YUV422P10BE, 0, 0, 0 },
{VLC_CODEC_YUV420A, PIX_FMT_YUVA420P, 0, 0, 0 },
#if LIBAVUTIL_VERSION_CHECK( 51, 45, 0, 74, 100 )
{VLC_CODEC_YUV422A, AV_PIX_FMT_YUVA422P, 0, 0, 0 },
#endif
{VLC_CODEC_I444_9L, PIX_FMT_YUV444P9LE, 0, 0, 0 },
{VLC_CODEC_I444_9B, PIX_FMT_YUV444P9BE, 0, 0, 0 },
......@@ -134,9 +130,7 @@ static const struct
/* Paletized RGB */
{VLC_CODEC_RGBP, PIX_FMT_PAL8, 0, 0, 0},
#if LIBAVUTIL_VERSION_CHECK(51, 42, 0, 74,100)
{VLC_CODEC_GBR_PLANAR, AV_PIX_FMT_GBRP, 0, 0, 0 },
#endif
/* XYZ */
#if LIBAVUTIL_VERSION_CHECK(52, 10, 0, 25, 100)
......
......@@ -236,11 +236,7 @@ static const uint16_t mpeg4_default_non_intra_matrix[64] = {
23, 24, 25, 27, 28, 30, 31, 33,
};
#if LIBAVUTIL_VERSION_CHECK( 51, 27, 2, 46, 100 )
static const int DEFAULT_ALIGN = 0;
#else
static const int DEFAULT_ALIGN = 1;
#endif
/*****************************************************************************
......@@ -1112,7 +1108,6 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
frame->quality = p_sys->i_quality;
}
#if (LIBAVCODEC_VERSION_MAJOR >= 54)
AVPacket av_pkt;
int is_data;
......@@ -1134,63 +1129,6 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
if( unlikely( av_pkt.flags & AV_PKT_FLAG_CORRUPT ) )
p_block->i_flags |= BLOCK_FLAG_CORRUPTED;
#else
int i_out = avcodec_encode_video( p_sys->p_context, p_block->p_buffer,
p_block->i_buffer, frame );
if( i_out <= 0 )
{
block_Release( p_block );
return NULL;
}
p_block->i_buffer = i_out;
/* FIXME, 3-2 pulldown is not handled correctly */
p_block->i_length = INT64_C(1000000) *
p_enc->fmt_in.video.i_frame_rate_base /
p_enc->fmt_in.video.i_frame_rate;
if( !p_sys->p_context->max_b_frames || !p_sys->p_context->delay )
{
/* No delay -> output pts == input pts */
if( p_pict )
p_block->i_dts = p_pict->date;
p_block->i_pts = p_block->i_dts;
}
else if( p_sys->p_context->coded_frame->pts != AV_NOPTS_VALUE &&
p_sys->p_context->coded_frame->pts != 0 &&
p_sys->i_buggy_pts_detect != p_sys->p_context->coded_frame->pts )
{
p_sys->i_buggy_pts_detect = p_sys->p_context->coded_frame->pts;
p_block->i_pts = p_sys->p_context->coded_frame->pts;
if( p_sys->p_context->coded_frame->pict_type != AV_PICTURE_TYPE_I &&
p_sys->p_context->coded_frame->pict_type != AV_PICTURE_TYPE_P )
{
p_block->i_dts = p_block->i_pts;
}
else
{
if( p_sys->i_last_ref_pts )
{
p_block->i_dts = p_sys->i_last_ref_pts;
}
else
{
/* Let's put something sensible */
p_block->i_dts = p_block->i_pts;
}
p_sys->i_last_ref_pts = p_block->i_pts;
}
}
else if( p_pict )
{
/* Buggy libavcodec which doesn't update coded_frame->pts
* correctly */
p_block->i_dts = p_block->i_pts = p_pict->date;
}
#endif
switch ( p_sys->p_context->coded_frame->pict_type )
{
......
......@@ -189,9 +189,7 @@ static const struct
/* AV_CODEC_ID_CDGRAPHICS */
/* AV_CODEC_ID_R210 */
/* AV_CODEC_ID_ANM */
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 55, 0 )
{ VLC_CODEC_BINKVIDEO, AV_CODEC_ID_BINKVIDEO, VIDEO_ES },
#endif
/* AV_CODEC_ID_IFF_ILBM */
/* AV_CODEC_ID_IFF_BYTERUN1 */
{ VLC_CODEC_KGV1, AV_CODEC_ID_KGV1, VIDEO_ES },
......@@ -212,14 +210,10 @@ static const struct
{ VLC_CODEC_UTVIDEO, AV_CODEC_ID_UTVIDEO, VIDEO_ES },
{ VLC_CODEC_BMVVIDEO, AV_CODEC_ID_BMV_VIDEO, VIDEO_ES },
{ VLC_CODEC_VBLE, AV_CODEC_ID_VBLE, VIDEO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 53, 42, 0 )
{ VLC_CODEC_DXTORY, AV_CODEC_ID_DXTORY, VIDEO_ES },
#endif
/* AV_CODEC_ID_V410 */
/* AV_CODEC_ID_XWD */
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 54, 1, 0 )
{ VLC_CODEC_CDXL, AV_CODEC_ID_CDXL, VIDEO_ES },
#endif
/* AV_CODEC_ID_XBM */
/* AV_CODEC_ID_ZEROCODEC */
#if LIBAVCODEC_VERSION_CHECK( 54, 16, 0, 27, 100 )
......@@ -417,9 +411,7 @@ static const struct
{ VLC_CODEC_SPEEX, AV_CODEC_ID_SPEEX, AUDIO_ES },
{ VLC_CODEC_WMAS, AV_CODEC_ID_WMAVOICE, AUDIO_ES },
{ VLC_CODEC_WMAP, AV_CODEC_ID_WMAPRO, AUDIO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 54, 5, 0 )
{ VLC_CODEC_WMAL, AV_CODEC_ID_WMALOSSLESS, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_CHECK( 55, 32, 0, 47, 100 )
{ VLC_CODEC_ATRAC3P, AV_CODEC_ID_ATRAC3P, AUDIO_ES },
#endif
......@@ -430,10 +422,8 @@ static const struct
{ VLC_CODEC_TRUEHD, AV_CODEC_ID_TRUEHD, AUDIO_ES },
{ VLC_CODEC_ALS, AV_CODEC_ID_MP4ALS, AUDIO_ES },
{ VLC_CODEC_ATRAC1, AV_CODEC_ID_ATRAC1, AUDIO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 52, 55, 0 )
{ VLC_CODEC_BINKAUDIO_DCT, AV_CODEC_ID_BINKAUDIO_DCT, AUDIO_ES },
{ VLC_CODEC_BINKAUDIO_RDFT, AV_CODEC_ID_BINKAUDIO_RDFT, AUDIO_ES },
#endif
{ VLC_CODEC_MP4A, AV_CODEC_ID_AAC_LATM, AUDIO_ES },
/* AV_CODEC_ID_QDMC */
/* AV_CODEC_ID_CELT */
......@@ -442,9 +432,7 @@ static const struct
/* AV_CODEC_ID_8SVX_EXP */
/* AV_CODEC_ID_8SVX_FIB */
{ VLC_CODEC_BMVAUDIO, AV_CODEC_ID_BMV_AUDIO, AUDIO_ES },
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 54, 12, 0 )
{ VLC_CODEC_RALF, AV_CODEC_ID_RALF, AUDIO_ES },
#endif
#if LIBAVCODEC_VERSION_CHECK( 54, 14, 0, 26, 100 )
{ VLC_CODEC_INDEO_AUDIO, AV_CODEC_ID_IAC, AUDIO_ES },
#endif
......
......@@ -74,11 +74,7 @@ struct decoder_sys_t
/* */
#if LIBAVCODEC_VERSION_MAJOR < 54
AVPaletteControl palette;
#else
bool palette_sent;
#endif
/* */
bool b_flush;
......@@ -373,37 +369,6 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
p_dec->fmt_out.video.orientation = p_dec->fmt_in.video.orientation;
#if LIBAVCODEC_VERSION_MAJOR < 54
/* Setup palette */
memset( &p_sys->palette, 0, sizeof(p_sys->palette) );
if( p_dec->fmt_in.video.p_palette )
{
p_sys->palette.palette_changed = 1;
for( int i = 0; i < __MIN( AVPALETTE_COUNT, p_dec->fmt_in.video.p_palette->i_entries ); i++ )
{
union {
uint32_t u;
uint8_t a[4];
} c;
c.a[0] = p_dec->fmt_in.video.p_palette->palette[i][0];
c.a[1] = p_dec->fmt_in.video.p_palette->palette[i][1];
c.a[2] = p_dec->fmt_in.video.p_palette->palette[i][2];
c.a[3] = p_dec->fmt_in.video.p_palette->palette[i][3];
p_sys->palette.palette[i] = c.u;
}
p_sys->p_context->palctrl = &p_sys->palette;
p_dec->fmt_out.video.p_palette = malloc( sizeof(video_palette_t) );
if( p_dec->fmt_out.video.p_palette )
*p_dec->fmt_out.video.p_palette = *p_dec->fmt_in.video.p_palette;
}
else if( p_sys->i_codec_id != CODEC_ID_MSVIDEO1 && p_sys->i_codec_id != CODEC_ID_CINEPAK )
{
p_sys->p_context->palctrl = &p_sys->palette;
}
#else
if( p_dec->fmt_in.video.p_palette ) {