mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user