From c31e5da734b4bd386e675926037d938b82671922 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 3 Mar 2015 12:28:46 +0100 Subject: Remove some FFmpeg/Libav compatibility hacks All of these are now in the supported FFmpeg and Libav versions. The 3 remaining API checks are for FFmpeg-only things. --- demux/codec_tags.c | 3 +-- demux/demux_lavf.c | 35 ++--------------------------------- 2 files changed, 3 insertions(+), 35 deletions(-) (limited to 'demux') diff --git a/demux/codec_tags.c b/demux/codec_tags.c index fd95f83363..fd67933fbc 100644 --- a/demux/codec_tags.c +++ b/demux/codec_tags.c @@ -60,8 +60,7 @@ static const struct mp_codec_tag mp_codec_tags[] = { {0} }; -#define HAVE_QT_TAGS (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(55, 25, 100) && \ - LIBAVFORMAT_VERSION_MICRO >= 100) +#define HAVE_QT_TAGS (LIBAVFORMAT_VERSION_MICRO >= 100) static const char *lookup_tag(int type, uint32_t tag) { diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index bb0cdbb9de..90f49f40f9 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -32,12 +32,8 @@ #include #include #include -#if HAVE_AVCODEC_REPLAYGAIN_SIDE_DATA -# include -#endif -#if HAVE_AV_DISPLAYMATRIX -# include -#endif +#include +#include #include #include "options/options.h" @@ -427,7 +423,6 @@ static void select_tracks(struct demuxer *demuxer, int start) static void export_replaygain(demuxer_t *demuxer, sh_audio_t *sh, AVStream *st) { -#if HAVE_AVCODEC_REPLAYGAIN_SIDE_DATA for (int i = 0; i < st->nb_side_data; i++) { AVReplayGain *av_rgain; struct replaygain_data *rgain; @@ -453,7 +448,6 @@ static void export_replaygain(demuxer_t *demuxer, sh_audio_t *sh, AVStream *st) sh->replaygain_data = rgain; } -#endif } // Return a dictionary entry as (decimal) integer. @@ -544,15 +538,9 @@ static void handle_stream(demuxer_t *demuxer, int i) if (sh_video->bitrate == 0) sh_video->bitrate = avfc->bit_rate; -#if HAVE_AV_DISPLAYMATRIX uint8_t *sd = av_stream_get_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, NULL); if (sd) sh_video->rotate = -av_display_rotation_get((uint32_t *)sd); -#else - int rot = dict_get_decimal(st->metadata, "rotate", -1); - if (rot >= 0) - sh_video->rotate = rot; -#endif sh_video->rotate = ((sh_video->rotate % 360) + 360) % 360; // This also applies to vfw-muxed mkv, but we can't detect these easily. @@ -648,7 +636,6 @@ static void add_new_streams(demuxer_t *demuxer) static void update_metadata(demuxer_t *demuxer, AVPacket *pkt) { -#if HAVE_AVFORMAT_METADATA_UPDATE_FLAG lavf_priv_t *priv = demuxer->priv; if (priv->avfc->event_flags & AVFMT_EVENT_FLAG_METADATA_UPDATED) { mp_tags_copy_from_av_dictionary(demuxer->metadata, priv->avfc->metadata); @@ -665,24 +652,6 @@ static void update_metadata(demuxer_t *demuxer, AVPacket *pkt) } } } -#elif HAVE_AVCODEC_METADATA_UPDATE_SIDE_DATA - lavf_priv_t *priv = demuxer->priv; - int md_size; - const uint8_t *md; - if (!pkt) - return; - md = av_packet_get_side_data(pkt, AV_PKT_DATA_METADATA_UPDATE, &md_size); - if (md && priv->merge_track_metadata) { - AVDictionary *dict = NULL; - av_packet_unpack_dictionary(md, md_size, &dict); - if (dict) { - mp_tags_clear(demuxer->metadata); - mp_tags_copy_from_av_dictionary(demuxer->metadata, dict); - av_dict_free(&dict); - demux_changed(demuxer, DEMUX_EVENT_METADATA); - } - } -#endif } static int interrupt_cb(void *ctx) -- cgit v1.2.3