Browse Source

Merge pull request #11371 from neheb/mpd2

mpd: update to 0.21.20
lilik-openwrt-22.03
Rosen Penev 5 years ago
committed by GitHub
parent
commit
ef5b6111dd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 112 additions and 64 deletions
  1. +2
    -2
      sound/mpd/Makefile
  2. +11
    -6
      sound/mpd/files/mpd.init
  3. +36
    -5
      sound/mpd/patches/010-treewide-use-boost-lround-when-std-round-is-unavaila.patch
  4. +34
    -0
      sound/mpd/patches/020-fix-incorrect-rounding.patch
  5. +5
    -5
      sound/mpd/patches/030-volume_mapping-get-rid-of-exp10-workaround.patch
  6. +0
    -28
      sound/mpd/patches/040-fix-aiff-and-amr.patch
  7. +24
    -8
      sound/mpd/patches/040-treewide-get-rid-of-C-math-function-usage.patch
  8. +0
    -10
      sound/mpd/patches/210-support_raw_pcm_streams.patch

+ 2
- 2
sound/mpd/Makefile View File

@ -6,12 +6,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mpd
PKG_VERSION:=0.21.19
PKG_VERSION:=0.21.20
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.musicpd.org/download/mpd/0.21/
PKG_HASH:=d3275e11d85637adde250cadf3b4f5aec2144228f0d8085767493fc46c55b2f9
PKG_HASH:=422ef0a996d961f3ebc6856395f3a855b45fa0059910e878fb98281007e510e1
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2.0-or-later


+ 11
- 6
sound/mpd/files/mpd.init View File

@ -12,19 +12,24 @@ NICEPRIO=-10
#TODO: Add uci config - nice, config
start_service() {
local pld lport
#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
pld=$(grep ^playlist_directory "$CONFIGFILE" | cut -d "\"" -f 2 | sed "s/~/\/root/g")
[ -d "$pld" ] || mkdir -m 0755 -p "$pld"
local lport=`grep ^port "$CONFIGFILE" | cut -d "\"" -f 2`
[ -z $lport ] && lport=6600
lport=$(grep ^port "$CONFIGFILE" | cut -d "\"" -f 2)
[ -z "$lport" ] && lport=6600
procd_open_instance
procd_add_mdns "mpd" "tcp" "$lport"
procd_set_param command "$PROG" --no-daemon "$CONFIGFILE"
procd_set_param stderr 1
# Give MPD some real-time priority
procd_set_param nice "$NICEPRIO"
procd_close_instance
}
reload_service() {
procd_send_signal "$PROG"
}

+ 36
- 5
sound/mpd/patches/010-treewide-use-boost-lround-when-std-round-is-unavaila.patch View File

