From d8bde114fd9685111274713c03985c72de3377b1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 9 Mar 2013 08:49:56 +0100 Subject: Prefix CODEC_ID_ with AV_ The old names have been deprecated a while ago, but were needed for supporting older ffmpeg/libav versions. The deprecated identifiers have been removed from recent Libav and FFmpeg git. This change breaks compatibility with Libav 0.8.x and equivalent FFmpeg releases. --- demux/codec_tags.c | 2 +- demux/demux.c | 20 ++++++++++---------- demux/demux_lavf.c | 18 +++++++++--------- 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'demux') diff --git a/demux/codec_tags.c b/demux/codec_tags.c index 429da5582c..d1a6cee65f 100644 --- a/demux/codec_tags.c +++ b/demux/codec_tags.c @@ -349,7 +349,7 @@ static const char *lookup_tag(const struct mp_codec_tag *mp_table, } const struct AVCodecTag *av_tags[] = {av_table, NULL}; int id = av_codec_get_id(av_tags, tag); - return id == CODEC_ID_NONE ? NULL : mp_codec_from_av_codec_id(id); + return id == AV_CODEC_ID_NONE ? NULL : mp_codec_from_av_codec_id(id); } void mp_set_video_codec_from_tag(struct sh_video *sh) diff --git a/demux/demux.c b/demux/demux.c index a99a050ee2..eaf1062cb2 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -496,18 +496,18 @@ void ds_add_packet(demux_stream_t *ds, demux_packet_t *dp) static void allocate_parser(AVCodecContext **avctx, AVCodecParserContext **parser, const char *format) { - enum CodecID codec_id = mp_codec_to_av_codec_id(format); + enum AVCodecID codec_id = mp_codec_to_av_codec_id(format); switch (codec_id) { - case CODEC_ID_AAC_LATM: - case CODEC_ID_AC3: - case CODEC_ID_EAC3: - case CODEC_ID_DTS: - case CODEC_ID_FLAC: - case CODEC_ID_MLP: - case CODEC_ID_MP3: - case CODEC_ID_MP2: - case CODEC_ID_TRUEHD: + case AV_CODEC_ID_AAC_LATM: + case AV_CODEC_ID_AC3: + case AV_CODEC_ID_EAC3: + case AV_CODEC_ID_DTS: + case AV_CODEC_ID_FLAC: + case AV_CODEC_ID_MLP: + case AV_CODEC_ID_MP3: + case AV_CODEC_ID_MP2: + case AV_CODEC_ID_TRUEHD: *avctx = avcodec_alloc_context3(NULL); if (!*avctx) return; diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 50f9f1e8f0..843bd171e4 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -403,22 +403,22 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) case AVMEDIA_TYPE_SUBTITLE: { sh_sub_t *sh_sub; char type; - if (codec->codec_id == CODEC_ID_TEXT || + if (codec->codec_id == AV_CODEC_ID_TEXT || codec->codec_id == AV_CODEC_ID_SUBRIP) type = 't'; - else if (codec->codec_id == CODEC_ID_MOV_TEXT) + else if (codec->codec_id == AV_CODEC_ID_MOV_TEXT) type = 'm'; - else if (codec->codec_id == CODEC_ID_SSA) + else if (codec->codec_id == AV_CODEC_ID_SSA) type = 'a'; - else if (codec->codec_id == CODEC_ID_DVD_SUBTITLE) + else if (codec->codec_id == AV_CODEC_ID_DVD_SUBTITLE) type = 'v'; - else if (codec->codec_id == CODEC_ID_XSUB) + else if (codec->codec_id == AV_CODEC_ID_XSUB) type = 'x'; - else if (codec->codec_id == CODEC_ID_DVB_SUBTITLE) + else if (codec->codec_id == AV_CODEC_ID_DVB_SUBTITLE) type = 'b'; - else if (codec->codec_id == CODEC_ID_DVB_TELETEXT) + else if (codec->codec_id == AV_CODEC_ID_DVB_TELETEXT) type = 'd'; - else if (codec->codec_id == CODEC_ID_HDMV_PGS_SUBTITLE) + else if (codec->codec_id == AV_CODEC_ID_HDMV_PGS_SUBTITLE) type = 'p'; else break; @@ -440,7 +440,7 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) AVDictionaryEntry *ftag = av_dict_get(st->metadata, "filename", NULL, 0); char *filename = ftag ? ftag->value : NULL; - if (st->codec->codec_id == CODEC_ID_TTF) + if (st->codec->codec_id == AV_CODEC_ID_TTF) demuxer_add_attachment(demuxer, bstr0(filename), bstr0("application/x-truetype-font"), (struct bstr){codec->extradata, -- cgit v1.2.3