mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: send drain only once
This commit is contained in:
		
							parent
							
								
									af41e3423d
								
							
						
					
					
						commit
						dcda6c259f
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -181,6 +181,7 @@ struct stream {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	uint32_t drain_tag;
 | 
						uint32_t drain_tag;
 | 
				
			||||||
	unsigned int corked:1;
 | 
						unsigned int corked:1;
 | 
				
			||||||
 | 
						unsigned int draining:1;
 | 
				
			||||||
	unsigned int volume_set:1;
 | 
						unsigned int volume_set:1;
 | 
				
			||||||
	unsigned int muted_set:1;
 | 
						unsigned int muted_set:1;
 | 
				
			||||||
	unsigned int adjust_latency:1;
 | 
						unsigned int adjust_latency:1;
 | 
				
			||||||
| 
						 | 
					@ -1385,9 +1386,10 @@ static void stream_process(void *data)
 | 
				
			||||||
			size = buf->datas[0].maxsize;
 | 
								size = buf->datas[0].maxsize;
 | 
				
			||||||
			memset(p, 0, size);
 | 
								memset(p, 0, size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (stream->drain_tag)
 | 
								if (stream->draining) {
 | 
				
			||||||
 | 
									stream->draining = false;
 | 
				
			||||||
				pw_stream_flush(stream->stream, true);
 | 
									pw_stream_flush(stream->stream, true);
 | 
				
			||||||
			else {
 | 
								} else {
 | 
				
			||||||
				pd.underrun_for = size;
 | 
									pd.underrun_for = size;
 | 
				
			||||||
				pd.underrun = true;
 | 
									pd.underrun = true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					@ -3142,6 +3144,7 @@ static int do_drain_stream(struct client *client, uint32_t command, uint32_t tag
 | 
				
			||||||
		return -ENOENT;
 | 
							return -ENOENT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	stream->drain_tag = tag;
 | 
						stream->drain_tag = tag;
 | 
				
			||||||
 | 
						stream->draining = true;
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue