omx: Always check if the component is in an error state before waiting for a conditio...
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 7 Jul 2011 08:27:31 +0000 (10:27 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Sat, 9 Jul 2011 09:06:06 +0000 (11:06 +0200)
Otherwise we might wait forever because nothing is going to signal
the condition variable anymore.

omx/gstomx.c

index 3defa83..cba1c2a 100644 (file)
@@ -1112,6 +1112,11 @@ gst_omx_port_set_enabled_unlocked (GstOMXPort * port, gboolean enabled)
 
   comp = port->comp;
 
+  if ((err = gst_omx_component_get_last_error (comp)) != OMX_ErrorNone) {
+    GST_ERROR_OBJECT (comp->parent, "Component in error state: %d", err);
+    goto done;
+  }
+
   GST_DEBUG_OBJECT (comp->parent, "Setting port %u to %s", port->index,
       (enabled ? "enabled" : "disabled"));