Merge "Make a copy of output format in onOutputFormatChanged" into qt-qpr1-dev

am: 863695e7ab

Change-Id: I2927d2a6cef66c31c18d0ad942830f59d9556a57
gugelfrei
Chong Zhang 5 years ago committed by android-build-merger
commit 3644001ea4

@ -221,7 +221,13 @@ void CodecHandler::onMessageReceived(const sp<AMessage> &msg) {
break;
}
AMediaFormat *aMediaFormat = AMediaFormat_fromMsg(&format);
// Here format is MediaCodec's internal copy of output format.
// Make a copy since the client might modify it.
sp<AMessage> copy;
if (format != nullptr) {
copy = format->dup();
}
AMediaFormat *aMediaFormat = AMediaFormat_fromMsg(&copy);
Mutex::Autolock _l(mCodec->mAsyncCallbackLock);
if (mCodec->mAsyncCallbackUserData != NULL

@ -1671,8 +1671,13 @@ void HeicCompositeStream::CodecCallbackHandler::onMessageReceived(const sp<AMess
ALOGE("CB_OUTPUT_FORMAT_CHANGED: format is expected.");
break;
}
parent->onHeicFormatChanged(format);
// Here format is MediaCodec's internal copy of output format.
// Make a copy since onHeicFormatChanged() might modify it.
sp<AMessage> formatCopy;
if (format != nullptr) {
formatCopy = format->dup();
}
parent->onHeicFormatChanged(formatCopy);
break;
}

Loading…
Cancel
Save