rtsp-media: Only add 1 fakesink per pipeline
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Fri, 7 Aug 2015 13:21:36 +0000 (09:21 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Fri, 7 Aug 2015 13:33:55 +0000 (09:33 -0400)
There should be only one fakesink per pipeline, not per dynpay. This
would lead to element naming clash.

gst/rtsp-server/rtsp-media.c

index 011dae3..c00c703 100644 (file)
@@ -2516,13 +2516,13 @@ start_prepare (GstRTSPMedia * media)
         (GCallback) no_more_pads_cb, media);
 
     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
-     * the fakesink again in the no-more-pads callback. */
-    priv->fakesink = gst_element_factory_make ("fakesink", "fakesink");
-    gst_bin_add (GST_BIN (priv->pipeline), priv->fakesink);
   }
 
+  /* we add a fakesink here in order to make the state change async. We remove
+   * the fakesink again in the no-more-pads callback. */
+  priv->fakesink = gst_element_factory_make ("fakesink", "fakesink");
+  gst_bin_add (GST_BIN (priv->pipeline), priv->fakesink);
+
   if (!start_preroll (media))
     goto preroll_failed;