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

Commit f73f8771 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make a copy of output format in onOutputFormatChanged"

parents 6fd72fbf 860eff19
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -221,7 +221,13 @@ void CodecHandler::onMessageReceived(const sp<AMessage> &msg) {
                         break;
                         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);
                     Mutex::Autolock _l(mCodec->mAsyncCallbackLock);
                     if (mCodec->mAsyncCallbackUserData != NULL
                     if (mCodec->mAsyncCallbackUserData != NULL
+7 −2
Original line number Original line Diff line number Diff line
@@ -1671,8 +1671,13 @@ void HeicCompositeStream::CodecCallbackHandler::onMessageReceived(const sp<AMess
                         ALOGE("CB_OUTPUT_FORMAT_CHANGED: format is expected.");
                         ALOGE("CB_OUTPUT_FORMAT_CHANGED: format is expected.");
                         break;
                         break;
                     }
                     }

                     // Here format is MediaCodec's internal copy of output format.
                     parent->onHeicFormatChanged(format);
                     // Make a copy since onHeicFormatChanged() might modify it.
                     sp<AMessage> formatCopy;
                     if (format != nullptr) {
                         formatCopy = format->dup();
                     }
                     parent->onHeicFormatChanged(formatCopy);
                     break;
                     break;
                 }
                 }