From 82dbd6f5be41206a7159e71bbb879e79b6d9bc8e Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Wed, 8 Feb 2012 18:08:49 +0100 Subject: [PATCH] h264: complete any current picture decoder before SPS / PPS change. This ensures the VA context is clear when the encoded resolution changes. i.e. make sure older picture is decoded with the older VA context before it changes. --- gst-libs/gst/vaapi/gstvaapidecoder_h264.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c index 5083740..0746c28 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -691,6 +691,9 @@ decode_sps(GstVaapiDecoderH264 *decoder, GstH264NalUnit *nalu) GST_DEBUG("decode SPS"); + if (priv->current_picture && !decode_current_picture(decoder)) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + memset(sps, 0, sizeof(*sps)); result = gst_h264_parser_parse_sps(priv->parser, nalu, sps, TRUE); if (result != GST_H264_PARSER_OK) @@ -708,6 +711,9 @@ decode_pps(GstVaapiDecoderH264 *decoder, GstH264NalUnit *nalu) GST_DEBUG("decode PPS"); + if (priv->current_picture && !decode_current_picture(decoder)) + return GST_VAAPI_DECODER_STATUS_ERROR_UNKNOWN; + memset(pps, 0, sizeof(*pps)); result = gst_h264_parser_parse_pps(priv->parser, nalu, pps); if (result != GST_H264_PARSER_OK) -- 2.7.4