From a858bf46db860965089611674bfc43289830b646 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 13 Dec 2012 09:27:14 +0100 Subject: [PATCH] rtspsrc: fix TCP reconnect Ignore other commands when reconnecting, otherwise the loop function would pause and the reconnection would not happen. Continue looping after doing a reconnect so that we have a chance to actually read the new data. --- gst/rtsp/gstrtspsrc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 5b2ee41..05f532d 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -4147,6 +4147,10 @@ gst_rtspsrc_loop_send_cmd (GstRTSPSrc * src, gint cmd, gint mask) GST_OBJECT_LOCK (src); old = src->pending_cmd; + if (old == CMD_RECONNECT) { + GST_DEBUG_OBJECT (src, "ignore, we were reconnecting"); + cmd = CMD_RECONNECT; + } if (old != CMD_WAIT) { src->pending_cmd = CMD_WAIT; GST_OBJECT_UNLOCK (src); @@ -6561,7 +6565,7 @@ gst_rtspsrc_thread (GstRTSPSrc * src) GST_OBJECT_LOCK (src); cmd = src->pending_cmd; - if (cmd == CMD_PLAY || cmd == CMD_LOOP) + if (cmd == CMD_RECONNECT || CMD_PLAY || cmd == CMD_LOOP) src->pending_cmd = CMD_LOOP; else src->pending_cmd = CMD_WAIT; -- 2.7.4