From 1920802764d7eb50e2cb87c4cfea79b314c31635 Mon Sep 17 00:00:00 2001 From: xgj Date: Thu, 17 Jun 2021 18:08:35 +0800 Subject: [PATCH] for h264 multi slice on frame compatibility --- src/Extension/Frame.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Extension/Frame.cpp b/src/Extension/Frame.cpp index b43206db..61b6d613 100644 --- a/src/Extension/Frame.cpp +++ b/src/Extension/Frame.cpp @@ -191,9 +191,12 @@ bool FrameMerger::willFlush(const Frame::Ptr &frame) const{ } switch (frame->getCodecId()) { case CodecH264 : { - if (H264_TYPE(frame->data()[frame->prefixSize()]) == H264Frame::NAL_B_P) { - //如果是264的b/p帧,那么也刷新输出 + if (frame->data()[frame->prefixSize()+1]&0x80 !=0) { + //264 新一帧的开始,刷新输出 return true; + }else{ + // 不刷新输出 + return false; } break; }