Revert "优化SEI/AUD帧处理逻辑" (#4361)

This reverts commit a35444f27e.
This commit is contained in:
xia-chu
2025-08-02 20:34:00 +08:00
parent 5a10db5f1b
commit 32ab752263
3 changed files with 1 additions and 16 deletions

View File

@@ -205,11 +205,7 @@ bool FrameMerger::willFlush(const Frame::Ptr &frame) const{
case mp4_nal_size:
case h264_prefix: {
if (frame->dropAble() && !_have_config_frame) {
// 遇到SEI帧且未缓存配置帧flush之前的帧
return true;
}
if (!_have_decode_able_frame && !_have_drop_able_frame) {
if (!_have_decode_able_frame) {
// 缓存中没有有效的能解码的帧所以这次不flush [AUTO-TRANSLATED:5d860722]
// There are no valid frames that can be decoded in the cache, so no flush this time.
return _frame_cache.size() > kMaxFrameCacheSize;
@@ -294,8 +290,6 @@ bool FrameMerger::inputFrame(const Frame::Ptr &frame, onOutput cb, BufferLikeStr
cb(back->dts(), back->pts(), merged_frame, have_key_frame);
_frame_cache.clear();
_have_decode_able_frame = false;
_have_drop_able_frame = false;
_have_config_frame = false;
}
if (!frame) {
@@ -305,12 +299,6 @@ bool FrameMerger::inputFrame(const Frame::Ptr &frame, onOutput cb, BufferLikeStr
if (frame->decodeAble()) {
_have_decode_able_frame = true;
}
if (frame->dropAble()) {
_have_drop_able_frame = true;
}
if (frame->configFrame()) {
_have_config_frame = true;
}
_cb = std::move(cb);
_frame_cache.emplace_back(Frame::getCacheAbleFrame(frame));
return true;

View File

@@ -660,8 +660,6 @@ private:
private:
int _type;
bool _have_decode_able_frame = false;
bool _have_drop_able_frame = false;
bool _have_config_frame = false;
onOutput _cb;
toolkit::List<Frame::Ptr> _frame_cache;
};