@ -1,8 +1,7 @@
From bffc5cde6d71556f143500a12c53c1835deebe07 Mon Sep 17 00:00:00 2001
From 769cd0ee9f0cf8ceb026aa751b5d4a390bb5dbdc Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Sun, 2 Feb 2020 21:21:57 -0800
Subject: [PATCH 1/3] treewide: use boost::lround when std::round is
unavailable
Subject: [PATCH] treewide: use boost::lround when std::round is unavailable
This is the case with uClibc-ng currently.
@ -13,12 +12,14 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
src/decoder/plugins/FaadDecoderPlugin.cxx | 3 +-
src/mixer/plugins/WinmmMixerPlugin.cxx | 2 +-
src/output/plugins/HaikuOutputPlugin.cxx | 3 +-
src/pcm/Mix.cxx | 5 ++-
src/pcm/PcmMix.cxx | 5 ++-
src/player/CrossFade.cxx | 5 ++-
src/util/Math.hxx | 41 +++++++++++++++++++++++
8 files changed, 52 insertions(+), 16 deletions(-)
create mode 100644 src/util/Math.hxx
diff --git a/src/Stats.cxx b/src/Stats.cxx
index 2208312d7..7467a3a17 100644
--- a/src/Stats.cxx
+++ b/src/Stats.cxx
@@ -29,9 +29,9 @@
@ -41,6 +42,8 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
#ifdef ENABLE_DATABASE
const Database *db = partition.instance.GetDatabase();
diff --git a/src/command/PlayerCommands.cxx b/src/command/PlayerCommands.cxx
index 7f3b4f296..4acb8f2ad 100644
--- a/src/command/PlayerCommands.cxx
+++ b/src/command/PlayerCommands.cxx
@@ -34,13 +34,12 @@
@ -67,6 +70,25 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
if (pc.GetMixRampDelay() > FloatDuration::zero())
r.Format(COMMAND_STATUS_MIXRAMPDELAY ": %f\n",
diff --git a/src/decoder/plugins/FaadDecoderPlugin.cxx b/src/decoder/plugins/FaadDecoderPlugin.cxx
index 983103e0e..e1c9576d3 100644
--- a/src/decoder/plugins/FaadDecoderPlugin.cxx
+++ b/src/decoder/plugins/FaadDecoderPlugin.cxx
@@ -26,11 +26,11 @@
#include "util/ScopeExit.hxx"
#include "util/ConstBuffer.hxx"
#include "util/Domain.hxx"
+#include "util/Math.hxx"
#include "Log.hxx"
#include <neaacdec.h>
-#include <cmath>
#include <exception>
#include <assert.h>
diff --git a/src/mixer/plugins/WinmmMixerPlugin.cxx b/src/mixer/plugins/WinmmMixerPlugin.cxx
index 9661d6551..905e650ef 100644
--- a/src/mixer/plugins/WinmmMixerPlugin.cxx
+++ b/src/mixer/plugins/WinmmMixerPlugin.cxx
@@ -20,13 +20,13 @@
@ -84,6 +106,8 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
#include <windows.h>
class WinmmMixer final : public Mixer {
diff --git a/src/output/plugins/HaikuOutputPlugin.cxx b/src/output/plugins/HaikuOutputPlugin.cxx
index 952fb0c2f..01240aca9 100644
--- a/src/output/plugins/HaikuOutputPlugin.cxx
+++ b/src/output/plugins/HaikuOutputPlugin.cxx
@@ -22,6 +22,7 @@
@ -103,6 +127,8 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
#include <string.h>
#define UTF8_PLAY "\xE2\x96\xB6"
diff --git a/src/pcm/PcmMix.cxx b/src/pcm/PcmMix.cxx
index 17e34b005..59179f54e 100644
--- a/src/pcm/PcmMix.cxx
+++ b/src/pcm/PcmMix.cxx
@@ -22,11 +22,10 @@
@ -127,6 +153,8 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
vol1 = Clamp<int>(vol1, 0, PCM_VOLUME_1S);
return pcm_add_vol(dither, buffer1, buffer2, size,
diff --git a/src/player/CrossFade.cxx b/src/player/CrossFade.cxx
index ce86d3f0a..8a91516f1 100644
--- a/src/player/CrossFade.cxx
+++ b/src/player/CrossFade.cxx
@@ -23,10 +23,9 @@
@ -150,11 +178,14 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
} else {
/* Calculate mixramp overlap. */
const auto mixramp_overlap_current =
diff --git a/src/util/Math.hxx b/src/util/Math.hxx
new file mode 100644
index 000000000..bd856f5a9
--- /dev/null
+++ b/src/util/Math.hxx
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2020 Rosen Penev <rosenp@gmail.com>
+ * Copyright (C) 2018 Max Kellermann <max.kellermann@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions


+ 34
- 0
sound/mpd/patches/020-fix-incorrect-rounding.patch View File

@ -0,0 +1,34 @@
From ab5183cbc45818114cc4c226ace299a1fb917ab0 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Sun, 2 Feb 2020 16:34:09 -0800
Subject: [PATCH] [clang-tidy] fix incorrect rounding
Found with bugprone-incorrect-roundings
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
src/decoder/plugins/WavpackDecoderPlugin.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/decoder/plugins/WavpackDecoderPlugin.cxx b/src/decoder/plugins/WavpackDecoderPlugin.cxx
index 77751167f..97824de75 100644
--- a/src/decoder/plugins/WavpackDecoderPlugin.cxx
+++ b/src/decoder/plugins/WavpackDecoderPlugin.cxx
@@ -26,6 +26,7 @@
#include "fs/Path.hxx"
#include "util/Macros.hxx"
#include "util/Alloc.hxx"
+#include "util/Math.hxx"
#include "util/ScopeExit.hxx"
#include "util/RuntimeError.hxx"
@@ -265,8 +266,7 @@ wavpack_decode(DecoderClient &client, WavpackContext *wpc, bool can_seek)
if (samples_got == 0)
break;
- int bitrate = (int)(WavpackGetInstantBitrate(wpc) / 1000 +
- 0.5);
+ int bitrate = lround(WavpackGetInstantBitrate(wpc) / 1000);
format_samples(chunk, samples_got * audio_format.channels);
cmd = client.SubmitData(nullptr, chunk,

sound/mpd/patches/020-volume_mapping-get-rid-of-exp10-workaround.patch → sound/mpd/patches/030-volume_mapping-get-rid-of-exp10-workaround.patch View File


+ 0
- 28
sound/mpd/patches/040-fix-aiff-and-amr.patch View File

@ -1,28 +0,0 @@
From d5341ccfe1a29f8d88c279d246ddd4e0b53fbecc Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Sun, 2 Feb 2020 16:08:36 -0800
Subject: [PATCH] [clang-tidy] add missing comma
Found with bugprone-suspicious-missing-comma
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
src/decoder/plugins/FfmpegDecoderPlugin.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
index 6be0448b9..2bc1fb4ae 100644
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -762,7 +762,7 @@ static const char *const ffmpeg_mime_types[] = {
"audio/aac",
"audio/aacp",
"audio/ac3",
- "audio/aiff"
+ "audio/aiff",
"audio/amr",
"audio/basic",
"audio/flac",
--
2.24.1

sound/mpd/patches/030-treewide-get-rid-of-C-math-function-usage.patch → sound/mpd/patches/040-treewide-get-rid-of-C-math-function-usage.patch View File


+ 0
- 10
sound/mpd/patches/210-support_raw_pcm_streams.patch View File

@ -1,10 +0,0 @@
--- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx
+++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx
@@ -775,6 +775,7 @@ static const char *const ffmpeg_mime_typ
"audio/qcelp",
"audio/vorbis",
"audio/vorbis+ogg",
+ "audio/wav",
"audio/x-8svx",
"audio/x-16sv",
"audio/x-aac",

Loading…
Cancel
Save