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

Commit 921d74fb authored by Wei Jia's avatar Wei Jia Committed by android-build-merger
Browse files

Merge \\"stagefright: use uniqueId to detect same surface for setSurface\\"...

Merge \\"stagefright: use uniqueId to detect same surface for setSurface\\" into nyc-dev am: ecc6049e
am: cabaa2cd

Change-Id: I163bb7b0c2092924ce8961564b41891e264a71c7
parents bde5acd3 cabaa2cd
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2682,9 +2682,12 @@ ssize_t MediaCodec::dequeuePortBuffer(int32_t portIndex) {
status_t MediaCodec::connectToSurface(const sp<Surface> &surface) {
    status_t err = OK;
    if (surface != NULL) {
        uint64_t oldId, newId;
        if (mSurface != NULL
                && surface->getConsumerName() == mSurface->getConsumerName()) {
            ALOGI("connecting to native window with same name. Assuming no change of surface");
                && surface->getUniqueId(&newId) == NO_ERROR
                && mSurface->getUniqueId(&oldId) == NO_ERROR
                && newId == oldId) {
            ALOGI("[%s] connecting to the same surface. Nothing to do.", mComponentName.c_str());
            return ALREADY_EXISTS;
        }