mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: make sure to count played samples
On underrun we need to keep on counting playing_for so fill this in underrun and don't add this to missing to avoid double counting. See #639
This commit is contained in:
		
							parent
							
								
									ac3555d6fc
								
							
						
					
					
						commit
						b65b291bb2
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -1462,7 +1462,7 @@ do_process_done(struct spa_loop *loop,
 | 
			
		|||
			else
 | 
			
		||||
				send_stream_started(stream);
 | 
			
		||||
		}
 | 
			
		||||
		stream->missing += pd->playing_for + pd->underrun_for;
 | 
			
		||||
		stream->missing += pd->playing_for;
 | 
			
		||||
		stream->missing = SPA_MIN(stream->missing, stream->attr.tlength);
 | 
			
		||||
		stream->playing_for += pd->playing_for;
 | 
			
		||||
		if (stream->underrun_for != (uint64_t)-1)
 | 
			
		||||
| 
						 | 
				
			
			@ -1559,6 +1559,7 @@ static void stream_process(void *data)
 | 
			
		|||
				pw_stream_flush(stream->stream, true);
 | 
			
		||||
			} else {
 | 
			
		||||
				pd.underrun_for = size;
 | 
			
		||||
				pd.playing_for = size;
 | 
			
		||||
				pd.underrun = true;
 | 
			
		||||
			}
 | 
			
		||||
			pd.read_index += size;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue