omx: Minimize the time when the messages lock is held

Fixes a deadlock if any OMX functions are called when the
messages are handled.

Thanks to Nicolas Dufresne for noticing.
This commit is contained in:
Sebastian Dröge 2013-01-18 16:47:04 +01:00
parent 453d81886d
commit 5c4799ccf1

View file

@ -196,8 +196,9 @@ gst_omx_component_handle_messages (GstOMXComponent * comp)
GstOMXMessage *msg;
g_mutex_lock (&comp->messages_lock);
while ((msg = g_queue_pop_head (&comp->messages))) {
g_mutex_unlock (&comp->messages_lock);
switch (msg->type) {
case GST_OMX_MESSAGE_STATE_SET:{
GST_DEBUG_OBJECT (comp->parent, "State change to %d finished",
@ -349,6 +350,8 @@ gst_omx_component_handle_messages (GstOMXComponent * comp)
}
g_slice_free (GstOMXMessage, msg);
g_mutex_lock (&comp->messages_lock);
}
g_mutex_unlock (&comp->messages_lock);