Преглед на файлове

MPD: Upgrade to 0.18.11, convert to procd, refresh patches

Signed-off-by: Ted Hess <thess@kitschensync.net>
Ted Hess преди 10 години
родител
ревизия
a3255798d7

+ 10
- 10
sound/mpd/Makefile Целия файл

@@ -8,14 +8,17 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=mpd
11
-PKG_VERSION:=0.17.6
12
-PKG_RELEASE:=4
11
+PKG_VERSION:=0.18.11
12
+PKG_RELEASE:=1
13 13
 
14
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15
-PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.17/
16
-PKG_MD5SUM:=0a42ed81ff298c12e22c16be31097e4c
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15
+PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.18/
16
+PKG_MD5SUM:=be23120f342250e8352f6499cb960fd2
17 17
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
18 18
 
19
+PKG_LICENSE:=GPL-2.0
20
+PKG_LICENSE_FILE:=COPYING
21
+
19 22
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
20 23
 PKG_BUILD_PARALLEL:=1
21 24
 
@@ -32,7 +35,7 @@ define Package/mpd/Default
32 35
   CATEGORY:=Sound
33 36
   TITLE:=Music Player Daemon
34 37
   URL:=http://www.musicpd.org/
35
-  DEPENDS:= +glib2 +libcurl +libpthread $(ICONV_DEPENDS) \
38
+  DEPENDS:= +glib2 +libcurl +libpthread +libmpdclient $(ICONV_DEPENDS) \
36 39
 	    +libflac +BUILD_PATENTED:libmad +libvorbisidec
37 40
 endef
38 41
 
@@ -98,6 +101,7 @@ CONFIGURE_ARGS += \
98 101
 	--disable-fluidsynth \
99 102
 	--disable-gme \
100 103
 	--enable-inotify \
104
+	--disable-eventfd \
101 105
 	--disable-iso9660 \
102 106
 	--disable-jack \
103 107
 	--disable-lame-encoder \
@@ -134,12 +138,8 @@ CONFIGURE_VARS += \
134 138
 	$(if $(CONFIG_BUILD_PATENTED),MAD_CFLAGS="$(TARGET_CFLAGS)") \
135 139
 	$(if $(CONFIG_BUILD_PATENTED),MAD_LIBS="$(TARGET_LDFLAGS) -lmad") \
136 140
 
137
-TARGET_CFLAGS += -std=gnu99
138 141
 TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib $(if $(ICONV_FULL),-liconv)
139 142
 
140
-# use gcc instead of g++ to avoid unnecessary linking against libstdc++
141
-TARGET_CXX:=$(TARGET_CC)
142
-
143 143
 ifeq ($(BUILD_VARIANT),full)
144 144
 
145 145
   CONFIGURE_ARGS += \

+ 17
- 19
sound/mpd/files/mpd.init Целия файл

@@ -1,28 +1,26 @@
1 1
 #!/bin/sh /etc/rc.common
2
-# Copyright (C) 2007-2011 OpenWrt.org
2
+# Copyright (C) 2007-2014 OpenWrt.org
3 3
 
4 4
 START=93
5 5
 
