From 7f18932c85ad0ea05eb4c4b3e8c10dc0f457bf31 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 28 Jul 2018 15:36:31 +0000 Subject: [PATCH] audioio: Clean up. --- mini_al.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/mini_al.h b/mini_al.h index ef8dfa29..67bced42 100644 --- a/mini_al.h +++ b/mini_al.h @@ -15210,23 +15210,14 @@ mal_result mal_device_init__audioio(mal_context* pContext, mal_device_type devic AUDIO_INITINFO(&fdInfo); - - - fdInfo.blocksize = fragmentSizeInBytes; - fdInfo.hiwat = mal_max(pDevice->periods, 2); + fdInfo.hiwat = mal_max(pDevice->periods, 5); fdInfo.lowat = (unsigned int)(fdInfo.hiwat * 0.75); if (ioctl(pDevice->audioio.fd, AUDIO_SETINFO, &fdInfo) < 0) { close(pDevice->audioio.fd); return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[audioio] Failed to set internal buffer size. AUDIO_SETINFO failed.", MAL_FORMAT_NOT_SUPPORTED); } - #if 1 - printf("blocksize: %d -> %d\n", fragmentSizeInBytes, fdInfo.blocksize); - printf("hiwat: %d\n", fdInfo.hiwat); - printf("lowat: %d\n", fdInfo.lowat); - #endif - pDevice->periods = fdInfo.hiwat; pDevice->bufferSizeInFrames = (fdInfo.blocksize * fdInfo.hiwat) / mal_get_bytes_per_frame(pDevice->internalFormat, pDevice->internalChannels); @@ -15279,7 +15270,7 @@ mal_result mal_device__stop_backend__audioio(mal_device* pDevice) { mal_assert(pDevice != NULL); - if (ioctl(pDevice->audioio.fd, AUDIO_DRAIN, 0) < 0) { + if (ioctl(pDevice->audioio.fd, AUDIO_FLUSH, 0) < 0) { return mal_post_error(pDevice, MAL_LOG_LEVEL_ERROR, "[audioio] Failed to stop device. AUDIO_FLUSH failed.", MAL_FAILED_TO_STOP_BACKEND_DEVICE); }