mirror of
				https://github.com/gnif/LookingGlass.git
				synced 2025-11-04 06:31:54 +00:00 
			
		
		
		
	[client] audio/pw: delay playback to avoid glitches
This commit is contained in:
		
				
					committed by
					
						
						Geoffrey McRae
					
				
			
			
				
	
			
			
			
						parent
						
							4c389a9274
						
					
				
				
					commit
					e72e138267
				
			@@ -264,8 +264,14 @@ static void pipewire_playbackPlay(uint8_t * data, size_t size)
 | 
			
		||||
 | 
			
		||||
    switch (pw.playback.state) {
 | 
			
		||||
      case STREAM_STATE_INACTIVE:
 | 
			
		||||
        pw_stream_set_active(pw.playback.stream, true);
 | 
			
		||||
        pw.playback.state = STREAM_STATE_ACTIVE;
 | 
			
		||||
        // Don't start playback until the buffer is sufficiently full to avoid
 | 
			
		||||
        // glitches
 | 
			
		||||
        if (ringbuffer_getCount(pw.playback.buffer) >=
 | 
			
		||||
          ringbuffer_getLength(pw.playback.buffer) / 4)
 | 
			
		||||
        {
 | 
			
		||||
          pw_stream_set_active(pw.playback.stream, true);
 | 
			
		||||
          pw.playback.state = STREAM_STATE_ACTIVE;
 | 
			
		||||
        }
 | 
			
		||||
        break;
 | 
			
		||||
 | 
			
		||||
      case STREAM_STATE_FLUSHING:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user