`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 | 174 | struct spa_buffer *buf = b->buffer; |
| 175 | 175 | |
| 176 | − int bytes_per_channel = buf->datas[0].maxsize / ao->channels.num; | |
| 177 | − int nframes = bytes_per_channel / ao->sstride; | |
| 176 | + int nframes = buf->datas[0].maxsize / ao->sstride; | |
| 178 | 177 | #if PW_CHECK_VERSION(0, 3, 49) |
| 179 | 178 | if (b->requested != 0) |
| 180 | 179 | nframes = MPMIN(b->requested, nframes); |