limit error messages

This commit is contained in:
Jorj Bauer 2018-01-10 08:05:14 -05:00
parent 0bb712fc70
commit 18e43b7784

View File

@ -35,7 +35,13 @@ static void audioCallback(void *unused, Uint8 *stream, int len)
}
} else {
// Audio underrun
printf("Audio underrun!\n");
static uint8_t occurrenceCount = 0;
if (++occurrenceCount < 10) {
printf("Audio underrun!\n");
if (occurrenceCount == 9) {
printf(" (Suppressing further audio errors)\n");
}
}
memset(stream, 0, len);
}
pthread_mutex_unlock(&sndmutex);