ao_pipewire: only try to read requested data

This commit is contained in:
Thomas Weißschuh 2022-08-17 13:14:30 +02:00 committed by Philip Langdale
parent 0638a91ff4
commit dbfee1be3d
1 changed files with 4 additions and 0 deletions

View File

@ -131,6 +131,10 @@ static void on_process(void *userdata)
int bytes_per_channel = buf->datas[0].maxsize / ao->channels.num; int bytes_per_channel = buf->datas[0].maxsize / ao->channels.num;
int nframes = bytes_per_channel / ao->sstride; 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++) { for (int i = 0; i < buf->n_datas; i++) {
data[i] = buf->datas[i].data; data[i] = buf->datas[i].data;