rtspclientsink: if OPEN failed, unqueue next command
authorMathieu Duponchelle <mathieu@centricular.com>
Tue, 27 Feb 2018 19:34:49 +0000 (20:34 +0100)
committerMathieu Duponchelle <mathieu@centricular.com>
Tue, 27 Feb 2018 19:37:14 +0000 (20:37 +0100)
As READY_TO_PAUSED can no longer return async, the RECORD
command will be queued before the OPEN command fails
(for example in case the server could not be connected),
and record then waits for ever.

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

gst/rtsp-sink/gstrtspclientsink.c

index 454c58d..358b4e6 100644 (file)
@@ -4684,7 +4684,9 @@ gst_rtsp_client_sink_thread (GstRTSPClientSink * sink)
 
   switch (cmd) {
     case CMD_OPEN:
-      gst_rtsp_client_sink_open (sink, TRUE);
+      if (gst_rtsp_client_sink_open (sink, TRUE) == GST_RTSP_ERROR)
+        gst_rtsp_client_sink_loop_send_cmd (sink, CMD_WAIT,
+            CMD_ALL & ~CMD_CLOSE);
       break;
     case CMD_RECORD:
       gst_rtsp_client_sink_record (sink, TRUE);