stream: set udp sources to PLAYING
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 20 Nov 2012 11:24:13 +0000 (12:24 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 20 Nov 2012 11:24:13 +0000 (12:24 +0100)
Set the UDP sources to PLAYING and locked state before we add it to the pipeline
so that it doesn't cause our pipeline to produce ASYNC-DONE.

gst/rtsp-server/rtsp-stream.c

index 0a80687..a4f52dc 100644 (file)
@@ -813,6 +813,10 @@ gst_rtsp_stream_join_bin (GstRTSPStream * stream, GstBin * bin,
     gst_pad_link (pad, stream->recv_sink[i]);
     gst_object_unref (pad);
 
+    /* we set and keep these to playing so that they don't cause NO_PREROLL return
+     * values */
+    gst_element_set_state (stream->udpsrc[i], GST_STATE_PLAYING);
+    gst_element_set_locked_state (stream->udpsrc[i], TRUE);
     /* add udpsrc */
     gst_bin_add (bin, stream->udpsrc[i]);
     /* and link to the funnel */
@@ -841,10 +845,6 @@ gst_rtsp_stream_join_bin (GstRTSPStream * stream, GstBin * bin,
       gst_element_set_state (stream->funnel[i], state);
       gst_element_set_state (stream->appsrc[i], state);
     }
-    /* we set and keep these to playing so that they don't cause NO_PREROLL return
-     * values */
-    gst_element_set_state (stream->udpsrc[i], GST_STATE_PLAYING);
-    gst_element_set_locked_state (stream->udpsrc[i], TRUE);
   }
 
   /* be notified of caps changes */