codecs: h264decoder: Don't give up to decode due to missing reference picture
authorSeungha Yang <seungha@centricular.com>
Fri, 13 Nov 2020 18:16:07 +0000 (03:16 +0900)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 14 Nov 2020 16:17:18 +0000 (16:17 +0000)
Missing reference picture is very common thing for broken/malformed stream.
Decoder should be able to keep decoding if it's not a very critical error.

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

gst-libs/gst/codecs/gsth264decoder.c

index e6d20af..40446d9 100644 (file)
@@ -2354,7 +2354,7 @@ modify_ref_pic_list (GstH264Decoder * self, int list)
         if (!pic) {
           GST_WARNING_OBJECT (self, "Malformed stream, no pic num %d",
               pic_num_lx);
-          return FALSE;
+          break;
         }
         shift_right_and_insert (ref_pic_listx, ref_idx_lx,
             num_ref_idx_lX_active_minus1, pic);
@@ -2380,7 +2380,7 @@ modify_ref_pic_list (GstH264Decoder * self, int list)
         if (!pic) {
           GST_WARNING_OBJECT (self, "Malformed stream, no pic num %d",
               list_mod->value.long_term_pic_num);
-          return FALSE;
+          break;
         }
         shift_right_and_insert (ref_pic_listx, ref_idx_lx,
             num_ref_idx_lX_active_minus1, pic);