mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	client-source: fix state changes
Keep the client-source in the playing state for as long as the input is streaming. Pausing the pipeline when there are no more readers causes data to bunch up in the socket that gets bursted to new clients when they connect.
This commit is contained in:
		
							parent
							
								
									1fec75d2a5
								
							
						
					
					
						commit
						aa558bf105
					
				
					 1 changed files with 1 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -244,17 +244,13 @@ on_socket_notify (GObject    *gobject,
 | 
			
		|||
  g_object_set_data (gobject, "last-socket", socket);
 | 
			
		||||
 | 
			
		||||
  g_object_get (priv->sink, "num-handles", &num_handles, NULL);
 | 
			
		||||
  if (num_handles == 0) {
 | 
			
		||||
    gst_element_set_state (priv->pipeline, GST_STATE_READY);
 | 
			
		||||
  } else if (socket) {
 | 
			
		||||
  if (num_handles > 0 && socket) {
 | 
			
		||||
    GBytes *format;
 | 
			
		||||
 | 
			
		||||
    /* suggest what we provide */
 | 
			
		||||
    g_object_get (priv->input, "format", &format, NULL);
 | 
			
		||||
    g_object_set (gobject, "format", format, NULL);
 | 
			
		||||
    g_bytes_unref (format);
 | 
			
		||||
 | 
			
		||||
    gst_element_set_state (priv->pipeline, GST_STATE_PLAYING);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -281,8 +277,6 @@ client_create_source_output (PinosSource *source,
 | 
			
		|||
  if (output == NULL)
 | 
			
		||||
    return NULL;
 | 
			
		||||
 | 
			
		||||
  gst_element_set_state (priv->pipeline, GST_STATE_READY);
 | 
			
		||||
 | 
			
		||||
  g_signal_connect (output, "notify::socket", (GCallback) on_socket_notify, source);
 | 
			
		||||
 | 
			
		||||
  return output;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue