Commit 7c9f4f7e authored by Max Kellermann's avatar Max Kellermann

output/pipewire: create inactive stream, fill ring_buffer first

This avoids underruns at the start of playback.
parent 00fd692e
......@@ -336,7 +336,13 @@ PipeWireOutput::Open(AudioFormat &audio_format)
{
disconnected = false;
restore_volume = true;
paused = false;
/* we're paused (inactive) now because of the flag
PW_STREAM_FLAG_INACTIVE; this way, we can fill the
ring_buffer before activating the stream, to avoid
underruns */
paused = true;
drain_requested = false;
drained = true;
......@@ -380,6 +386,7 @@ PipeWireOutput::Open(AudioFormat &audio_format)
PW_DIRECTION_OUTPUT,
target_id,
(enum pw_stream_flags)(PW_STREAM_FLAG_AUTOCONNECT |
PW_STREAM_FLAG_INACTIVE |
PW_STREAM_FLAG_MAP_BUFFERS |
PW_STREAM_FLAG_RT_PROCESS),
params, 1);
......
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