History

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.

Misaki Kasumi committed 2 years ago

Commit 3086f8f1 parent 765a43a1 file · +1 −2Browse files

Unified · Split

audio/out/ao_pipewire.c+1−2
@@ -173,8 +173,7 @@ static void on_process(void *userdata) · 172 unmodified lines
173173
174174 struct spa_buffer *buf = b->buffer;
175175
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;
178177 #if PW_CHECK_VERSION(0, 3, 49)
179178 if (b->requested != 0)
180179 nframes = MPMIN(b->requested, nframes);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t