mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	fix handling of _suspend_all(), return first failure error code
This commit is contained in:
		
							parent
							
								
									ecbc320a4c
								
							
						
					
					
						commit
						341f44fa24
					
				
					 2 changed files with 15 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -1605,8 +1605,12 @@ int pa_sink_suspend_all(pa_core *c, pa_bool_t suspend) {
 | 
			
		|||
 | 
			
		||||
    pa_core_assert_ref(c);
 | 
			
		||||
 | 
			
		||||
    for (sink = PA_SINK(pa_idxset_first(c->sinks, &idx)); sink; sink = PA_SINK(pa_idxset_next(c->sinks, &idx)))
 | 
			
		||||
        ret -= pa_sink_suspend(sink, suspend) < 0;
 | 
			
		||||
    for (sink = PA_SINK(pa_idxset_first(c->sinks, &idx)); sink; sink = PA_SINK(pa_idxset_next(c->sinks, &idx))) {
 | 
			
		||||
        int r;
 | 
			
		||||
 | 
			
		||||
        if ((r = pa_sink_suspend(sink, suspend)) < 0)
 | 
			
		||||
            ret = r;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -955,8 +955,15 @@ int pa_source_suspend_all(pa_core *c, pa_bool_t suspend) {
 | 
			
		|||
 | 
			
		||||
    pa_core_assert_ref(c);
 | 
			
		||||
 | 
			
		||||
    for (source = PA_SOURCE(pa_idxset_first(c->sources, &idx)); source; source = PA_SOURCE(pa_idxset_next(c->sources, &idx)))
 | 
			
		||||
        ret -= pa_source_suspend(source, suspend) < 0;
 | 
			
		||||
    for (source = PA_SOURCE(pa_idxset_first(c->sources, &idx)); source; source = PA_SOURCE(pa_idxset_next(c->sources, &idx))) {
 | 
			
		||||
        int r;
 | 
			
		||||
 | 
			
		||||
        if (source->monitor_of)
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
        if ((r = pa_source_suspend(source, suspend)) < 0)
 | 
			
		||||
            ret = r;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue