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

Commit bfc52120 authored by Mingming Yin's avatar Mingming Yin Committed by Steve Kondik
Browse files

Revert "Audio: fix stop issue for compress capture using MPEG4Writer"

- MPEG4Writer is waiting for FBD and camera stops giving buffers,
  then there is no buffer available to writer and thread is not
  joinable results in deadlock.
- Stop audio source before pthread_join to avoid deadlock during
  video recording

Change-Id: I871a969d844d98836b2e05d6d86606400926101f
parent e984d682
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1841,13 +1841,14 @@ status_t MPEG4Writer::Track::stop() {
    }
    mDone = true;

    ALOGD("%s track source stopping", mIsAudio? "Audio": "Video");
    mSource->stop();
    ALOGD("%s track source stopped", mIsAudio? "Audio": "Video");

    void *dummy;
    pthread_join(mThread, &dummy);
    status_t err = static_cast<status_t>(reinterpret_cast<uintptr_t>(dummy));

    ALOGD("%s track source stopping", mIsAudio? "Audio": "Video");
    err = mSource->stop();
    ALOGD("%s track stopped status:%d", mIsAudio? "Audio": "Video", err);
    if (mOwner->exceedsFileSizeLimit() && mStszTableEntries->count() == 0) {
        ALOGE(" Filesize limit exceeded and zero samples written ");
        return ERROR_END_OF_STREAM;