mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	sink, source: Support creating suspended sinks and sources
The initial state of a sink or source might not necessarily be IDLE, because sometimes it might be suspended from the very beginning.
This commit is contained in:
		
							parent
							
								
									0ee5fa6377
								
							
						
					
					
						commit
						f280e8b50d
					
				
					 5 changed files with 20 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -235,7 +235,7 @@ pa_source* pa_source_new(
 | 
			
		|||
    s->state = PA_SOURCE_INIT;
 | 
			
		||||
    s->flags = flags;
 | 
			
		||||
    s->priority = 0;
 | 
			
		||||
    s->suspend_cause = 0;
 | 
			
		||||
    s->suspend_cause = data->suspend_cause;
 | 
			
		||||
    pa_source_set_mixer_dirty(s, FALSE);
 | 
			
		||||
    s->name = pa_xstrdup(name);
 | 
			
		||||
    s->proplist = pa_proplist_copy(data->proplist);
 | 
			
		||||
| 
						 | 
				
			
			@ -595,7 +595,10 @@ void pa_source_put(pa_source *s) {
 | 
			
		|||
    pa_assert(!(s->flags & PA_SOURCE_DECIBEL_VOLUME) || s->n_volume_steps == PA_VOLUME_NORM+1);
 | 
			
		||||
    pa_assert(!(s->flags & PA_SOURCE_DYNAMIC_LATENCY) == (s->thread_info.fixed_latency != 0));
 | 
			
		||||
 | 
			
		||||
    pa_assert_se(source_set_state(s, PA_SOURCE_IDLE) == 0);
 | 
			
		||||
    if (s->suspend_cause)
 | 
			
		||||
        pa_assert_se(source_set_state(s, PA_SOURCE_SUSPENDED) == 0);
 | 
			
		||||
    else
 | 
			
		||||
        pa_assert_se(source_set_state(s, PA_SOURCE_IDLE) == 0);
 | 
			
		||||
 | 
			
		||||
    pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE | PA_SUBSCRIPTION_EVENT_NEW, s->index);
 | 
			
		||||
    pa_hook_fire(&s->core->hooks[PA_CORE_HOOK_SOURCE_PUT], s);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue