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

Commit df4e9823 authored by Andy Hung's avatar Andy Hung Committed by android-build-merger
Browse files

IMediaSource: fix local MediaBufferGroup refcount

am: 9996d9d3

Change-Id: Id12f76a8618877fc0bf4ed1b550108df164c9a4a
parents c82f4ce9 9996d9d3
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -412,12 +412,12 @@ status_t BnMediaSource::onTransact(
                    reply->writeInt32(offset);
                    reply->writeInt32(length);
                    buf->meta_data()->writeToParcel(*reply);
                    if (transferBuf == buf) {
                        buf->addRemoteRefcount(1);
                        if (!supportNonblockingRead()) {
                    transferBuf->addRemoteRefcount(1);
                    if (transferBuf != buf) {
                        transferBuf->release(); // release local ref
                    } else if (!supportNonblockingRead()) {
                        maxNumBuffers = 0; // stop readMultiple with one shared buffer.
                    }
                    }
                } else {
                    ALOGV_IF(buf->mMemory != nullptr,
                            "INLINE(%p) %zu shared mem available, but only %zu used",