GstDataQueueSize max_size, extra_size;
GstClockTime cur_time;
gboolean is_eos;
+ gboolean flushing;
/* Protected by global lock */
guint32 nextid; /* ID of the next object waiting to be pushed */
sq->srcresult = GST_FLOW_WRONG_STATE;
gst_data_queue_set_flushing (sq->queue, TRUE);
+ sq->flushing = TRUE;
+
/* wake up non-linked task */
GST_LOG_OBJECT (mq, "SingleQueue %d : waking up eventually waiting task",
sq->id);
sq->last_oldid = G_MAXUINT32;
gst_data_queue_set_flushing (sq->queue, FALSE);
+ sq->flushing = FALSE;
+
GST_LOG_OBJECT (mq, "SingleQueue %d : starting task", sq->id);
result =
gst_pad_start_task (sq->srcpad, (GstTaskFunction) gst_multi_queue_loop,
GST_DEBUG_OBJECT (mq, "SingleQueue %d : trying to pop an object", sq->id);
+ if (sq->flushing)
+ goto out_flushing;
+
/* Get something from the queue, blocking until that happens, or we get
* flushed */
if (!(gst_data_queue_pop (sq->queue, &sitem)))
g_cond_wait (sq->turn, mq->qlock);
mq->numwaiting--;
+ if (sq->flushing) {
+ GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
+ goto out_flushing;
+ }
+
GST_DEBUG_OBJECT (mq, "queue %d woken from sleeping for not-linked "
"wakeup with newid %u and highid %u", sq->id, newid, mq->highid);
}
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
}
+ if (sq->flushing)
+ goto out_flushing;
+
GST_LOG_OBJECT (mq, "BEFORE PUSHING sq->srcresult: %s",
gst_flow_get_name (sq->srcresult));
(GstDataQueueFullCallback) single_queue_overrun_cb,
(GstDataQueueEmptyCallback) single_queue_underrun_cb, sq);
sq->is_eos = FALSE;
+ sq->flushing = FALSE;
gst_segment_init (&sq->sink_segment, GST_FORMAT_TIME);
gst_segment_init (&sq->src_segment, GST_FORMAT_TIME);