1 From 547a084c7ed95c09136159623240b7c92f6a2f5e Mon Sep 17 00:00:00 2001
2 From: Max Kellermann <max.kellermann@gmail.com>
3 Date: Fri, 8 Jul 2022 23:38:45 +0200
4 Subject: [PATCH] output/PipeWire: call pw_stream_flush() in Cancel()
6 Clear not only MPD's ring buffer, but also libpipewire's buffers, to
7 avoid playing some audio from the previous song after a manual song
10 Fixes part 1 of https://github.com/MusicPlayerDaemon/MPD/issues/1354
12 Upstream-Status: Backport [https://github.com/MusicPlayerDaemon/MPD/commit/547a084c7ed95c09136159623240b7c92f6a2f5e]
13 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
16 diff --git a/src/output/plugins/PipeWireOutputPlugin.cxx b/src/output/plugins/PipeWireOutputPlugin.cxx
17 index 7184edfa5..0f8550d41 100644
18 --- a/src/output/plugins/PipeWireOutputPlugin.cxx
19 +++ b/src/output/plugins/PipeWireOutputPlugin.cxx
20 @@ -895,7 +895,12 @@ PipeWireOutput::Cancel() noexcept
24 + /* clear MPD's ring buffer */
27 + /* clear libpipewire's buffer */
28 + pw_stream_flush(stream, false);