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

Commit b2ac9d7f authored by Diogo Ferreira's avatar Diogo Ferreira Committed by Steve Kondik
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 d869f6d3
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -827,6 +827,7 @@ bool BootAnimation::movie()

    }

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

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