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

Commit 1db7192b authored by Manikanta Kanamarlapudi's avatar Manikanta Kanamarlapudi Committed by Gerrit - the friendly Code Review server
Browse files

libstagefright: Call encoder release first

If encoder pipeline stalled for some reasons and meanwhile
user called stop, camera reset is called first and is waiting
for encoder buffers to return. Since after stop writer doesn't
consume FBD's, there is a timedout for encoder buffers
in camera source. To avoid timedout, release encoder first
and then camera.

Change-Id: I1ce673595be1b4024ceca4975bebfdbae850fb3e
parent e4b1f31b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -189,9 +189,6 @@ void MediaCodecSource::Puller::stop() {
        queue->flush(); // flush any unprocessed pulled buffers
    }

    if (interrupt) {
        interruptSource();
    }
}

void MediaCodecSource::Puller::interruptSource() {
@@ -972,12 +969,13 @@ void MediaCodecSource::onMessageReceived(const sp<AMessage> &msg) {
             break;
        }

        signalEOS();

        if (!(mFlags & FLAG_USE_SURFACE_INPUT)) {
            ALOGV("source (%s) stopping", mIsVideo ? "video" : "audio");
            mPuller->interruptSource();
            ALOGV("source (%s) stopped", mIsVideo ? "video" : "audio");
        }
        signalEOS();
    }

    case kWhatPause: