mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-16 13:04:18 +00:00
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:
parent
453d81886d
commit
5c4799ccf1
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue