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

Commit da0517d8 authored by Taehwan Kim's avatar Taehwan Kim Committed by Wonsik Kim
Browse files

CCodec: add to check pipelineFull() in feedInputBufferIfAvailableInternal()



it is possible that input could be feeded over numSlots
because that feedInputBufferIfAvailableInternal() can be called
at multi-threads.
so, need to check pipelineFull() for stopping it.

Bug: 168575144

Change-Id: I879301f3d137aeb9d8935d97e906849af7ee7bc6
Signed-off-by: default avatarTaehwan Kim <t_h.kim@samsung.com>
parent 10fd4b5f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -618,7 +618,7 @@ void CCodecBufferChannel::feedInputBufferIfAvailable() {
}

void CCodecBufferChannel::feedInputBufferIfAvailableInternal() {
    if (mInputMetEos || mPipelineWatcher.lock()->pipelineFull()) {
    if (mInputMetEos) {
        return;
    }
    {
@@ -631,6 +631,9 @@ void CCodecBufferChannel::feedInputBufferIfAvailableInternal() {
    }
    size_t numInputSlots = mInput.lock()->numSlots;
    for (size_t i = 0; i < numInputSlots; ++i) {
        if (mPipelineWatcher.lock()->pipelineFull()) {
            return;
        }
        sp<MediaCodecBuffer> inBuffer;
        size_t index;
        {