From e0286d07b33d595bedba14a8eb5bea1f95ffe46e Mon Sep 17 00:00:00 2001 From: Yandong Lin Date: Mon, 30 Dec 2024 11:43:56 +0800 Subject: [PATCH] fix[h264d]: Fix extra data lost issue The extra data(sps/pps) will be lost when the following flow occur: push extra data -> reset -> push idr data. Change-Id: I5f371291d5e7bcc27aad18ce6ae180b00fd76bd7 Signed-off-by: Yandong Lin --- mpp/codec/dec/h264/h264d_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mpp/codec/dec/h264/h264d_api.c b/mpp/codec/dec/h264/h264d_api.c index ec1ab347..e82ad6c7 100644 --- a/mpp/codec/dec/h264/h264d_api.c +++ b/mpp/codec/dec/h264/h264d_api.c @@ -435,7 +435,8 @@ MPP_RET h264d_reset(void *decoder) p_strm->prefixdata = 0xffffffff; p_strm->nalu_offset = 0; p_strm->nalu_len = 0; - p_strm->head_offset = 0; + if (p_strm->nalu_type != H264_NALU_TYPE_PPS && p_strm->nalu_type != H264_NALU_TYPE_SPS) + p_strm->head_offset = 0; p_strm->tmp_offset = 0; p_strm->first_mb_in_slice = 0; p_strm->endcode_found = 0;