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_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);
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;