Commit c8dae95e authored by Max Kellermann's avatar Max Kellermann

output/PipeWire: after Cancel(), refill buffer before resuming playback

Deactivate the stream in Cancel(). This fixes stuttering after a manual song change by refilling the whole ring buffer before reactivating the stream. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1354
parent 547a084c
......@@ -7,6 +7,7 @@ ver 0.23.8 (not yet released)
- cdio_paranoia: don't scan for replay gain tags
- pipewire: fix playback of very short tracks
- pipewire: drop all buffers before manual song change
- pipewire: fix stuttering after manual song change
- snapcast: fix busy loop while paused
- snapcast: fix stuttering after resuming playback
* mixer
......
......@@ -901,6 +901,15 @@ PipeWireOutput::Cancel() noexcept
/* clear libpipewire's buffer */
pw_stream_flush(stream, false);
drained = true;
/* pause the PipeWire stream so libpipewire ceases invoking
the "process" callback (we have no data until our Play()
method gets called again); the stream will be resume by
Play() after the ring_buffer has been refilled */
if (active) {
active = false;
pw_stream_set_active(stream, false);
}
}
bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment