Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

macaudio: Reduce buffers to a sane value and print when we get underruns

  • Loading branch information...
commit 77efa3728efe30758ab797c9ab8340f106e7fefd 1 parent 5efa687
@andoma authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/audio2/mac_audio.c
View
9 src/audio2/mac_audio.c
@@ -6,7 +6,7 @@
#include "audio.h"
#include "media.h"
-#define NUM_BUFS 1000
+#define NUM_BUFS 3
typedef struct decoder {
audio_decoder_t ad;
@@ -35,6 +35,13 @@ return_buf(void *aux, AudioQueueRef aq, AudioQueueBufferRef buf)
d->buffers[i].avail = 1;
hts_cond_signal(&mp->mp_audio.mq_avail);
hts_mutex_unlock(&mp->mp_mutex);
+ int tavail = 0;
+ for(i = 0; i < NUM_BUFS; i++) {
+ if(d->buffers[i].avail)
+ tavail++;
+ }
+ if(tavail == NUM_BUFS)
+ printf("Underrun!\n");
return;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.