6
-start() {
7
-	#create mpd directories
8
-	pld=`grep ^playlist_directory /etc/mpd.conf | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
9
-	if [ ! -d $pld ]; then
10
-		mkdir -m 0755 -p $pld
11
-	fi
6
+USE_PROCD=1
12 7
 
13
-	# Set the initial volume to something manageable
14
-	[ -x /usr/bin/amixer ] && /usr/bin/amixer set PCM 40
8
+PROG=/usr/bin/mpd
9
+CONFIGFILE=/etc/mpd.conf
10
+NICEPRIO=-10
15 11
 
16
-	if [ -x /bin/nice ]; then
17
-		# This has real-time constraints, so let's at least tell the OS
18
-		# that this should have higher priority to avoid skipping
19
-		# when doing other things in the background.
20
-		nice -n -10
21
-	fi
12
+#TODO: Add uci config - nice, config
22 13
 
23
-	service_start /usr/bin/mpd
24
-}
14
+start_service() {
15
+	#create mpd directories from config
16
+	local pld=`grep ^playlist_directory "$CONFIGFILE" | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
17
+	if [ ! -d $pld ]; then
18
+		mkdir -m 0755 -p $pld
19
+	fi
25 20
 
26
-stop() {
27
-	service_stop /usr/bin/mpd
21
+	procd_open_instance
22
+	procd_set_param command "$PROG" --no-daemon "$CONFIGFILE"
23
+	# Give MPD some real-time priority
24
+	procd_set_param nice "$NICEPRIO"
25
+	procd_close_instance
28 26
 }

+ 0
- 23
sound/mpd/patches/100-compile-fixes.patch Целия файл

@@ -1,23 +0,0 @@
1
---- a/configure
2
-+++ b/configure
3
-@@ -9821,6 +9821,7 @@ fi
4
- # Check whether --with-faad was given.
5
- if test "${with_faad+set}" = set; then :
6
-   withval=$with_faad;
7
-+  faad_prefix=$with_faad;
8
- else
9
-   faad_prefix=""
10
- fi
11
---- a/src/input/file_input_plugin.c
12
-+++ b/src/input/file_input_plugin.c
13
-@@ -82,10 +82,6 @@ input_file_open(const char *filename,
14
- 		return NULL;
15
- 	}
16
- 
17
--#ifdef POSIX_FADV_SEQUENTIAL
18
--	posix_fadvise(fd, (off_t)0, st.st_size, POSIX_FADV_SEQUENTIAL);
19
--#endif
20
--
21
- 	fis = g_new(struct file_input_stream, 1);
22
- 	input_stream_init(&fis->base, &input_plugin_file, filename,
23
- 			  mutex, cond);

+ 0
- 16
sound/mpd/patches/200-allow-float-samples-ffmpeg.patch Целия файл

@@ -1,16 +0,0 @@
1
---- a/src/decoder/ffmpeg_decoder_plugin.c
2
-+++ b/src/decoder/ffmpeg_decoder_plugin.c
3
-@@ -370,6 +370,13 @@
4
- #endif
5
- 		return SAMPLE_FORMAT_S32;
6
- 
7
-+#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 94, 1)
8
-+	case AV_SAMPLE_FMT_FLT:
9
-+#else
10
-+	case SAMPLE_FMT_FLOAT:
11
-+#endif
12
-+		return SAMPLE_FORMAT_FLOAT;
13
-+
14
- 	default:
15
- 		g_warning("Unsupported libavcodec SampleFormat value: %d",
16
- 			  codec_context->sample_fmt);

+ 3
- 17
sound/mpd/patches/210-support_raw_pcm_streams.patch Целия файл

@@ -1,20 +1,6 @@
1
---- a/src/decoder/ffmpeg_decoder_plugin.c
2
-+++ b/src/decoder/ffmpeg_decoder_plugin.c
3
-@@ -387,6 +387,13 @@ ffmpeg_probe(struct decoder *decoder, st
4
- 
5
- 	unsigned char *buffer = g_malloc(BUFFER_SIZE);
6
- 	size_t nbytes = decoder_read(decoder, is, buffer, BUFFER_SIZE);
7
-+
8
-+	if ((nbytes > 0) && (nbytes < 1024))
9
-+	{
10
-+		// Gobble some more data if header is small
11
-+		nbytes += decoder_read(decoder, is, buffer + nbytes, BUFFER_SIZE - nbytes);
12
-+	}
13
-+
14
- 	if (nbytes <= PADDING ||
15
- 	    !input_stream_lock_seek(is, 0, SEEK_SET, NULL)) {
16
- 		g_free(buffer);
17
-@@ -683,6 +690,7 @@ static const char *const ffmpeg_mime_typ
1
+--- a/src/decoder/FfmpegDecoderPlugin.cxx
2
++++ b/src/decoder/FfmpegDecoderPlugin.cxx
3
+@@ -634,6 +634,7 @@ static const char *const ffmpeg_mime_typ
18 4
  	"audio/qcelp",
19 5
  	"audio/vorbis",
20 6
  	"audio/vorbis+ogg",

+ 16
- 0
sound/mpd/patches/220-handle_slow_server_stream_startup.patch Целия файл

@@ -0,0 +1,16 @@
1
+--- a/src/decoder/FfmpegDecoderPlugin.cxx
2
++++ b/src/decoder/FfmpegDecoderPlugin.cxx
3
+@@ -373,6 +373,13 @@ ffmpeg_probe(Decoder *decoder, InputStre
4
+ 
5
+ 	unsigned char buffer[BUFFER_SIZE];
6
+ 	size_t nbytes = decoder_read(decoder, is, buffer, BUFFER_SIZE);
7
++
8
++	if ((nbytes > 0) && (nbytes < 1024))
9
++	{
10
++		// Gobble some more data if header is small
11
++		nbytes += decoder_read(decoder, is, buffer + nbytes, BUFFER_SIZE - nbytes);
12
++	}
13
++
14
+ 	if (nbytes <= PADDING || !is.LockRewind(IgnoreError()))
15
+ 		return nullptr;
16
+