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

Commit 9bbbdf49 authored by Ray Essick's avatar Ray Essick Committed by Gerrit Code Review
Browse files

Merge "When OggWriter stops, stop codec source first before pthread_join to prevent stall"

parents 8f51caff 67d0d2e8
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -242,13 +242,15 @@ status_t OggWriter::reset() {

    mDone = true;

    void* dummy;
    pthread_join(mThread, &dummy);
    status_t status = mSource->stop();

    void *pthread_res;
    pthread_join(mThread, &pthread_res);

    status_t err = static_cast<status_t>(reinterpret_cast<uintptr_t>(dummy));
    status_t err = static_cast<status_t>(reinterpret_cast<uintptr_t>(pthread_res));
    {
        status_t status = mSource->stop();
        if (err == OK && (status != OK && status != ERROR_END_OF_STREAM)) {
        if (err == OK &&
            (status != OK && status != ERROR_END_OF_STREAM)) {
            err = status;
        }
    }