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:
Wim Taymans 2015-07-14 15:42:47 +02:00
parent 1fec75d2a5
commit aa558bf105

View file

@ -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;