rtspsrc: only wait if we flushed
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 9 Sep 2013 13:11:51 +0000 (15:11 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 9 Sep 2013 13:13:46 +0000 (15:13 +0200)
Only wait for the STREAM_LOCK when we flushed something when sending
a command for PAUSED or PLAYING.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=707611

gst/rtsp/gstrtspsrc.c

index aa8ba98..2be6543 100644 (file)
@@ -7102,10 +7102,11 @@ gst_rtspsrc_change_state (GstElement * element, GstStateChange transition)
     case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
     case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
       /* unblock the tcp tasks and make the loop waiting */
-      gst_rtspsrc_loop_send_cmd (rtspsrc, CMD_WAIT, CMD_LOOP);
-      /* make sure it is waiting before we send PAUSE or PLAY below */
-      GST_RTSP_STREAM_LOCK (rtspsrc);
-      GST_RTSP_STREAM_UNLOCK (rtspsrc);
+      if (gst_rtspsrc_loop_send_cmd (rtspsrc, CMD_WAIT, CMD_LOOP)) {
+        /* make sure it is waiting before we send PAUSE or PLAY below */
+        GST_RTSP_STREAM_LOCK (rtspsrc);
+        GST_RTSP_STREAM_UNLOCK (rtspsrc);
+      }
       break;
     case GST_STATE_CHANGE_PAUSED_TO_READY:
       break;