MPD: Upgrade to 0.18.11, convert to procd, refresh patches
authorTed Hess <thess@kitschensync.net>
Wed, 30 Jul 2014 15:40:21 +0000 (11:40 -0400)
committerTed Hess <thess@kitschensync.net>
Wed, 30 Jul 2014 15:40:21 +0000 (11:40 -0400)
Signed-off-by: Ted Hess <thess@kitschensync.net>
sound/mpd/Makefile
sound/mpd/files/mpd.init
sound/mpd/patches/100-compile-fixes.patch [deleted file]
sound/mpd/patches/200-allow-float-samples-ffmpeg.patch [deleted file]
sound/mpd/patches/210-support_raw_pcm_streams.patch
sound/mpd/patches/220-handle_slow_server_stream_startup.patch [new file with mode: 0644]

index bbe4cd2d59135855444deaa59a47f8354a1a9b49..c384bcbe754d0724c5b2e36bd5926bf3322cb3cf 100644 (file)
@@ -8,14 +8,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mpd
-PKG_VERSION:=0.17.6
-PKG_RELEASE:=4
+PKG_VERSION:=0.18.11
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.17/
-PKG_MD5SUM:=0a42ed81ff298c12e22c16be31097e4c
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.18/
+PKG_MD5SUM:=be23120f342250e8352f6499cb960fd2
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILE:=COPYING
+
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_BUILD_PARALLEL:=1
 
@@ -32,7 +35,7 @@ define Package/mpd/Default
   CATEGORY:=Sound
   TITLE:=Music Player Daemon
   URL:=http://www.musicpd.org/
-  DEPENDS:= +glib2 +libcurl +libpthread $(ICONV_DEPENDS) \
+  DEPENDS:= +glib2 +libcurl +libpthread +libmpdclient $(ICONV_DEPENDS) \
            +libflac +BUILD_PATENTED:libmad +libvorbisidec
 endef
 
@@ -98,6 +101,7 @@ CONFIGURE_ARGS += \
        --disable-fluidsynth \
        --disable-gme \
        --enable-inotify \
+       --disable-eventfd \
        --disable-iso9660 \
        --disable-jack \
        --disable-lame-encoder \
@@ -134,12 +138,8 @@ CONFIGURE_VARS += \
        $(if $(CONFIG_BUILD_PATENTED),MAD_CFLAGS="$(TARGET_CFLAGS)") \
        $(if $(CONFIG_BUILD_PATENTED),MAD_LIBS="$(TARGET_LDFLAGS) -lmad") \
 
-TARGET_CFLAGS += -std=gnu99
 TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib $(if $(ICONV_FULL),-liconv)
 
-# use gcc instead of g++ to avoid unnecessary linking against libstdc++
-TARGET_CXX:=$(TARGET_CC)
-
 ifeq ($(BUILD_VARIANT),full)
 
   CONFIGURE_ARGS += \
index 707564bbceab69bccbb63b923ec8d271dafc59c7..55cb51575a7260bd908a5edc35559817f2ac9b1f 100644 (file)
@@ -1,28 +1,26 @@
 #!/bin/sh /etc/rc.common
-# Copyright (C) 2007-2011 OpenWrt.org
+# Copyright (C) 2007-2014 OpenWrt.org
 
 START=93
 
