output_internal: protect attribute "fail_timer" with mutex
This commit is contained in:
		@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user