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

Commit a8abb2e6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix for handling end of stream" into main

parents a0934756 2bd4df79
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -277,9 +277,11 @@ c2_status_t MultiAccessUnitHelper::scatter(
                    std::static_pointer_cast<const C2AccessUnitInfos::input>(
                    w->input.buffers.front()->getInfo(C2AccessUnitInfos::input::PARAM_TYPE));
            uint32_t offset = 0; uint32_t multiAUSize = multiAU.front().size();
            bool sendEos = false;
            for (int idx = 0; idx < auInfo->flexCount(); ++idx) {
                std::vector<C2ConstLinearBlock> au;
                const C2AccessUnitInfosStruct &info = auInfo->m.values[idx];
                sendEos |= (info.flags & C2FrameData::FLAG_END_OF_STREAM);
                std::unique_ptr<C2Work> newWork = cloneInputWork(w, info.flags);
                frameSet.insert(newFrameIdx);
                newFrameIdx = mFrameIndex++;
@@ -302,6 +304,17 @@ c2_status_t MultiAccessUnitHelper::scatter(
                processedWork->push_back(std::move(sliceWork));
                offset += info.size;
            }
            if (!sendEos && (w->input.flags & C2FrameData::FLAG_END_OF_STREAM)) {
                if (!processedWork->empty()) {
                    std::list<std::unique_ptr<C2Work>> &sliceWork = processedWork->back();
                    if (!sliceWork.empty()) {
                        std::unique_ptr<C2Work> &work = sliceWork.back();
                        if (work) {
                            work->input.flags = C2FrameData::FLAG_END_OF_STREAM;
                        }
                    }
                }
            }
        }
        if (!processedWork->empty()) {
            {