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

Commit 16e8c723 authored by Diogo Ferreira's avatar Diogo Ferreira Committed by Gerrit Code Review
Browse files

bootanimation: Only try to shutdown the mediaplayer if it was prepared

The bootanimation tries to shutdown the mediaplayer gracefully by waiting
on an asynchronous shutdown event for 5 seconds.

If, however, there is no boot sound, that asynchronous shutdown event will
never happen and the animation will be stopped for 5 seconds before shutting
down.

Visibly, this fixes the issue where the bootanimation would simply stop near
the end for exactly 5 seconds.

Change-Id: I77f5631368c7d9b9fef7941a6278af9c36032044
parent fc8c502d
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -797,6 +797,7 @@ bool BootAnimation::movie()

    }

    if (isMPlayerPrepared) {
        ALOGD("waiting for media player to complete.");
        struct timespec timeout;
        clock_gettime(CLOCK_REALTIME, &timeout);
@@ -811,6 +812,7 @@ bool BootAnimation::movie()
        }
        pthread_mutex_unlock(&mp_lock);
        ALOGD("media player is completed.");
    }

    pthread_cond_destroy(&mp_cond);
    pthread_mutex_destroy(&mp_lock);