mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	gstpipewiresrc: break out of wait_started() also on STATE_UNCONNECTED
When the session manager sends an error to the client, it typically also destroys the node after the error, which causes the stream to go to STATE_UNCONNECTED via proxy_removed(). In that case, make sure we exit the loop early, otherwise it will take 30 seconds to unblock gst_element_set_state() This is a revised version of the fix that was commited via !1763 and then reverted, as it was problematic. Now the code ensures that it breaks out only if the state was previously CONNECTING or higher.
This commit is contained in:
		
							parent
							
								
									c199611c89
								
							
						
					
					
						commit
						0c99d37db2
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -768,7 +768,7 @@ start_error:
 | 
			
		|||
static enum pw_stream_state
 | 
			
		||||
wait_started (GstPipeWireSrc *this)
 | 
			
		||||
{
 | 
			
		||||
  enum pw_stream_state state;
 | 
			
		||||
  enum pw_stream_state state, prev_state = PW_STREAM_STATE_UNCONNECTED;
 | 
			
		||||
  const char *error = NULL;
 | 
			
		||||
  struct timespec abstime;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -783,10 +783,9 @@ wait_started (GstPipeWireSrc *this)
 | 
			
		|||
    GST_DEBUG_OBJECT (this, "waiting for started signal, state now %s",
 | 
			
		||||
        pw_stream_state_as_string (state));
 | 
			
		||||
 | 
			
		||||
    if (state == PW_STREAM_STATE_ERROR)
 | 
			
		||||
      break;
 | 
			
		||||
 | 
			
		||||
    if (this->flushing) {
 | 
			
		||||
    if (state == PW_STREAM_STATE_ERROR ||
 | 
			
		||||
        (state == PW_STREAM_STATE_UNCONNECTED && prev_state > PW_STREAM_STATE_UNCONNECTED) ||
 | 
			
		||||
        this->flushing) {
 | 
			
		||||
      state = PW_STREAM_STATE_ERROR;
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			@ -798,6 +797,8 @@ wait_started (GstPipeWireSrc *this)
 | 
			
		|||
      state = PW_STREAM_STATE_ERROR;
 | 
			
		||||
      break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    prev_state = state;
 | 
			
		||||
  }
 | 
			
		||||
  GST_DEBUG_OBJECT (this, "got started signal: %s",
 | 
			
		||||
                  pw_stream_state_as_string (state));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue