From: Nicolas Dufresne Date: Tue, 26 Jul 2022 16:22:10 +0000 (-0400) Subject: vaapi: h265dec: Refresh our sps/pps copy X-Git-Tag: 1.22.0~1222 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04e0154fb5a5c32209b95370bfde5420a750a912;p=platform%2Fupstream%2Fgstreamer.git vaapi: h265dec: Refresh our sps/pps copy The decoder uses a copy of the SPS/PPS. Since https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2575 the SPS/PPS is updated when the slice header is parsed. As a side effect, the H265 decoder was using an partially filled copy. Fixes: 5ae05bb42a ("codecparsers: Defering computation of pps and sps fields") Fixes: #1343 Part-of: --- diff --git a/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index c8cad23..cff837a 100644 --- a/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/subprojects/gstreamer-vaapi/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -585,6 +585,11 @@ ensure_pps (GstVaapiDecoderH265 * decoder, GstH265PPS * pps) GstVaapiParserInfoH265 *const pi = priv->pps[pps->id]; gst_vaapi_parser_info_h265_replace (&priv->active_pps, pi); + + /* Ensure our copy is up-to-date */ + pi->data.pps = *pps; + pi->data.pps.sps = NULL; + return pi ? &pi->data.pps : NULL; } @@ -609,6 +614,9 @@ ensure_sps (GstVaapiDecoderH265 * decoder, GstH265SPS * sps) if (pi && priv->active_sps) pi->state |= (priv->active_sps->state & GST_H265_VIDEO_STATE_GOT_I_FRAME); + /* Ensure our copy is up-to-date */ + pi->data.sps = *sps; + gst_vaapi_parser_info_h265_replace (&priv->active_sps, pi); return pi ? &pi->data.sps : NULL; }