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

Commit 7edda7ac authored by Marco Nelissen's avatar Marco Nelissen Committed by Android (Google) Code Review
Browse files

Merge "Fix typos and pointer math."

parents 5afbb746 829e097f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -179,7 +179,7 @@ AMediaCodecCryptoInfo *AMediaCodecCryptoInfo_new(
        size_t *encryptedbytes);
        size_t *encryptedbytes);


/**
/**
 * delete an AMediaCodecCryptoInfo create previously with AMediaCodecCryptoInfo_new, or
 * delete an AMediaCodecCryptoInfo created previously with AMediaCodecCryptoInfo_new, or
 * obtained from AMediaExtractor
 * obtained from AMediaExtractor
 */
 */
int AMediaCodecCryptoInfo_delete(AMediaCodecCryptoInfo*);
int AMediaCodecCryptoInfo_delete(AMediaCodecCryptoInfo*);
+1 −1
Original line number Original line Diff line number Diff line
@@ -39,7 +39,7 @@ typedef struct AMediaCrypto AMediaCrypto;


typedef uint8_t AMediaUUID[16];
typedef uint8_t AMediaUUID[16];


bool AMediaCrypto_isCryptoSchemeSupport(const AMediaUUID uuid);
bool AMediaCrypto_isCryptoSchemeSupported(const AMediaUUID uuid);


bool AMediaCrypto_requiresSecureDecoderComponent(const char *mime);
bool AMediaCrypto_requiresSecureDecoderComponent(const char *mime);


+5 −7
Original line number Original line Diff line number Diff line
@@ -369,7 +369,7 @@ int AMediaCodec_queueSecureInputBuffer(
    if (err != 0) {
    if (err != 0) {
        ALOGE("queSecureInputBuffer: %s", errormsg.c_str());
        ALOGE("queSecureInputBuffer: %s", errormsg.c_str());
    }
    }
    delete subSamples;
    delete [] subSamples;
    return translate_error(err);
    return translate_error(err);
}
}


@@ -396,13 +396,11 @@ AMediaCodecCryptoInfo *AMediaCodecCryptoInfo_new(
    ret->mode = mode;
    ret->mode = mode;


    // clearbytes and encryptedbytes point at the actual data, which follows
    // clearbytes and encryptedbytes point at the actual data, which follows
    ret->clearbytes = (size_t*) ((&ret->encryptedbytes) + sizeof(ret->encryptedbytes));
    ret->clearbytes = (size_t*) (ret + 1); // point immediately after the struct
    ret->encryptedbytes = (size_t*) (ret->clearbytes + (sizeof(size_t) * numsubsamples));
    ret->encryptedbytes = ret->clearbytes + numsubsamples; // point after the clear sizes


    size_t *dst = ret->clearbytes;
    memcpy(ret->clearbytes, clearbytes, numsubsamples * sizeof(size_t));
    memcpy(dst, clearbytes, numsubsamples * sizeof(size_t));
    memcpy(ret->encryptedbytes, encryptedbytes, numsubsamples * sizeof(size_t));
    dst += numsubsamples * sizeof(size_t);
    memcpy(dst, encryptedbytes, numsubsamples * sizeof(size_t));


    return ret;
    return ret;
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -74,7 +74,7 @@ struct AMediaCrypto {
extern "C" {
extern "C" {




bool AMediaCrypto_isCryptoSchemeSupport(const AMediaUUID uuid) {
bool AMediaCrypto_isCryptoSchemeSupported(const AMediaUUID uuid) {
    sp<ICrypto> crypto = makeCrypto();
    sp<ICrypto> crypto = makeCrypto();
    if (crypto == NULL) {
    if (crypto == NULL) {
        return false;
        return false;