-start() {
-       #create mpd directories
-       pld=`grep ^playlist_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
-       if [ ! -d $pld ]; then
-               mkdir -m 0755 -p $pld
-       fi
+USE_PROCD=1
 
-       # Set the initial volume to something manageable
-       [ -x /usr/bin/amixer ] && /usr/bin/amixer set PCM 40
+PROG=/usr/bin/mpd
+CONFIGFILE=/etc/mpd.conf
+NICEPRIO=-10
 
-       if [ -x /bin/nice ]; then
-               # This has real-time constraints, so let's at least tell the OS
-               # that this should have higher priority to avoid skipping
-               # when doing other things in the background.
-               nice -n -10
-       fi
+#TODO: Add uci config - nice, config
 
-       service_start /usr/bin/mpd
-}
+start_service() {
+       #create mpd directories from config
+       local pld=`grep ^playlist_directory "$CONFIGFILE" | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
+       if [ ! -d $pld ]; then
+               mkdir -m 0755 -p $pld
+       fi
 
-stop() {
-       service_stop /usr/bin/mpd
+       procd_open_instance
+       procd_set_param command "$PROG" --no-daemon "$CONFIGFILE"
+       # Give MPD some real-time priority
+       procd_set_param nice "$NICEPRIO"
+       procd_close_instance
 }
diff --git a/sound/mpd/patches/100-compile-fixes.patch b/sound/mpd/patches/100-compile-fixes.patch
deleted file mode 100644 (file)
index 9cfdd6d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/configure
-+++ b/configure
-@@ -9821,6 +9821,7 @@ fi
- # Check whether --with-faad was given.
- if test "${with_faad+set}" = set; then :
-   withval=$with_faad;
-+  faad_prefix=$with_faad;
- else
-   faad_prefix=""
- fi
---- a/src/input/file_input_plugin.c
-+++ b/src/input/file_input_plugin.c
-@@ -82,10 +82,6 @@ input_file_open(const char *filename,
-               return NULL;
-       }
--#ifdef POSIX_FADV_SEQUENTIAL
--      posix_fadvise(fd, (off_t)0, st.st_size, POSIX_FADV_SEQUENTIAL);
--#endif
--
-       fis = g_new(struct file_input_stream, 1);
-       input_stream_init(&fis->base, &input_plugin_file, filename,
-                         mutex, cond);
diff --git a/sound/mpd/patches/200-allow-float-samples-ffmpeg.patch b/sound/mpd/patches/200-allow-float-samples-ffmpeg.patch
deleted file mode 100644 (file)
index 620a47c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/src/decoder/ffmpeg_decoder_plugin.c
-+++ b/src/decoder/ffmpeg_decoder_plugin.c
-@@ -370,6 +370,13 @@
- #endif
-               return SAMPLE_FORMAT_S32;
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 94, 1)
-+      case AV_SAMPLE_FMT_FLT:
-+#else
-+      case SAMPLE_FMT_FLOAT:
-+#endif
-+              return SAMPLE_FORMAT_FLOAT;
-+
-       default:
-               g_warning("Unsupported libavcodec SampleFormat value: %d",
-                         codec_context->sample_fmt);
index 280082b3213f01c239cf10753951f4fdea30caaa..2fe086babf2bb7a006c1f5b928ea79279d855e2d 100644 (file)
@@ -1,20 +1,6 @@
---- a/src/decoder/ffmpeg_decoder_plugin.c
-+++ b/src/decoder/ffmpeg_decoder_plugin.c
-@@ -387,6 +387,13 @@ ffmpeg_probe(struct decoder *decoder, st
-       unsigned char *buffer = g_malloc(BUFFER_SIZE);
-       size_t nbytes = decoder_read(decoder, is, buffer, BUFFER_SIZE);
-+
-+      if ((nbytes > 0) && (nbytes < 1024))
-+      {
-+              // Gobble some more data if header is small
-+              nbytes += decoder_read(decoder, is, buffer + nbytes, BUFFER_SIZE - nbytes);
-+      }
-+
-       if (nbytes <= PADDING ||
-           !input_stream_lock_seek(is, 0, SEEK_SET, NULL)) {
-               g_free(buffer);
-@@ -683,6 +690,7 @@ static const char *const ffmpeg_mime_typ
+--- a/src/decoder/FfmpegDecoderPlugin.cxx
++++ b/src/decoder/FfmpegDecoderPlugin.cxx
+@@ -634,6 +634,7 @@ static const char *const ffmpeg_mime_typ
        "audio/qcelp",
        "audio/vorbis",
        "audio/vorbis+ogg",
diff --git a/sound/mpd/patches/220-handle_slow_server_stream_startup.patch b/sound/mpd/patches/220-handle_slow_server_stream_startup.patch
new file mode 100644 (file)
index 0000000..2c25c33
--- /dev/null
@@ -0,0 +1,16 @@
+--- a/src/decoder/FfmpegDecoderPlugin.cxx
++++ b/src/decoder/FfmpegDecoderPlugin.cxx
+@@ -373,6 +373,13 @@ ffmpeg_probe(Decoder *decoder, InputStre
+       unsigned char buffer[BUFFER_SIZE];
+       size_t nbytes = decoder_read(decoder, is, buffer, BUFFER_SIZE);
++
++      if ((nbytes > 0) && (nbytes < 1024))
++      {
++              // Gobble some more data if header is small
++              nbytes += decoder_read(decoder, is, buffer + nbytes, BUFFER_SIZE - nbytes);
++      }
++
+       if (nbytes <= PADDING || !is.LockRewind(IgnoreError()))
+               return nullptr;