From 4c4f03120747f3ef37dc82b79ad669eeec7d7341 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Wed, 5 May 2021 12:34:38 +0530 Subject: [PATCH] h265parse: don't invalidate the last PPS when parsing a new SPS This is a port of https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2019 to h265parse. When a SPS is received then any previous PPS remains valid. So don't clear the PPS flag from the parser state. This is important because there are encoders that don't generated a PPS after every SPS. Part-of: --- gst/videoparsers/gsth265parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c index 977bc9d6c6..a052b1f0c6 100644 --- a/gst/videoparsers/gsth265parse.c +++ b/gst/videoparsers/gsth265parse.c @@ -760,7 +760,7 @@ gst_h265_parse_process_nal (GstH265Parse * h265parse, GstH265NalUnit * nalu) break; case GST_H265_NAL_SPS: /* reset state, everything else is obsolete */ - h265parse->state = 0; + h265parse->state &= GST_H265_PARSE_STATE_GOT_PPS; pres = gst_h265_parser_parse_sps (nalparser, nalu, &sps, TRUE);