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

Commit 9996d9d3 authored by Andy Hung's avatar Andy Hung
Browse files

IMediaSource: fix local MediaBufferGroup refcount

Bug: 31526329
Change-Id: Ib596454e1c224e135dd51f95b0182f86d9e76f55
parent 94a82dcd
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",