path: root/audio/out/ao_openal.c
diff options
authorwm4 <wm4@nowhere>2020-08-29 16:27:56 +0200
committerwm4 <wm4@nowhere>2020-08-29 16:27:56 +0200
commit478d39c57492107ce8d5a33e80d5624db330ceab (patch)
tree71c4cd38145f5256fdbfd06403fbd8da7a988c14 /audio/out/ao_openal.c
parent3427aa4776b73ce0b9c8996bc4ef38da87fe1557 (diff)
audio: fix inefficient behavior with ao_alsa, remove period_size field
It is now the AO's responsibility to handle period size alignment. The ao->period_size alignment field is unused as of the recent audio refactor commit. Remove it. It turns out that ao_alsa shows extremely inefficient behavior as a consequence of the removal of period size aligned writes in the mentioned refactor commit. This is because it could get into a state where it repeatedly wrote single samples (as small as 1 sample), and starved the rest of the player as a consequence. Too bad. Explicitly align the size in ao_alsa. Other AOs, which need this, should do the same. One reason why it broke so badly with ao_alsa was that it retried the write() even if all reported space could be written. So stop doing that too. Retry the write only if we somehow wrote less. I'm not sure about ao_pulse.
Diffstat (limited to 'audio/out/ao_openal.c')
1 files changed, 0 insertions, 1 deletions
diff --git a/audio/out/ao_openal.c b/audio/out/ao_openal.c
index 64d957e893..0c5ec2d7f1 100644
--- a/audio/out/ao_openal.c
+++ b/audio/out/ao_openal.c
@@ -267,7 +267,6 @@ static int init(struct ao *ao)
goto err_out;
- ao->period_size = p->num_samples;
return 0;