context = gst_pad_get_element_private (pad);
+ /* FIXME: we may need to change our blocking state waiting for
+ * GstRTSPStreamBlocking messages */
+
GST_RTSP_STATE_LOCK (sink);
sink->contexts = g_list_remove (sink->contexts, context);
GST_RTSP_STATE_UNLOCK (sink);
g_mutex_lock (&sink->block_streams_lock);
/* Wait for streams to be blocked */
- while (!sink->streams_blocked) {
+ while (sink->n_streams_blocked < g_list_length (sink->contexts)) {
GST_DEBUG_OBJECT (sink, "waiting for streams to be blocked");
g_cond_wait (&sink->block_streams_cond, &sink->block_streams_lock);
}
/* An RTSPStream has prerolled */
GST_DEBUG_OBJECT (rtsp_client_sink, "received GstRTSPStreamBlocking");
g_mutex_lock (&rtsp_client_sink->block_streams_lock);
- rtsp_client_sink->streams_blocked = TRUE;
+ rtsp_client_sink->n_streams_blocked++;
g_cond_broadcast (&rtsp_client_sink->block_streams_cond);
g_mutex_unlock (&rtsp_client_sink->block_streams_lock);
}
gboolean streams_collected;
/* TRUE when streams have been blocked */
- gboolean streams_blocked;
+ guint n_streams_blocked;
GMutex block_streams_lock;
GCond block_streams_cond;