From 95b5ece2c98da84bc51507b36bc5f23c3c4582c5 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 7 Sep 2011 14:13:03 +0200 Subject: [PATCH] rtspsrc: ensure some initial state variable setup ... which might otherwise be skipped if the PLAY command is issued before the OPEN command had a chance to actually be acted upon. Fixes #657376. --- gst/rtsp/gstrtspsrc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 8442646654..731e0266af 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -4105,6 +4105,8 @@ gst_rtspsrc_loop_send_cmd (GstRTSPSrc * src, gint cmd, gboolean flush) /* start new request */ gst_rtspsrc_loop_start_cmd (src, cmd); + GST_DEBUG_OBJECT (src, "sending cmd %d", cmd); + GST_OBJECT_LOCK (src); old = src->loop_cmd; if (old != CMD_WAIT) { @@ -6454,10 +6456,6 @@ gst_rtspsrc_thread (GstRTSPSrc * src) switch (cmd) { case CMD_OPEN: - src->cur_protocols = src->protocols; - /* first attempt, don't ignore timeouts */ - src->ignore_timeout = FALSE; - src->open_error = FALSE; ret = gst_rtspsrc_open (src, TRUE); break; case CMD_PLAY: @@ -6577,6 +6575,11 @@ gst_rtspsrc_change_state (GstElement * element, GstStateChange transition) goto start_failed; break; case GST_STATE_CHANGE_READY_TO_PAUSED: + /* init some state */ + rtspsrc->cur_protocols = rtspsrc->protocols; + /* first attempt, don't ignore timeouts */ + rtspsrc->ignore_timeout = FALSE; + rtspsrc->open_error = FALSE; gst_rtspsrc_loop_send_cmd (rtspsrc, CMD_OPEN, FALSE); break; case GST_STATE_CHANGE_PAUSED_TO_PLAYING: