output_internal: protect attribute "fail_timer" with mutex
This commit is contained in:
parent
9562f66741
commit
2ee047a1dd
@ -131,7 +131,8 @@ struct audio_output {
|
|||||||
const struct music_pipe *pipe;
|
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;
|
GMutex *mutex;
|
||||||
|
|
||||||
|
@ -105,7 +105,12 @@ ao_play_chunk(struct audio_output *ao, const struct music_chunk *chunk)
|
|||||||
|
|
||||||
/* don't automatically reopen this device for
|
/* don't automatically reopen this device for
|
||||||
10 seconds */
|
10 seconds */
|
||||||
|
g_mutex_lock(ao->mutex);
|
||||||
|
|
||||||
|
assert(ao->fail_timer == NULL);
|
||||||
ao->fail_timer = g_timer_new();
|
ao->fail_timer = g_timer_new();
|
||||||
|
|
||||||
|
g_mutex_unlock(ao->mutex);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user