summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-12-13 09:27:14 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2012-12-14 15:53:06 +0100
commit0d83fd364ffea2c470c445617550efd99ebb4f16 (patch)
treed88781a72a4a10c5accbcd86aba1256c60dd0c97
parentcd1ca612675507c28b4ce9f74aee3cb5157551b7 (diff)
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.
-rw-r--r--gst/rtsp/gstrtspsrc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 6ead4d540..3c37d83c5 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -4130,6 +4130,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);
@@ -6564,7 +6568,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;