From 16b4fe3d0b3e507fe96eb8cf81850ba5da72cfcd Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 3 Nov 2020 00:57:46 +0900 Subject: [PATCH] codecs: h265decoder: Don't drain DPB on EOB/EOS/IDR nalu DPB bumping decision per end-of-bitstream, end-of-sequence or IDR nal should done by spec. In short, draining on EOB/EOS/IDR is undefined behavior as per spec. Part-of: --- gst-libs/gst/codecs/gsth265decoder.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/gst-libs/gst/codecs/gsth265decoder.c b/gst-libs/gst/codecs/gsth265decoder.c index 51b2230318..08984526e2 100644 --- a/gst-libs/gst/codecs/gsth265decoder.c +++ b/gst-libs/gst/codecs/gsth265decoder.c @@ -515,7 +515,6 @@ gst_h265_decoder_preprocess_slice (GstH265Decoder * self, GstH265Slice * slice) { GstH265DecoderPrivate *priv = self->priv; const GstH265SliceHdr *slice_hdr = &slice->header; - const GstH265NalUnit *nalu = &slice->nalu; if (priv->current_picture && slice_hdr->first_slice_segment_in_pic_flag) { GST_WARNING_OBJECT (self, @@ -524,11 +523,6 @@ gst_h265_decoder_preprocess_slice (GstH265Decoder * self, GstH265Slice * slice) return FALSE; } - if (GST_H265_IS_NAL_TYPE_IDR (nalu->type)) { - GST_DEBUG_OBJECT (self, "IDR nalu, clear dpb"); - gst_h265_decoder_drain_internal (self); - } - return TRUE; } @@ -648,11 +642,9 @@ gst_h265_decoder_decode_nal (GstH265Decoder * self, GstH265NalUnit * nalu, priv->prev_nal_is_eos = FALSE; break; case GST_H265_NAL_EOB: - gst_h265_decoder_drain (GST_VIDEO_DECODER (self)); priv->new_bitstream = TRUE; break; case GST_H265_NAL_EOS: - gst_h265_decoder_drain (GST_VIDEO_DECODER (self)); priv->prev_nal_is_eos = TRUE; break; default: