From 54982527509d23f36827181a59275547a811559f Mon Sep 17 00:00:00 2001 From: Haihua Hu Date: Thu, 28 Feb 2019 17:42:58 +0800 Subject: [PATCH] h265parse: ignore VUI parse fail when parse SPS VUI is an optional for SPS parse, some HEVC file has incorrect VUI parameters but still can be decoded --- gst/videoparsers/gsth265parse.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c index 3ae78aa8c1..c7fd8bf5b0 100644 --- a/gst/videoparsers/gsth265parse.c +++ b/gst/videoparsers/gsth265parse.c @@ -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");