From 95bf53513f6888c2254786ffe1b4944fb0fc364d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 9 Apr 2013 20:39:58 +0200 Subject: [PATCH] media: wait for buffering to complete Wait for buffering to complete before changing the state to the target state. --- gst/rtsp-server/rtsp-media.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index 551d1a1..1cce85d 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -1725,7 +1725,13 @@ gst_rtsp_media_set_state (GstRTSPMedia * media, GstState state, GST_INFO ("state %s media %p", gst_element_state_get_name (state), media); priv->target_state = state; - gst_element_set_state (priv->pipeline, state); + /* when we are buffering, don't update the state yet, this will be done + * when buffering finishes */ + if (priv->buffering) { + GST_INFO ("Buffering busy, delay state change"); + } else { + gst_element_set_state (priv->pipeline, state); + } } } g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_NEW_STATE], 0, state, -- 2.7.4