mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	sink, source: Don't change suspend cause when unlinking
See the added comments for why this is necessary. Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/667
This commit is contained in:
		
							parent
							
								
									6b1719d0ed
								
							
						
					
					
						commit
						7fb85e0a5b
					
				
					 2 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
					@ -767,7 +767,11 @@ void pa_sink_unlink(pa_sink* s) {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (linked)
 | 
					    if (linked)
 | 
				
			||||||
        sink_set_state(s, PA_SINK_UNLINKED, 0);
 | 
					        /* It's important to keep the suspend cause unchanged when unlinking,
 | 
				
			||||||
 | 
					         * because if we remove the SESSION suspend cause here, the alsa sink
 | 
				
			||||||
 | 
					         * will sync its volume with the hardware while another user is
 | 
				
			||||||
 | 
					         * active, messing up the volume for that other user. */
 | 
				
			||||||
 | 
					        sink_set_state(s, PA_SINK_UNLINKED, s->suspend_cause);
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        s->state = PA_SINK_UNLINKED;
 | 
					        s->state = PA_SINK_UNLINKED;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -708,7 +708,11 @@ void pa_source_unlink(pa_source *s) {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (linked)
 | 
					    if (linked)
 | 
				
			||||||
        source_set_state(s, PA_SOURCE_UNLINKED, 0);
 | 
					        /* It's important to keep the suspend cause unchanged when unlinking,
 | 
				
			||||||
 | 
					         * because if we remove the SESSION suspend cause here, the alsa
 | 
				
			||||||
 | 
					         * source will sync its volume with the hardware while another user is
 | 
				
			||||||
 | 
					         * active, messing up the volume for that other user. */
 | 
				
			||||||
 | 
					        source_set_state(s, PA_SOURCE_UNLINKED, s->suspend_cause);
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
        s->state = PA_SOURCE_UNLINKED;
 | 
					        s->state = PA_SOURCE_UNLINKED;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue