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

Commit c524d233 authored by Lajos Molnar's avatar Lajos Molnar Committed by android-build-merger
Browse files

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

am: ecc6049e

Change-Id: I59f712f7ee90fcdb0a8719504570d3dd1650cf18
parents 606d0414 ecc6049e
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;
        }