h265parse: ignore VUI parse fail when parse SPS
authorHaihua Hu <jared.hu@nxp.com>
Thu, 28 Feb 2019 09:42:58 +0000 (17:42 +0800)
committerHaihua Hu <jared.hu@nxp.com>
Tue, 26 Mar 2019 02:06:03 +0000 (02:06 +0000)
VUI is an optional for SPS parse, some HEVC file has incorrect VUI
parameters but still can be decoded

gst/videoparsers/gsth265parse.c

index 3ae78aa8c1bae922a8e376aa0de2723a208c4404..c7fd8bf5b03f1a22380486e91ddfd4f9245b84b9 100644 (file)
@@ -613,8 +613,14 @@ gst_h265_parse_process_nal (GstH265Parse * h265parse, GstH265NalUnit * nalu)
 
       /* arranged for a fallback sps.id, so use that one and only warn */
       if (pres != GST_H265_PARSER_OK) {
-        GST_WARNING_OBJECT (h265parse, "failed to parse SPS:");
-        return FALSE;
+        /* try to not parse VUI */
+        pres = gst_h265_parser_parse_sps (nalparser, nalu, &sps, FALSE);
+        if (pres != GST_H265_PARSER_OK) {
+          GST_WARNING_OBJECT (h265parse, "failed to parse SPS:");
+          return FALSE;
+        }
+        GST_WARNING_OBJECT (h265parse,
+            "failed to parse VUI of SPS, ignore VUI");
       }
 
       GST_DEBUG_OBJECT (h265parse, "triggering src caps check");