]> git.pld-linux.org Git - packages/mpd.git/commitdiff
upstream patch for dynamic samplerate selection with pipewire output plugin auto/th/mpd-0.23-1
authorJan Palus <atler@pld-linux.org>
Mon, 18 Oct 2021 15:10:44 +0000 (17:10 +0200)
committerJan Palus <atler@pld-linux.org>
Mon, 18 Oct 2021 15:12:08 +0000 (17:12 +0200)
see: https://github.com/MusicPlayerDaemon/MPD/issues/1283

mpd.spec
pipewire-graph-samplerate.patch [new file with mode: 0644]

index d1ce4d6be9c382a35e11a5107282b91b0bd6a919..58f5287b58b02efefbc2c8b036fcc39396d607e5 100644 (file)
--- a/mpd.spec
+++ b/mpd.spec
@@ -20,6 +20,7 @@ Source2:      %{name}.init
 Source3:       %{name}.sysconfig
 Source4:       %{name}.tmpfiles
 Patch0:                smb.patch
+Patch1:                pipewire-graph-samplerate.patch
 URL:           http://www.musicpd.org/
 BuildRequires: OpenAL-devel
 BuildRequires: adplug-devel
@@ -173,6 +174,7 @@ Dokumentacja do Music Player Daemon (MPD).
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %meson build \
diff --git a/pipewire-graph-samplerate.patch b/pipewire-graph-samplerate.patch
new file mode 100644 (file)
index 0000000..e62d56c
--- /dev/null
@@ -0,0 +1,31 @@
+From d5be8c74b009cdfc16b2b637aa9c4edb11cf105d Mon Sep 17 00:00:00 2001
+From: Max Kellermann <max@musicpd.org>
+Date: Mon, 18 Oct 2021 16:45:21 +0200
+Subject: [PATCH] output/pipewire: attempt to change the graph sample rate
+
+Requires PipeWire 0.3.32.
+
+Closes https://github.com/MusicPlayerDaemon/MPD/issues/1283
+---
+ NEWS                                        | 1 +
+ src/output/plugins/PipeWireOutputPlugin.cxx | 7 +++++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/src/output/plugins/PipeWireOutputPlugin.cxx b/src/output/plugins/PipeWireOutputPlugin.cxx
+index 6579c93b6..db7c36823 100644
+--- a/src/output/plugins/PipeWireOutputPlugin.cxx
++++ b/src/output/plugins/PipeWireOutputPlugin.cxx
+@@ -383,6 +383,13 @@ PipeWireOutput::Open(AudioFormat &audio_format)
+       if (target != nullptr && target_id == PW_ID_ANY)
+               pw_properties_setf(props, PW_KEY_NODE_TARGET, "%s", target);
++#ifdef PW_KEY_NODE_RATE
++      /* ask PipeWire to change the graph sample rate to ours
++         (requires PipeWire 0.3.32) */
++      pw_properties_setf(props, PW_KEY_NODE_RATE, "1/%u",
++                         audio_format.sample_rate);
++#endif
++
+       const PipeWire::ThreadLoopLock lock(thread_loop);
+       stream = pw_stream_new_simple(pw_thread_loop_get_loop(thread_loop),
This page took 0.045095 seconds and 4 git commands to generate.