aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorVolker RĂ¼melin <vr_qemu@t-online.de>2022-03-01 20:13:09 +0100
committerGerd Hoffmann <kraxel@redhat.com>2022-03-04 11:05:13 +0100
commit385211e8f903c75d7d1322ba0e21c370b2edaddd (patch)
treef2991d9ffa296a54916160744c27baf7cc740ee6 /audio
parentc93a593372967b98438ab832b1b6eded12fdee8f (diff)
ossaudio: reduce effective playback buffer size
Return the free buffer size for the mmapped case in function oss_buffer_get_free() to reduce the effective playback buffer size. All intermediate audio playback buffers become temporary buffers. Signed-off-by: Volker RĂ¼melin <vr_qemu@t-online.de> Message-Id: <20220301191311.26695-13-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/ossaudio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/audio/ossaudio.c b/audio/ossaudio.c
index 1bd6800840..da9c232222 100644
--- a/audio/ossaudio.c
+++ b/audio/ossaudio.c
@@ -394,7 +394,7 @@ static size_t oss_buffer_get_free(HWVoiceOut *hw)
OSSVoiceOut *oss = (OSSVoiceOut *)hw;
if (oss->mmapped) {
- return INT_MAX;
+ return oss_get_available_bytes(oss);
} else {
return audio_generic_buffer_get_free(hw);
}
@@ -402,9 +402,10 @@ static size_t oss_buffer_get_free(HWVoiceOut *hw)
static void *oss_get_buffer_out(HWVoiceOut *hw, size_t *size)
{
- OSSVoiceOut *oss = (OSSVoiceOut *) hw;
+ OSSVoiceOut *oss = (OSSVoiceOut *)hw;
+
if (oss->mmapped) {
- *size = MIN(oss_get_available_bytes(oss), hw->size_emul - hw->pos_emul);
+ *size = hw->size_emul - hw->pos_emul;
return hw->buf_emul + hw->pos_emul;
} else {
return audio_generic_get_buffer_out(hw, size);