media: Only add fakesink once per pipeline

The intention is to prevent going PLAYING state before pads are created.
If there was mutilple dynamic payload, it would leak few fakesink and
actually prevent from ever reaching playing state.

https://bugzilla.gnome.org/show_bug.cgi?id=753385
This commit is contained in:
Nicolas Dufresne 2015-08-08 09:40:09 -04:00
parent 160b87430f
commit 707ac9c487

View file

@ -2517,10 +2517,12 @@ start_prepare (GstRTSPMedia * media)
g_object_set_data (G_OBJECT (elem), "gst-rtsp-dynpay-handlers", handlers); g_object_set_data (G_OBJECT (elem), "gst-rtsp-dynpay-handlers", handlers);
/* we add a fakesink here in order to make the state change async. We remove if (!priv->fakesink) {
* the fakesink again in the no-more-pads callback. */ /* we add a fakesink here in order to make the state change async. We remove
priv->fakesink = gst_element_factory_make ("fakesink", "fakesink"); * the fakesink again in the no-more-pads callback. */
gst_bin_add (GST_BIN (priv->pipeline), priv->fakesink); priv->fakesink = gst_element_factory_make ("fakesink", "fakesink");
gst_bin_add (GST_BIN (priv->pipeline), priv->fakesink);
}
} }
if (!start_preroll (media)) if (!start_preroll (media))