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

Commit b9016864 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

ACodec: bypass crypto / descrambler if input is empty

Bug: 150188155
Test: atest GtsExoPlayerTestCases
Change-Id: Ib40ad6df3c7e61f2728789b4d869db80e97b0059
parent 10b16117
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -134,7 +134,12 @@ status_t ACodecBufferChannel::queueSecureInputBuffer(
    }
    ssize_t result = -1;
    ssize_t codecDataOffset = 0;
    if (mCrypto != NULL) {
    if (numSubSamples == 1
            && subSamples[0].mNumBytesOfClearData == 0
            && subSamples[0].mNumBytesOfEncryptedData == 0) {
        // We don't need to go through crypto or descrambler if the input is empty.
        result = 0;
    } else if (mCrypto != NULL) {
        hardware::drm::V1_0::DestinationBuffer destination;
        if (secure) {
            destination.type = DrmBufferType::NATIVE_HANDLE;