From 9d91aa23e6b91c50059f03710cd5cedf3328da8e Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 31 Mar 2011 12:55:18 +0200 Subject: decoder/ffmpeg: drop support for pre-0.5 ffmpeg All modern distros ship 0.5, so there's no need to support old and buggy ffmpeg versions. --- src/decoder/ffmpeg_decoder_plugin.c | 46 ------------------------------------- 1 file changed, 46 deletions(-) (limited to 'src/decoder/ffmpeg_decoder_plugin.c') diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c index d162f45fb..f40cc3381 100644 --- a/src/decoder/ffmpeg_decoder_plugin.c +++ b/src/decoder/ffmpeg_decoder_plugin.c @@ -32,22 +32,14 @@ #include #include -#ifdef OLD_FFMPEG_INCLUDES -#include -#include -#include -#else #include #include #include #include -#endif #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "ffmpeg" -#ifndef OLD_FFMPEG_INCLUDES - static GLogLevelFlags level_ffmpeg_to_glib(int level) { @@ -79,8 +71,6 @@ mpd_ffmpeg_log_callback(G_GNUC_UNUSED void *ptr, int level, } } -#endif /* !OLD_FFMPEG_INCLUDES */ - struct mpd_ffmpeg_stream { struct decoder *decoder; struct input_stream *input; @@ -143,9 +133,7 @@ mpd_ffmpeg_stream_close(struct mpd_ffmpeg_stream *stream) static bool ffmpeg_init(G_GNUC_UNUSED const struct config_param *param) { -#ifndef OLD_FFMPEG_INCLUDES av_log_set_callback(mpd_ffmpeg_log_callback); -#endif av_register_all(); return true; @@ -230,7 +218,6 @@ ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is, static enum sample_format ffmpeg_sample_format(G_GNUC_UNUSED const AVCodecContext *codec_context) { -#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(41<<8)+0) switch (codec_context->sample_fmt) { case SAMPLE_FMT_S16: return SAMPLE_FORMAT_S16; @@ -243,10 +230,6 @@ ffmpeg_sample_format(G_GNUC_UNUSED const AVCodecContext *codec_context) codec_context->sample_fmt); return SAMPLE_FORMAT_UNDEFINED; } -#else - /* XXX fixme 16-bit for older ffmpeg (13 Aug 2007) */ - return SAMPLE_FORMAT_S16; -#endif } static AVInputFormat * @@ -400,7 +383,6 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input) mpd_ffmpeg_stream_close(stream); } -#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0) typedef struct ffmpeg_tag_map { enum tag_type type; const char *name; @@ -438,8 +420,6 @@ ffmpeg_copy_metadata(struct tag *tag, AVMetadata *m, return mt != NULL; } -#endif - //no tag reading in ffmpeg, check if playable static struct tag * ffmpeg_stream_tag(struct input_stream *is) @@ -471,7 +451,6 @@ ffmpeg_stream_tag(struct input_stream *is) ? f->duration / AV_TIME_BASE : 0; -#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0) av_metadata_conv(f, NULL, f->iformat->metadata_conv); for (unsigned i = 0; i < sizeof(ffmpeg_tag_maps)/sizeof(ffmpeg_tag_map); i++) { @@ -480,31 +459,6 @@ ffmpeg_stream_tag(struct input_stream *is) if (idx >= 0) ffmpeg_copy_metadata(tag, f->streams[idx]->metadata, ffmpeg_tag_maps[i]); } -#else - if (f->author[0]) - tag_add_item(tag, TAG_ARTIST, f->author); - if (f->title[0]) - tag_add_item(tag, TAG_TITLE, f->title); - if (f->album[0]) - tag_add_item(tag, TAG_ALBUM, f->album); - - if (f->track > 0) { - char buffer[16]; - snprintf(buffer, sizeof(buffer), "%d", f->track); - tag_add_item(tag, TAG_TRACK, buffer); - } - - if (f->comment[0]) - tag_add_item(tag, TAG_COMMENT, f->comment); - if (f->genre[0]) - tag_add_item(tag, TAG_GENRE, f->genre); - if (f->year > 0) { - char buffer[16]; - snprintf(buffer, sizeof(buffer), "%d", f->year); - tag_add_item(tag, TAG_DATE, buffer); - } - -#endif av_close_input_stream(f); mpd_ffmpeg_stream_close(stream); -- cgit v1.2.3