gboolean async);
static GstRTSPResult gst_rtspsrc_pause (GstRTSPSrc * src, gboolean idle,
gboolean async);
-static GstRTSPResult gst_rtspsrc_close (GstRTSPSrc * src, gboolean async);
+static GstRTSPResult gst_rtspsrc_close (GstRTSPSrc * src, gboolean async,
+ gboolean only_close);
static gboolean gst_rtspsrc_uri_set_uri (GstURIHandler * handler,
const gchar * uri);
src->cur_protocols = GST_RTSP_LOWER_TRANS_TCP;
/* close and cleanup our state */
- if ((res = gst_rtspsrc_close (src, async)) < 0)
+ if ((res = gst_rtspsrc_close (src, async, FALSE)) < 0)
goto done;
/* see if we have TCP left to try. Also don't try TCP when we were configured
}
static GstRTSPResult
-gst_rtspsrc_close (GstRTSPSrc * src, gboolean async)
+gst_rtspsrc_close (GstRTSPSrc * src, gboolean async, gboolean only_close)
{
GstRTSPMessage request = { 0 };
GstRTSPMessage response = { 0 };
goto close;
}
+ if (only_close)
+ goto close;
+
/* construct a control url */
if (src->control)
control = src->control;
running = TRUE;
break;
case CMD_CLOSE:
- ret = gst_rtspsrc_close (src, TRUE);
+ ret = gst_rtspsrc_close (src, TRUE, FALSE);
break;
case CMD_LOOP:
running = gst_rtspsrc_loop (src);
}
GST_OBJECT_UNLOCK (src);
+ /* ensure synchronously all is closed and clean */
+ gst_rtspsrc_close (src, FALSE, TRUE);
+
return TRUE;
}