mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-29 18:16:29 +00:00
[client] audio/pw: delay playback to avoid glitches
This commit is contained in:
parent
4c389a9274
commit
e72e138267
@ -264,8 +264,14 @@ static void pipewire_playbackPlay(uint8_t * data, size_t size)
|
|||||||
|
|
||||||
switch (pw.playback.state) {
|
switch (pw.playback.state) {
|
||||||
case STREAM_STATE_INACTIVE:
|
case STREAM_STATE_INACTIVE:
|
||||||
|
// Don't start playback until the buffer is sufficiently full to avoid
|
||||||
|
// glitches
|
||||||
|
if (ringbuffer_getCount(pw.playback.buffer) >=
|
||||||
|
ringbuffer_getLength(pw.playback.buffer) / 4)
|
||||||
|
{
|
||||||
pw_stream_set_active(pw.playback.stream, true);
|
pw_stream_set_active(pw.playback.stream, true);
|
||||||
pw.playback.state = STREAM_STATE_ACTIVE;
|
pw.playback.state = STREAM_STATE_ACTIVE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STREAM_STATE_FLUSHING:
|
case STREAM_STATE_FLUSHING:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user