mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	stream: emit RUNNING state from Start
cd68819febadded code to follow the state change of the node because at the time it the Start code was async and it was better to complete it before emitting the state.9b80855821however made the Start command sync again and so we can safely emit the running state in the Start. The effect is that the Running state change is emitted first and then the node eventfd is added to the data loop that can then call the process callback. Having the process callback happen before the RUNNING state change is unexpected and racy.
This commit is contained in:
		
							parent
							
								
									3643c468e4
								
							
						
					
					
						commit
						5153dc3362
					
				
					 1 changed files with 1 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -719,6 +719,7 @@ static int impl_send_command(void *object, const struct spa_command *command)
 | 
			
		|||
					impl->io->status = SPA_STATUS_NEED_DATA;
 | 
			
		||||
			}
 | 
			
		||||
			copy_position(impl, impl->queued.incount);
 | 
			
		||||
			stream_set_state(stream, PW_STREAM_STATE_STREAMING, 0, NULL);
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
	default:
 | 
			
		||||
| 
						 | 
				
			
			@ -1451,10 +1452,6 @@ static void node_state_changed(void *data, enum pw_node_state old,
 | 
			
		|||
	struct pw_stream *stream = data;
 | 
			
		||||
 | 
			
		||||
	switch (state) {
 | 
			
		||||
	case PW_NODE_STATE_RUNNING:
 | 
			
		||||
		if (stream->state == PW_STREAM_STATE_PAUSED)
 | 
			
		||||
			stream_set_state(stream, PW_STREAM_STATE_STREAMING, 0, NULL);
 | 
			
		||||
		break;
 | 
			
		||||
	case PW_NODE_STATE_ERROR:
 | 
			
		||||
		stream_set_state(stream, PW_STREAM_STATE_ERROR, -EIO, error);
 | 
			
		||||
		break;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue