From 2eb2b26ad8d8c3fe9233c9242ae37ebdcec89a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 24 Aug 2017 21:51:22 +0200 Subject: [PATCH] libs: decoder: at update_caps() decode codec_data When updating the caps in decoder, if the caps has codec_data (avC format), it has to be parsed to update the state of the decoder. https://bugzilla.gnome.org/show_bug.cgi?id=786173 --- gst-libs/gst/vaapi/gstvaapidecoder.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder.c b/gst-libs/gst/vaapi/gstvaapidecoder.c index ce9c065b01..9e716db2c9 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder.c @@ -1182,10 +1182,8 @@ gst_vaapi_decoder_update_caps (GstVaapiDecoder * decoder, GstCaps * caps) if (!decoder_caps) return FALSE; - if (gst_caps_is_always_compatible (caps, decoder_caps)) { - set_caps (decoder, caps); - return TRUE; - } + if (gst_caps_is_always_compatible (caps, decoder_caps)) + return set_caps (decoder, caps); profile = gst_vaapi_profile_from_caps (caps); if (profile == GST_VAAPI_PROFILE_UNKNOWN) @@ -1194,8 +1192,11 @@ gst_vaapi_decoder_update_caps (GstVaapiDecoder * decoder, GstCaps * caps) if (codec == 0) return FALSE; if (codec == decoder->codec) { - set_caps (decoder, caps); - return TRUE; + if (set_caps (decoder, caps)) { + return + gst_vaapi_decoder_decode_codec_data (decoder) == + GST_VAAPI_DECODER_STATUS_SUCCESS; + } } return FALSE;