mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	loopback: Reset sink input rate when source or sink changes
If source or sink are changed, the current sink input rate may be different from the default rate. Switch sink input rate back to default to avoid the influence of the previous combination of source and sink.
This commit is contained in:
		
							parent
							
								
									96cae04ced
								
							
						
					
					
						commit
						d3d980ff49
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -644,6 +644,11 @@ static void source_output_moving_cb(pa_source_output *o, pa_source *dest) {
 | 
			
		|||
        pa_asyncmsgq_send(u->sink_input->sink->asyncmsgq, PA_MSGOBJECT(u->sink_input), SINK_INPUT_MESSAGE_SOURCE_CHANGED, NULL, 0, NULL);
 | 
			
		||||
    else
 | 
			
		||||
        u->output_thread_info.push_called = false;
 | 
			
		||||
 | 
			
		||||
    /* The sampling rate may be far away from the default rate if we are still
 | 
			
		||||
     * recovering from a previous source or sink change, so reset rate to
 | 
			
		||||
     * default before moving the source. */
 | 
			
		||||
    pa_sink_input_set_rate(u->sink_input, u->source_output->sample_spec.rate);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Called from main thread */
 | 
			
		||||
| 
						 | 
				
			
			@ -1008,6 +1013,11 @@ static void sink_input_moving_cb(pa_sink_input *i, pa_sink *dest) {
 | 
			
		|||
 | 
			
		||||
    u->output_thread_info.pop_called = false;
 | 
			
		||||
    u->output_thread_info.first_pop_done = false;
 | 
			
		||||
 | 
			
		||||
    /* Sample rate may be far away from the default rate if we are still
 | 
			
		||||
     * recovering from a previous source or sink change, so reset rate to
 | 
			
		||||
     * default before moving the sink. */
 | 
			
		||||
    pa_sink_input_set_rate(u->sink_input, u->source_output->sample_spec.rate);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Called from main thread */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue