From a978bd2cabefd7f405a0f18af1dc5d0034d64cc6 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 28 Jun 2019 02:42:00 +1000 Subject: [PATCH] h264parser: Return BROKEN_LINK for missing SPS When parsing SEI that require an SPS, return GST_H264_PARSER_BROKEN_LINK instead of a generic parsing error to let callers distinguish bitstream errors from (expected) missing packets when resuming decode. --- gst-libs/gst/codecparsers/gsth264parser.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/codecparsers/gsth264parser.c b/gst-libs/gst/codecparsers/gsth264parser.c index 5214db080f..4fb66d1b4b 100644 --- a/gst-libs/gst/codecparsers/gsth264parser.c +++ b/gst-libs/gst/codecparsers/gsth264parser.c @@ -964,10 +964,13 @@ static GstH264ParserResult gst_h264_parser_parse_pic_timing (GstH264NalParser * nalparser, GstH264PicTiming * tim, NalReader * nr) { + GstH264ParserResult error = GST_H264_PARSER_ERROR; + GST_DEBUG ("parsing \"Picture timing\""); if (!nalparser->last_sps || !nalparser->last_sps->valid) { - GST_WARNING ("didn't get the associated sequence paramater set for the " + GST_WARNING ("didn't get the associated sequence parameter set for the " "current access unit"); + error = GST_H264_PARSER_BROKEN_LINK; goto error; } @@ -1013,7 +1016,7 @@ gst_h264_parser_parse_pic_timing (GstH264NalParser * nalparser, error: GST_WARNING ("error parsing \"Picture timing\""); - return GST_H264_PARSER_ERROR; + return error; } static GstH264ParserResult