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

Commit 3b2e41ba authored by Ray Essick's avatar Ray Essick Committed by Automerger Merge Worker
Browse files

Merge "NdkMediaCodec: fix AMediaCodec_configure to keep input format...

Merge "NdkMediaCodec: fix AMediaCodec_configure to keep input format constant." am: 135e1c7f am: efc27018 am: 8ec86a71 am: 7a61ec7b

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1793268

Change-Id: If67e468239892264693b83da1accb66e3bb9059a
parents ec950a45 7a61ec7b
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -452,17 +452,19 @@ media_status_t AMediaCodec_configure(
        uint32_t flags) {
    sp<AMessage> nativeFormat;
    AMediaFormat_getFormat(format, &nativeFormat);
    ALOGV("configure with format: %s", nativeFormat->debugString(0).c_str());
    // create our shallow copy, so we aren't victim to any later changes.
    sp<AMessage> dupNativeFormat = nativeFormat->dup();
    ALOGV("configure with format: %s", dupNativeFormat->debugString(0).c_str());
    sp<Surface> surface = NULL;
    if (window != NULL) {
        surface = (Surface*) window;
    }

    status_t err = mData->mCodec->configure(nativeFormat, surface,
    status_t err = mData->mCodec->configure(dupNativeFormat, surface,
            crypto ? crypto->mCrypto : NULL, flags);
    if (err != OK) {
        ALOGE("configure: err(%d), failed with format: %s",
              err, nativeFormat->debugString(0).c_str());
              err, dupNativeFormat->debugString(0).c_str());
    }
    return translate_error(err);
}