All modern distros ship 0.6, so there's no need to support old and buggy
ffmpeg versions.
---
 configure.ac                        |   13 +--------
 src/decoder/ffmpeg_decoder_plugin.c |   51 -----------------------------------
 src/input/ffmpeg_input_plugin.c     |    7 -----
 3 files changed, 1 insertions(+), 70 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5af8324..35d60de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -771,21 +771,10 @@ AM_CONDITIONAL(HAVE_FAAD, test x$enable_aac = xyes)
 AM_CONDITIONAL(HAVE_MP4, test x$enable_mp4 = xyes)
 
 dnl ---------------------------------- ffmpeg ---------------------------------
-MPD_AUTO_PKG(ffmpeg, FFMPEG, [libavformat >= 52 libavcodec >= 51 libavutil >= 
49],
+MPD_AUTO_PKG(ffmpeg, FFMPEG, [libavformat >= 52.64 libavcodec >= 52.72 
libavutil >= 50.15],
        [ffmpeg decoder library], [libavformat+libavcodec+libavutil not found])
 
 if test x$enable_ffmpeg = xyes; then
-       # prior to ffmpeg svn12865, you had to specify include files
-       # without path prefix
-       old_CPPCFLAGS=$CPPFLAGS
-       CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
-       AC_CHECK_HEADER(libavcodec/avcodec.h,,
-               AC_DEFINE(OLD_FFMPEG_INCLUDES, 1,
-                       [Define if avcodec.h instead of libavcodec/avcodec.h 
should be included]))
-       CPPCFLAGS=$old_CPPFLAGS
-fi
-
-if test x$enable_ffmpeg = xyes; then
        AC_DEFINE(HAVE_FFMPEG, 1, [Define for FFMPEG support])
 fi
 
diff --git a/src/decoder/ffmpeg_decoder_plugin.c 
b/src/decoder/ffmpeg_decoder_plugin.c
index d162f45..4eade76 100644
--- a/src/decoder/ffmpeg_decoder_plugin.c
+++ b/src/decoder/ffmpeg_decoder_plugin.c
@@ -32,22 +32,14 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#ifdef OLD_FFMPEG_INCLUDES
-#include <avcodec.h>
-#include <avformat.h>
-#include <avio.h>
-#else
 #include <libavcodec/avcodec.h>
 #include <libavformat/avformat.h>
 #include <libavformat/avio.h>
 #include <libavutil/log.h>
-#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;
@@ -408,13 +390,8 @@ typedef struct ffmpeg_tag_map {
 
 static const ffmpeg_tag_map ffmpeg_tag_maps[] = {
        { TAG_TITLE,             "title" },
-#if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(50<<8))
        { TAG_ARTIST,            "artist" },
        { TAG_DATE,              "date" },
-#else
-       { TAG_ARTIST,            "author" },
-       { TAG_DATE,              "year" },
-#endif
        { TAG_ALBUM,             "album" },
        { TAG_COMMENT,           "comment" },
        { TAG_GENRE,             "genre" },
@@ -438,8 +415,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 +446,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 +454,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);
diff --git a/src/input/ffmpeg_input_plugin.c b/src/input/ffmpeg_input_plugin.c
index b6f8d81..de201e9 100644
--- a/src/input/ffmpeg_input_plugin.c
+++ b/src/input/ffmpeg_input_plugin.c
@@ -21,13 +21,8 @@
 #include "input/ffmpeg_input_plugin.h"
 #include "input_plugin.h"
 
-#ifdef OLD_FFMPEG_INCLUDES
-#include <avio.h>
-#include <avformat.h>
-#else
 #include <libavformat/avio.h>
 #include <libavformat/avformat.h>
-#endif
 
 #undef G_LOG_DOMAIN
 #define G_LOG_DOMAIN "input_ffmpeg"
@@ -52,14 +47,12 @@ input_ffmpeg_init(G_GNUC_UNUSED const struct config_param 
*param,
 {
        av_register_all();
 
-#if LIBAVFORMAT_VERSION_MAJOR >= 52
        /* disable this plugin if there's no registered protocol */
        if (av_protocol_next(NULL) == NULL) {
                g_set_error(error_r, ffmpeg_quark(), 0,
                            "No protocol");
                return false;
        }
-#endif
 
        return true;
 }
-- 
1.7.4.1


------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to