mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	null-sink, pipe-sink: some state variable cleanups
pa_sink_get_state() is supposed to be used from the main thread. In this case it doesn't really matter, because the SET_STATE handler is executed while the main thread is waiting, but since the state is available also in thread_info, let's use that. All other modules use thread_info.state too, so at least this change improves consistency. Also, we can use the PA_SINK_IS_OPENED macro to simplify the code a bit.
This commit is contained in:
		
							parent
							
								
									2dff0d6a6a
								
							
						
					
					
						commit
						7f09164ed7
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -91,8 +91,8 @@ static int sink_process_msg(
 | 
			
		|||
    switch (code) {
 | 
			
		||||
        case PA_SINK_MESSAGE_SET_STATE:
 | 
			
		||||
 | 
			
		||||
            if (pa_sink_get_state(u->sink) == PA_SINK_SUSPENDED || pa_sink_get_state(u->sink) == PA_SINK_INIT) {
 | 
			
		||||
                if (PA_PTR_TO_UINT(data) == PA_SINK_RUNNING || PA_PTR_TO_UINT(data) == PA_SINK_IDLE)
 | 
			
		||||
            if (u->sink->thread_info.state == PA_SINK_SUSPENDED || u->sink->thread_info.state == PA_SINK_INIT) {
 | 
			
		||||
                if (PA_SINK_IS_OPENED(PA_PTR_TO_UINT(data)))
 | 
			
		||||
                    u->timestamp = pa_rtclock_now();
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue