medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 06fa4940ba9dbac1096539059621ad2dc978f4b5
parent 78325f4bae425a666c2b143f8c00b3f8d6a69415
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Mon Jan 23 23:19:47 +0200

Linux audio output cleanup

Diffstat:
linux_audio_output.cc | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/linux_audio_output.cc b/linux_audio_output.cc @@ -6,8 +6,9 @@ #include "intrinsics.h" #include "log.h" -#include "platform_library.h" #include "platform_audio_output.h" +#include "platform_library.h" +#include "platform_thread.h" // copied from alsa headers static int ( *_snd_lib_error_set_handler )( snd_lib_error_handler_t handler ) = NULL; @@ -69,6 +70,8 @@ void audio_output_term() { _snd_pcm_close = NULL; library_close( alsa_lib ); + + alsa_lib = NULL; } static void audio_output_write( snd_pcm_t * pcm, s16 * samples, s32 num_samples ) { @@ -89,8 +92,8 @@ static void audio_output_write( snd_pcm_t * pcm, s16 * samples, s32 num_samples static THREAD( audio_output_thread ) { AudioOutputDevice * device = ( AudioOutputDevice * ) data; - s16 samples[ 1024 ]; for( ;; ) { + s16 samples[ 1024 ]; device->callback( samples, ARRAY_COUNT( samples ) ); audio_output_write( device->pcm, samples, ARRAY_COUNT( samples ) ); }