`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.
Unified · Split
| @@ -173,8 +173,7 @@ static void on_process(void *userdata) · 172 unmodified lines | |||
| 173 | 173 | ||
| 174 | struct spa_buffer *buf = b->buffer; | 174 | struct spa_buffer *buf = b->buffer; |
| 175 | 175 | ||
| 176 | int bytes_per_channel = buf->datas[0].maxsize / ao->channels.num; | 176 | int nframes = buf->datas[0].maxsize / ao->sstride; |
| 177 | int nframes = bytes_per_channel / ao->sstride; | ||
| 178 | #if PW_CHECK_VERSION(0, 3, 49) | 177 | #if PW_CHECK_VERSION(0, 3, 49) |
| 179 | if (b->requested != 0) | 178 | if (b->requested != 0) |
| 180 | nframes = MPMIN(b->requested, nframes); | 179 | nframes = MPMIN(b->requested, nframes); |