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

Commit 85fb658b authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "Make sure the OMX component is synchronously shutdown before we try to...

Merge "Make sure the OMX component is synchronously shutdown before we try to instantiate another one. Also properly cleanup the software AVC decoder to avoid leaking memory."
parents 752b4a37 98b48dee
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -249,7 +249,16 @@ void AwesomePlayer::reset_l() {

    if (mVideoSource != NULL) {
        mVideoSource->stop();

        // The following hack is necessary to ensure that the OMX
        // component is completely released by the time we may try
        // to instantiate it again.
        wp<MediaSource> tmp = mVideoSource;
        mVideoSource.clear();
        while (tmp.promote() != NULL) {
            usleep(1000);
        }
        IPCThreadState::self()->flushCommands();
    }

    mAudioSource.clear();
+2 −0
Original line number Diff line number Diff line
@@ -80,6 +80,8 @@ AVCDecoder::~AVCDecoder() {
        stop();
    }

    PVAVCCleanUpDecoder(mHandle);

    delete mHandle;
    mHandle = NULL;
}