output_internal: protect attribute "fail_timer" with mutex

This commit is contained in:
Max Kellermann 2010-11-04 23:40:43 +01:00
parent 9562f66741
commit 2ee047a1dd
2 changed files with 7 additions and 1 deletions

View File

@ -131,7 +131,8 @@ struct audio_output {
const struct music_pipe *pipe;
/**
* This mutex protects #open, #chunk and #chunk_finished.
* This mutex protects #open, #fail_timer, #chunk and
* #chunk_finished.
*/
GMutex *mutex;

View File

@ -105,7 +105,12 @@ ao_play_chunk(struct audio_output *ao, const struct music_chunk *chunk)
/* don't automatically reopen this device for
10 seconds */
g_mutex_lock(ao->mutex);
assert(ao->fail_timer == NULL);
ao->fail_timer = g_timer_new();
g_mutex_unlock(ao->mutex);
return false;
}