From 1cddc2227b6df2cc3c7f32d979e18ed970455f51 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Wed, 18 Aug 2021 22:26:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dh265=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=B8=A7=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Extension/H265.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Extension/H265.h b/src/Extension/H265.h index 1952ea74..891cf5b3 100644 --- a/src/Extension/H265.h +++ b/src/Extension/H265.h @@ -70,7 +70,9 @@ public: bool keyFrame() const override { auto nal_ptr = (uint8_t *) this->data() + this->prefixSize(); auto type = H265_TYPE(*nal_ptr); - return (type == NAL_IDR_N_LP || type == NAL_IDR_W_RADL) && decodeAble(); + // 参考自FFmpeg: IRAP VCL NAL unit types span the range + // [BLA_W_LP (16), RSV_IRAP_VCL23 (23)]. + return (type >= NAL_BLA_W_LP && type <= NAL_RSV_IRAP_VCL23) && decodeAble() ; } bool configFrame() const override {