Make the play function return a status (ignored for the present). Clean up audio_alsa by removing all the die calls and placing the alsa_mutex calls in pthread cleanup routines.

This commit is contained in:
Mike Brady
2018-07-29 13:45:42 +01:00
parent c91a991edd
commit ea20840d6c
11 changed files with 207 additions and 169 deletions
+2 -1
View File
@@ -198,7 +198,7 @@ static void start(__attribute__((unused)) int sample_rate,
pa_threaded_mainloop_unlock(mainloop);
}
static void play(void *buf, int samples) {
static int play(void *buf, int samples) {
// debug(1,"pa_play of %d samples.",samples);
// copy the samples into the queue
size_t bytes_to_transfer = samples * 2 * 2;
@@ -224,6 +224,7 @@ static void play(void *buf, int samples) {
pa_stream_cork(stream, 0, stream_success_cb, mainloop);
pa_threaded_mainloop_unlock(mainloop);
}
return 0;
}
int pa_delay(long *the_delay) {