omx: When acquiring a buffer from an input port always wait until all output ports...
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 18 Jul 2011 11:10:49 +0000 (13:10 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 18 Jul 2011 11:10:49 +0000 (13:10 +0200)
omx/gstomx.c

index b271a30..898fdd4 100644 (file)
@@ -772,12 +772,12 @@ retry:
     goto done;
   }
 
-  /* If this is an input port and it needs to be reconfigured we
-   * first wait here until all output ports are reconfigured and
-   * then return
+  /* If this is an input port and at least one of the output ports
+   * needs to be reconfigured, we wait until all output ports are
+   * reconfigured. Afterwards this port is reconfigured if required
+   * or buffers are returned to be filled as usual.
    */
-  if (port->port_def.eDir == OMX_DirInput &&
-      port->settings_cookie != gst_omx_component_get_settings_cookie (comp)) {
+  if (port->port_def.eDir == OMX_DirInput) {
     g_mutex_unlock (port->port_lock);
     g_mutex_lock (comp->state_lock);
     while (comp->reconfigure_out_pending > 0 &&
@@ -800,9 +800,13 @@ retry:
       goto done;
     }
 
-    ret = GST_OMX_ACQUIRE_BUFFER_RECONFIGURE;
-    port->settings_changed = TRUE;
-    goto done;
+    /* Only if this port needs to be reconfigured too notify
+     * the caller about it */
+    if (port->settings_cookie != gst_omx_component_get_settings_cookie (comp)) {
+      ret = GST_OMX_ACQUIRE_BUFFER_RECONFIGURE;
+      port->settings_changed = TRUE;
+      goto done;
+    }
   }
 
   /* If we have an output port that needs to be reconfigured