From dbfee1be3d6da98d11517e1d166216c715720711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 17 Aug 2022 13:14:30 +0200 Subject: ao_pipewire: only try to read requested data --- audio/out/ao_pipewire.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c index a54a4c828c..b1fb395924 100644 --- a/audio/out/ao_pipewire.c +++ b/audio/out/ao_pipewire.c @@ -131,6 +131,10 @@ static void on_process(void *userdata) int bytes_per_channel = buf->datas[0].maxsize / ao->channels.num; int nframes = bytes_per_channel / ao->sstride; +#if PW_CHECK_VERSION(0, 3, 49) + if (b->requested != 0) + nframes = b->requested; +#endif for (int i = 0; i < buf->n_datas; i++) { data[i] = buf->datas[i].data; -- cgit v1.2.3