output/pipewire: wait for buffer to fill before resuming
This commit is contained in:
parent
668c3782b2
commit
00fd692eba
@ -462,11 +462,6 @@ PipeWireOutput::Play(const void *chunk, size_t size)
|
|||||||
{
|
{
|
||||||
const PipeWire::ThreadLoopLock lock(thread_loop);
|
const PipeWire::ThreadLoopLock lock(thread_loop);
|
||||||
|
|
||||||
if (paused) {
|
|
||||||
paused = false;
|
|
||||||
pw_stream_set_active(stream, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
CheckThrowError();
|
CheckThrowError();
|
||||||
|
|
||||||
@ -477,6 +472,14 @@ PipeWireOutput::Play(const void *chunk, size_t size)
|
|||||||
return bytes_written;
|
return bytes_written;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (paused) {
|
||||||
|
/* now that the ring_buffer is full, there is
|
||||||
|
enough data for Process(), so let's resume
|
||||||
|
the stream now */
|
||||||
|
paused = false;
|
||||||
|
pw_stream_set_active(stream, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (interrupted)
|
if (interrupted)
|
||||||
throw AudioOutputInterrupted{};
|
throw AudioOutputInterrupted{};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user