chiark / gitweb /
Make menu_update() robust against being called before the notebook has
[disorder] / clients / playrtp-coreaudio.c
index 689cdbd1a60cc456e9a6ff21569a7ec5b0b7a24f..f490a0f28731ba244960ce310062b6138c942adb 100644 (file)
  * @brief RTP player - Core Audio support
  */
 
-#include <config.h>
+#include "common.h"
 
 #if HAVE_COREAUDIO_AUDIOHARDWARE_H
-#include "types.h"
-
-#include <assert.h>
 #include <pthread.h>
 #include <CoreAudio/AudioHardware.h>
 
@@ -90,6 +87,14 @@ static OSStatus adioproc
         next_timestamp += samples_available;
         samplesOut += samples_available;
         samplesOutLeft -= samples_available;
+        if(dump_buffer) {
+          size_t n;
+
+          for(n = 0; n < samples_available; ++n) {
+            dump_buffer[dump_index++] = 0;
+            dump_index %= dump_size;
+          }
+        }
       }
     }
     ++ab;