codecs: h264decoder: Don't fill gap picture if it's not allowed
authorSeungha Yang <seungha@centricular.com>
Thu, 12 Nov 2020 10:43:22 +0000 (19:43 +0900)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 12 Nov 2020 14:38:56 +0000 (14:38 +0000)
We should fill gap picture only if sps->gaps_in_frame_num_value_allowed_flag
is set.

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

gst-libs/gst/codecs/gsth264decoder.c

index 6cbdcb2..d4ad5cb 100644 (file)
@@ -632,7 +632,10 @@ gst_h264_decoder_handle_frame_num_gap (GstH264Decoder * self, gint frame_num)
   if (!sps->gaps_in_frame_num_value_allowed_flag) {
     /* This is likely the case where some frames were dropped.
      * then we need to keep decoding without error out */
-    GST_WARNING_OBJECT (self, "Invalid frame num %d", frame_num);
+    GST_WARNING_OBJECT (self, "Invalid frame num %d, maybe frame drop",
+        frame_num);
+
+    return TRUE;
   }
 
   GST_DEBUG_OBJECT (self, "Handling frame num gap %d -> %d (MaxFrameNum: %d)",