From 62cf4f1ab7f29f156dd399516e2301dc78fc9bb6 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 2 Dec 2013 18:42:33 +0100 Subject: update mpdbox package collection, new lighttpd, kernel, php, mpd, mpc, libmpd, ffmpeg --- package/mpd/Makefile | 25 +++- .../patches/patch-src_db_SimpleDatabasePlugin_cxx | 91 +++++++++++++++ .../mpd/patches/patch-src_db_simple_db_plugin_c | 89 --------------- .../patch-src_decoder_ffmpeg_decoder_plugin_c | 127 --------------------- package/mpd/patches/patch-src_thread_Id_hxx | 11 ++ 5 files changed, 123 insertions(+), 220 deletions(-) create mode 100644 package/mpd/patches/patch-src_db_SimpleDatabasePlugin_cxx delete mode 100644 package/mpd/patches/patch-src_db_simple_db_plugin_c delete mode 100644 package/mpd/patches/patch-src_decoder_ffmpeg_decoder_plugin_c create mode 100644 package/mpd/patches/patch-src_thread_Id_hxx (limited to 'package/mpd') diff --git a/package/mpd/Makefile b/package/mpd/Makefile index 7814fbeb6..46a1262c4 100644 --- a/package/mpd/Makefile +++ b/package/mpd/Makefile @@ -4,16 +4,17 @@ include ${TOPDIR}/rules.mk PKG_NAME:= mpd -PKG_VERSION:= 0.17.6 -PKG_RELEASE:= 4 -PKG_MD5SUM:= d0da6a6a1d9cf1e8710b6082f6ef7849 +PKG_VERSION:= 0.18.5 +PKG_RELEASE:= 1 +PKG_MD5SUM:= 63bcf6ce338caa2ae2cd6dc8e9710d5c PKG_DESCR:= A music player daemon PKG_SECTION:= multimedia PKG_DEPENDS:= glib libstdcxx libgcc libiconv PKG_FDEPENDS:= glib libstdcxx libgcc libiconv PKG_BUILDDEP:= glib PKG_URL:= http://www.musicpd.org/ -PKG_SITES:= http://www.musicpd.org/download/mpd/0.17/ +PKG_SITES:= http://www.musicpd.org/download/mpd/0.18/ +PKG_NEED_CXX:= 1 PKG_ARCH_DEPENDS:= !avr32 !m68k @@ -22,6 +23,7 @@ DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.xz PKG_FLAVOURS_MPD:= WITH_ALSA WITH_AO WITH_MP3 WITH_MP4 WITH_TREMOR PKG_FLAVOURS_MPD+= WITH_OGG WITH_FLAC WITH_WAV WITH_MMS WITH_FFMPEG PKG_FLAVOURS_MPD+= WITH_SHOUT WITH_CURL WITH_SAMPLERATE WITH_HTTPD +PKG_FLAVOURS_MPD+= WITH_OPUS PKGFD_WITH_ALSA:= enable ALSA output PKGFS_WITH_ALSA:= alsa-lib @@ -103,6 +105,13 @@ ifeq ($(ADK_PACKAGE_MPD_WITH_SAMPLERATE),y) PKG_FDEPENDS+= libsamplerate endif +PKGFD_WITH_OPUS:= enable OPUS support +PKGFS_WITH_OPUS:= libopus +PKGFB_WITH_OPUS:= opus +ifeq ($(ADK_PACKAGE_MPD_WITH_OPUS),y) +PKG_FDEPENDS+= libopus +endif + PKGFD_WITH_HTTPD:= enable HTTP output include ${TOPDIR}/mk/package.mk @@ -116,8 +125,10 @@ CONFIGURE_ARGS+= --disable-jack \ --disable-fifo \ --disable-pulse \ --disable-oss \ + --disable-bzip2 \ --disable-mpc \ --disable-wavpack \ + --disable-modplug \ --disable-sqlite \ --disable-mpg123 \ --disable-soundcloud \ @@ -214,6 +225,12 @@ else CONFIGURE_ARGS+= --disable-lsr endif +ifneq (${ADK_PACKAGE_MPD_WITH_OPUS},) +CONFIGURE_ARGS+= --enable-opus +else +CONFIGURE_ARGS+= --disable-opus +endif + mpd-install: ${INSTALL_DIR} ${IDIR_MPD}/usr/bin ${IDIR_MPD}/etc/mpd/playlists ${INSTALL_BIN} ${WRKINST}/usr/bin/mpd ${IDIR_MPD}/usr/bin diff --git a/package/mpd/patches/patch-src_db_SimpleDatabasePlugin_cxx b/package/mpd/patches/patch-src_db_SimpleDatabasePlugin_cxx new file mode 100644 index 000000000..0f28de720 --- /dev/null +++ b/package/mpd/patches/patch-src_db_SimpleDatabasePlugin_cxx @@ -0,0 +1,91 @@ +--- mpd-0.18.5.orig/src/db/SimpleDatabasePlugin.cxx 2013-11-22 00:33:30.000000000 +0100 ++++ mpd-0.18.5/src/db/SimpleDatabasePlugin.cxx 2013-11-30 19:17:55.000000000 +0100 +@@ -35,6 +35,9 @@ + + #include + #include ++#include ++#include ++#include + + static constexpr Domain simple_db_domain("simple_db"); + +@@ -95,8 +98,8 @@ SimpleDatabase::Check(Error &error) cons + return false; + } + +- /* Check if we can write to the directory */ +- if (!CheckAccess(dirPath, X_OK | W_OK)) { ++ /* Check if we can change into the directory */ ++ if (!CheckAccess(dirPath, X_OK)) { + const int e = errno; + const std::string dirPath_utf8 = dirPath.ToUTF8(); + error.FormatErrno(e, "Can't create db file in \"%s\"", +@@ -122,9 +125,9 @@ SimpleDatabase::Check(Error &error) cons + return false; + } + +- /* And check that we can write to it */ +- if (!CheckAccess(path, R_OK | W_OK)) { +- error.FormatErrno("Can't open db file \"%s\" for reading/writing", ++ /* And check that we can read it */ ++ if (!CheckAccess(path, R_OK)) { ++ error.FormatErrno("Can't open db file \"%s\" for reading", + path_utf8.c_str()); + return false; + } +@@ -281,6 +284,10 @@ SimpleDatabase::GetStats(const DatabaseS + bool + SimpleDatabase::Save(Error &error) + { ++ struct mntent *mnt; ++ int remount; ++ FILE *f; ++ + db_lock(); + + LogDebug(simple_db_domain, "removing empty directories from DB"); +@@ -293,6 +300,26 @@ SimpleDatabase::Save(Error &error) + + LogDebug(simple_db_domain, "writing DB"); + ++ remount = 0; ++ /* check if /data is mounted read-only */ ++ if ((f = setmntent("/proc/mounts", "r")) == NULL) ++ error.Format(simple_db_domain, "Checking /proc/mounts failed"); ++ ++ while ((mnt = getmntent(f)) != NULL) { ++ if (strcmp(mnt->mnt_dir, "/data") == 0 && ++ hasmntopt(mnt, MNTOPT_RO) != NULL) { ++ remount = 1; ++ } ++ } ++ endmntent(f); ++ ++ if (remount) { ++ if (mount("","/data",0,MS_REMOUNT,0)<0) { ++ error.Format(simple_db_domain, "Remounting /data rw failed"); ++ } ++ LogDebug(simple_db_domain, "Mounted /data successfully in read-write mode"); ++ } ++ + FILE *fp = FOpen(path, FOpenMode::WriteText); + if (!fp) { + error.FormatErrno("unable to write to db file \"%s\"", +@@ -310,6 +337,16 @@ SimpleDatabase::Save(Error &error) + + fclose(fp); + ++ if (remount) { ++ sync(); ++ if (mount("","/data",0,MS_REMOUNT|MS_RDONLY,0)<0) { ++ error.Format(simple_db_domain, "Remounting /data ro failed"); ++ } ++ LogDebug(simple_db_domain, "Mounted /data successfully in read-only mode"); ++ } ++ ++ LogDebug(simple_db_domain, "Successfully written database"); ++ + struct stat st; + if (StatFile(path, st)) + mtime = st.st_mtime; diff --git a/package/mpd/patches/patch-src_db_simple_db_plugin_c b/package/mpd/patches/patch-src_db_simple_db_plugin_c deleted file mode 100644 index 55ebba670..000000000 --- a/package/mpd/patches/patch-src_db_simple_db_plugin_c +++ /dev/null @@ -1,89 +0,0 @@ ---- mpd-0.17.6.orig/src/db/simple_db_plugin.c 2013-08-01 09:15:41.000000000 +0200 -+++ mpd-0.17.6/src/db/simple_db_plugin.c 2013-10-17 17:51:34.000000000 +0200 -@@ -28,6 +28,9 @@ - #include "conf.h" - #include "directory.h" - -+#include -+#include -+#include - #include - #include - #include -@@ -128,8 +131,8 @@ simple_db_check(struct simple_db *db, GE - return false; - } - -- /* Check if we can write to the directory */ -- if (access(dirPath, X_OK | W_OK)) { -+ /* Check if we can change into the directory */ -+ if (access(dirPath, X_OK)) { - g_set_error(error_r, simple_db_quark(), errno, - "Can't create db file in \"%s\": %s", - dirPath, g_strerror(errno)); -@@ -159,9 +162,9 @@ simple_db_check(struct simple_db *db, GE - } - - /* And check that we can write to it */ -- if (access(db->path, R_OK | W_OK)) { -+ if (access(db->path, R_OK)) { - g_set_error(error_r, simple_db_quark(), errno, -- "Can't open db file \"%s\" for reading/writing: %s", -+ "Can't open db file \"%s\" for reading: %s", - db->path, g_strerror(errno)); - return false; - } -@@ -305,6 +308,9 @@ simple_db_save(struct db *_db, GError ** - { - struct simple_db *db = (struct simple_db *)_db; - struct directory *music_root = db->root; -+ struct mntent *mnt; -+ int remount; -+ FILE *f; - - db_lock(); - -@@ -317,6 +323,26 @@ simple_db_save(struct db *_db, GError ** - db_unlock(); - - g_debug("writing DB"); -+ -+ remount = 0; -+ /* check if /data is mounted read-only */ -+ if ((f = setmntent("/proc/mounts", "r")) == NULL) -+ g_message("Checking /proc/mounts failed"); -+ -+ while ((mnt = getmntent(f)) != NULL) { -+ if (strcmp(mnt->mnt_dir, "/data") == 0 && -+ hasmntopt(mnt, MNTOPT_RO) != NULL) { -+ remount = 1; -+ } -+ } -+ endmntent(f); -+ -+ if (remount) { -+ if (mount("","/data",0,MS_REMOUNT,0)<0) { -+ g_error("Remounting /data rw failed"); -+ } -+ g_message("Mounted /data successfully in read-write mode"); -+ } - - FILE *fp = fopen(db->path, "w"); - if (!fp) { -@@ -338,6 +364,16 @@ simple_db_save(struct db *_db, GError ** - - fclose(fp); - -+ if (remount) { -+ sync(); -+ if (mount("","/data",0,MS_REMOUNT|MS_RDONLY,0)<0) { -+ g_error("Remounting /data ro failed"); -+ } -+ g_message("Mounted /data successfully in read-only mode"); -+ } -+ -+ g_message("Successfully written database to file: %s", db->path); -+ - struct stat st; - if (stat(db->path, &st) == 0) - db->mtime = st.st_mtime; diff --git a/package/mpd/patches/patch-src_decoder_ffmpeg_decoder_plugin_c b/package/mpd/patches/patch-src_decoder_ffmpeg_decoder_plugin_c deleted file mode 100644 index e9568905c..000000000 --- a/package/mpd/patches/patch-src_decoder_ffmpeg_decoder_plugin_c +++ /dev/null @@ -1,127 +0,0 @@ ---- mpd-0.17.6.orig/src/decoder/ffmpeg_decoder_plugin.c 2013-08-04 14:20:16.000000000 +0200 -+++ mpd-0.17.6/src/decoder/ffmpeg_decoder_plugin.c 2013-10-15 16:26:29.000000000 +0200 -@@ -255,7 +255,8 @@ copy_interleave_frame2(uint8_t *dest, ui - static int - copy_interleave_frame(const AVCodecContext *codec_context, - const AVFrame *frame, -- uint8_t *buffer, size_t buffer_size) -+ uint8_t **output_buffer, -+ uint8_t **global_buffer, int *global_buffer_size) - { - int plane_size; - const int data_size = -@@ -263,18 +264,26 @@ copy_interleave_frame(const AVCodecConte - codec_context->channels, - frame->nb_samples, - codec_context->sample_fmt, 1); -- if (buffer_size < (size_t)data_size) -- /* buffer is too small - shouldn't happen */ -- return AVERROR(EINVAL); - - if (av_sample_fmt_is_planar(codec_context->sample_fmt) && - codec_context->channels > 1) { -- copy_interleave_frame2(buffer, frame->extended_data, -+ if(*global_buffer_size < data_size) { -+ av_freep(global_buffer); -+ -+ *global_buffer = (uint8_t*)av_malloc(data_size); -+ -+ if (!*global_buffer) -+ /* Not enough memory - shouldn't happen */ -+ return AVERROR(ENOMEM); -+ *global_buffer_size = data_size; -+ } -+ *output_buffer = *global_buffer; -+ copy_interleave_frame2(*output_buffer, frame->extended_data, - frame->nb_samples, - codec_context->channels, - av_get_bytes_per_sample(codec_context->sample_fmt)); - } else { -- memcpy(buffer, frame->extended_data[0], data_size); -+ *output_buffer = frame->extended_data[0]; - } - - return data_size; -@@ -285,7 +294,8 @@ static enum decoder_command - ffmpeg_send_packet(struct decoder *decoder, struct input_stream *is, - const AVPacket *packet, - AVCodecContext *codec_context, -- const AVRational *time_base) -+ const AVRational *time_base, -+ uint8_t **buffer, int *buffer_size) - { - if (packet->pts >= 0 && packet->pts != (int64_t)AV_NOPTS_VALUE) - decoder_timestamp(decoder, -@@ -299,8 +309,7 @@ ffmpeg_send_packet(struct decoder *decod - #endif - - #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,25,0) -- uint8_t aligned_buffer[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16]; -- const size_t buffer_size = sizeof(aligned_buffer); -+ uint8_t *output_buffer; - #else - /* libavcodec < 0.8 needs an aligned buffer */ - uint8_t audio_buf[(AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2 + 16]; -@@ -316,7 +325,7 @@ ffmpeg_send_packet(struct decoder *decod - packet_size > 0 && - #endif - cmd == DECODE_COMMAND_NONE) { -- int audio_size = buffer_size; -+ int audio_size = 0; - #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,25,0) - - AVFrame *frame = avcodec_alloc_frame(); -@@ -332,12 +341,11 @@ ffmpeg_send_packet(struct decoder *decod - if (len >= 0 && got_frame) { - audio_size = copy_interleave_frame(codec_context, - frame, -- aligned_buffer, -- buffer_size); -+ &output_buffer, -+ buffer, buffer_size); - if (audio_size < 0) - len = audio_size; -- } else if (len >= 0) -- len = -1; -+ } - - #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0) - avcodec_free_frame(&frame); -@@ -373,7 +381,7 @@ ffmpeg_send_packet(struct decoder *decod - continue; - - cmd = decoder_data(decoder, is, -- aligned_buffer, audio_size, -+ output_buffer, audio_size, - codec_context->bit_rate / 1000); - } - return cmd; -@@ -589,6 +597,9 @@ ffmpeg_decode(struct decoder *decoder, s - decoder_initialized(decoder, &audio_format, - input->seekable, total_time); - -+ uint8_t *interleaved_buffer = NULL; -+ int interleaved_buffer_size = 0; -+ - enum decoder_command cmd; - do { - AVPacket packet; -@@ -599,7 +610,8 @@ ffmpeg_decode(struct decoder *decoder, s - if (packet.stream_index == audio_stream) - cmd = ffmpeg_send_packet(decoder, input, - &packet, codec_context, -- &av_stream->time_base); -+ &av_stream->time_base, -+ &interleaved_buffer, &interleaved_buffer_size); - else - cmd = decoder_get_command(decoder); - -@@ -620,6 +632,8 @@ ffmpeg_decode(struct decoder *decoder, s - } - } while (cmd != DECODE_COMMAND_STOP); - -+ av_freep(&interleaved_buffer); -+ - avcodec_close(codec_context); - #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(53,17,0) - avformat_close_input(&format_context); diff --git a/package/mpd/patches/patch-src_thread_Id_hxx b/package/mpd/patches/patch-src_thread_Id_hxx new file mode 100644 index 000000000..dabee4007 --- /dev/null +++ b/package/mpd/patches/patch-src_thread_Id_hxx @@ -0,0 +1,11 @@ +--- mpd-0.18.5.orig/src/thread/Id.hxx 2013-11-18 23:50:46.000000000 +0100 ++++ mpd-0.18.5/src/thread/Id.hxx 2013-11-29 20:50:36.000000000 +0100 +@@ -84,7 +84,7 @@ public: + #ifdef WIN32 + return id == other.id; + #else +- return ::pthread_equal(id, other.id); ++ return pthread_equal(id, other.id); + #endif + } + -- cgit v1.2.3