Skip to content
  • Guillaume Desmottes's avatar
    omx: wait for flush complete and buffers being released when flushing · ba3f947f
    Guillaume Desmottes authored and Nicolas Dufresne's avatar Nicolas Dufresne committed
    When flusing we should wait for OMX to send the flush command complete event
    AND all ports being released.
    We were stopping as soon as one of those condition was met.
    
    Fix a race between FillThisBufferDone/EmptyBufferDone and the flush
    EventCmdComplete messages. The OMX implementation is supposed to release
    its buffers before posting the EventCmdComplete event but the ordering
    isn't guaranteed as the FillThisBufferDone/EmptyBufferDone and
    EventHandler callbacks can be called from different threads (cf 2.7
    'Thread Safety' in the spec).
    
    Only wait for buffers currently used by OMX as some buffers may not be
    in the pending queue because they are held downstream.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789475
    ba3f947f