mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	sink-input, source-output: remove the state getters
pa_sink_input_get_state() and pa_source_output_get_state() just return the state variable. We can as well access the state variable directly. There are no behaviour changes, except that some filter sources accessed the main thread's state variable from their push() callbacks. I fixed them so that they use the thread_info.state variable instead.
This commit is contained in:
		
							parent
							
								
									64ba239f65
								
							
						
					
					
						commit
						b4a36453da
					
				
					 21 changed files with 57 additions and 81 deletions
				
			
		| 
						 | 
				
			
			@ -201,7 +201,7 @@ static int source_set_state_in_main_thread_cb(pa_source *s, pa_source_state_t st
 | 
			
		|||
    pa_assert_se(u = s->userdata);
 | 
			
		||||
 | 
			
		||||
    if (!PA_SOURCE_IS_LINKED(state) ||
 | 
			
		||||
        !PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output)))
 | 
			
		||||
        !PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
 | 
			
		||||
        return 0;
 | 
			
		||||
 | 
			
		||||
    pa_source_output_cork(u->source_output, state == PA_SOURCE_SUSPENDED);
 | 
			
		||||
| 
						 | 
				
			
			@ -233,7 +233,7 @@ static void source_set_volume_cb(pa_source *s) {
 | 
			
		|||
    pa_assert_se(u = s->userdata);
 | 
			
		||||
 | 
			
		||||
    if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
 | 
			
		||||
        !PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output)))
 | 
			
		||||
        !PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    pa_source_output_set_volume(u->source_output, &s->real_volume, s->save_volume, true);
 | 
			
		||||
| 
						 | 
				
			
			@ -247,7 +247,7 @@ static void source_set_mute_cb(pa_source *s) {
 | 
			
		|||
    pa_assert_se(u = s->userdata);
 | 
			
		||||
 | 
			
		||||
    if (!PA_SOURCE_IS_LINKED(pa_source_get_state(s)) ||
 | 
			
		||||
        !PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output)))
 | 
			
		||||
        !PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->state))
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    pa_source_output_set_mute(u->source_output, s->muted, s->save_muted);
 | 
			
		||||
| 
						 | 
				
			
			@ -264,7 +264,7 @@ static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk)
 | 
			
		|||
    if (!PA_SOURCE_IS_LINKED(u->source->thread_info.state))
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    if (!PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output))) {
 | 
			
		||||
    if (!PA_SOURCE_OUTPUT_IS_LINKED(u->source_output->thread_info.state)) {
 | 
			
		||||
        pa_log("push when no link?");
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue