From ba07768ca4ff2ee905d67860fe11c945be2ce833 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Mon, 20 Apr 2020 22:48:43 +0900 Subject: [PATCH] h264decoder: Don't handle gap frame num for the first picture If the first picture is not IDR, it would have non-zero frame_num but it's not gap. We should skip gap frame handling in that case --- gst-libs/gst/codecs/gsth264decoder.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/codecs/gsth264decoder.c b/gst-libs/gst/codecs/gsth264decoder.c index 214629413d..ee6bf71616 100644 --- a/gst-libs/gst/codecs/gsth264decoder.c +++ b/gst-libs/gst/codecs/gsth264decoder.c @@ -613,7 +613,8 @@ gst_h264_decoder_start_current_picture (GstH264Decoder * self) /* 7.4.3 */ if (frame_num != priv->prev_ref_frame_num && - frame_num != (priv->prev_ref_frame_num + 1) % priv->max_frame_num) { + frame_num != (priv->prev_ref_frame_num + 1) % priv->max_frame_num && + gst_h264_dpb_get_size (priv->dpb) > 0) { if (!gst_h264_decoder_handle_frame_num_gap (self, frame_num)) return FALSE; }