queue2: fix deadlock in error path

Don't lock the same lock twice. Spotted by Josep Torre Valles.
This commit is contained in:
Tim-Philipp Müller 2011-08-12 19:27:21 +01:00
parent 63fb18dcd9
commit a7644b3b1c

View file

@ -2835,17 +2835,15 @@ gst_queue2_src_activate_pull (GstPad * pad, gboolean active)
queue->is_eos = FALSE;
queue->unexpected = FALSE;
queue->upstream_size = 0;
GST_QUEUE2_MUTEX_UNLOCK (queue);
} else {
GST_QUEUE2_MUTEX_LOCK (queue);
GST_DEBUG_OBJECT (queue, "no temp file, cannot activate pull mode");
/* this is not allowed, we cannot operate in pull mode without a temp
* file. */
queue->srcresult = GST_FLOW_WRONG_STATE;
queue->sinkresult = GST_FLOW_WRONG_STATE;
result = FALSE;
GST_QUEUE2_MUTEX_UNLOCK (queue);
}
GST_QUEUE2_MUTEX_UNLOCK (queue);
} else {
GST_QUEUE2_MUTEX_LOCK (queue);
GST_DEBUG_OBJECT (queue, "deactivating pull mode");