Selaa lähdekoodia

Check return value of ao_play()

Anton Yabchinskiy 10 vuotta sitten
vanhempi
commit
ba6d83f3e1
1 muutettua tiedostoa jossa 5 lisäystä ja 2 poistoa
  1. 5 2
      drivers/ao/audio_driver_ao.cpp

+ 5 - 2
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<char*>(ad->samples_in),
-			ad->buffer_size * ad->channels * sizeof(int32_t));
+		if (!ao_play(ad->device, reinterpret_cast<char*>(ad->samples_in),
+				ad->buffer_size * ad->channels * sizeof(int32_t)))
+		{
+			ERR_PRINT("ao_play() failed");
+		}
 	};
 
 	ad->thread_exited = true;