Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5919c9c authored by Praveen Chavan's avatar Praveen Chavan Committed by Steve Kondik
Browse files

stagefright: Relinquish lock in OMXCodec while waiting for ANW buffers

This lets CallbackDispatcher continue working in the background
to deliver the component's messages to OMXCodec.

Change-Id: I357e2da269671ef365c004276ea0601d696d2efa
parent f5fad658
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2327,7 +2327,12 @@ OMXCodec::BufferInfo* OMXCodec::dequeueBufferFromNativeWindow() {
    // Dequeue the next buffer from the native window.
    ANativeWindowBuffer* buf;
    int fenceFd = -1;

    // dequeue-and-wait can block. relinquish mLock to
    // let other thread (CallbackDispatcher) do some useful work
    mLock.unlock();
    int err = native_window_dequeue_buffer_and_wait(mNativeWindow.get(), &buf);
    mLock.lock();
    if (err != 0) {
      CODEC_LOGE("dequeueBuffer failed w/ error 0x%08x", err);