codecs: h264dec: Disable the POC order warning for negative POC.
authorHe Junyan <junyan.he@intel.com>
Tue, 6 Jul 2021 05:38:16 +0000 (13:38 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 6 Jul 2021 14:33:21 +0000 (14:33 +0000)
There may be leading frames after the IDR frame, which has negative
POC. This kind of frames are allowed and they will be displayed before
the IDR frame. So the warning should not be triggered for them. Init
the last_output_poc to G_MININT32 can avoid this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2380>

gst-libs/gst/codecs/gsth264decoder.c

index 554ab1e..938f2b9 100644 (file)
@@ -235,6 +235,8 @@ gst_h264_decoder_init (GstH264Decoder * self)
 
   self->priv = priv = gst_h264_decoder_get_instance_private (self);
 
+  priv->last_output_poc = G_MININT32;
+
   priv->ref_pic_list_p0 = g_array_sized_new (FALSE, TRUE,
       sizeof (GstH264Picture *), 32);
   g_array_set_clear_func (priv->ref_pic_list_p0,
@@ -372,7 +374,7 @@ gst_h264_decoder_clear_dpb (GstH264Decoder * self, gboolean flush)
   gst_queue_array_clear (priv->output_queue);
   gst_h264_decoder_clear_ref_pic_lists (self);
   gst_h264_dpb_clear (priv->dpb);
-  priv->last_output_poc = 0;
+  priv->last_output_poc = G_MININT32;
 }
 
 static gboolean
@@ -1643,7 +1645,7 @@ gst_h264_decoder_drain_internal (GstH264Decoder * self)
   gst_h264_decoder_drain_output_queue (self, 0);
 
   gst_h264_dpb_clear (priv->dpb);
-  priv->last_output_poc = 0;
+  priv->last_output_poc = G_MININT32;
 
   return TRUE;
 }