From ba6d83f3e1323225848c850bff2443568b9c80b8 Mon Sep 17 00:00:00 2001 From: Anton Yabchinskiy Date: Sat, 22 Nov 2014 13:05:28 +0300 Subject: [PATCH] Check return value of ao_play() --- drivers/ao/audio_driver_ao.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/ao/audio_driver_ao.cpp b/drivers/ao/audio_driver_ao.cpp index 49ce1a8e59b..d9a6ebd0ded 100644 --- a/drivers/ao/audio_driver_ao.cpp +++ b/drivers/ao/audio_driver_ao.cpp @@ -78,8 +78,11 @@ void AudioDriverAO::thread_func(void* p_udata) { if (ad->exit_thread) break; - ao_play(ad->device, reinterpret_cast(ad->samples_in), - ad->buffer_size * ad->channels * sizeof(int32_t)); + if (!ao_play(ad->device, reinterpret_cast(ad->samples_in), + ad->buffer_size * ad->channels * sizeof(int32_t))) + { + ERR_PRINT("ao_play() failed"); + } }; ad->thread_exited = true;