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

Commit 01d1e525 authored by Andy Hung's avatar Andy Hung
Browse files

MediaCodecSource: Fix buffer allocation

Bug: 31976029
Change-Id: I2ded0f8f1d51e63639e0f86376557e3d0d4f1cd3
parent 2035bc0e
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);