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

Commit adb59ecb authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "mediaplayer2: allow prepare DRM in non-prepare states"

parents 7e88dc68 daca30ef
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1124,9 +1124,11 @@ status_t MediaPlayer2::prepareDrm(
    // completed) so the state change to "prepared" might not have happened yet (e.g., buffering).
    // Still, we can allow prepareDrm for the use case of being called in OnDrmInfoListener.
    if (!(mCurrentState & (MEDIA_PLAYER2_PREPARING | MEDIA_PLAYER2_PREPARED))) {
        ALOGE("prepareDrm is called in the wrong state (%d).", mCurrentState);
        ALOGW("prepareDrm(%lld) called in non-prepare state(%d)", (long long)srcId, mCurrentState);
        if (srcId == mSrcId) {
            return INVALID_OPERATION;
        }
    }

    if (drmSessionId.isEmpty()) {
        ALOGE("prepareDrm: Unexpected. Can't proceed with crypto. Empty drmSessionId.");