ao_pipewire: fix nframes calculation

`buf` contains a `struct spa_data` for each channel.
Therefore the number of channels does not matter to calculate the frame capacity of one `struct spa_data`.
In practice this shouldn't make a difference as `b->requested` would reduce nframes even more.
This commit is contained in:
Misaki Kasumi
2024-03-31 07:29:59 +08:00
committed by sfan5
parent 765a43a0ff
commit 3086f8fa3e

View File

@@ -173,8 +173,7 @@ static void on_process(void *userdata)
struct spa_buffer *buf = b->buffer;
int bytes_per_channel = buf->datas[0].maxsize / ao->channels.num;
int nframes = bytes_per_channel / ao->sstride;
int nframes = buf->datas[0].maxsize / ao->sstride;
#if PW_CHECK_VERSION(0, 3, 49)
if (b->requested != 0)
nframes = MPMIN(b->requested, nframes);