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

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

MediaCodecSource: Fix buffer allocation

am: 01d1e525

Change-Id: I03f6976b6615672bfa52f0dc5c60abd7b3f2b3bc
parents 5af449ae 01d1e525
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -859,6 +859,7 @@ void MediaCodecSource::onMessageReceived(const sp<AMessage> &msg) {
            }

            MediaBuffer *mbuf = new MediaBuffer(outbuf->size());
            mbuf->setObserver(this);
            mbuf->add_ref();

            if (!(flags & MediaCodec::BUFFER_FLAG_CODECCONFIG)) {
@@ -911,7 +912,6 @@ void MediaCodecSource::onMessageReceived(const sp<AMessage> &msg) {
                mbuf->meta_data()->setInt32(kKeyIsSyncFrame, true);
            }
            memcpy(mbuf->data(), outbuf->data(), outbuf->size());
            mbuf->setObserver(this);

            {
                Mutexed<Output>::Locked output(mOutput);