diff options
author | Hyunjun Ko <zzoon@igalia.com> | 2017-09-18 14:29:55 +0900 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2017-09-25 13:11:43 +0200 |
commit | a4c60fb2a96e52bf3244a0ae74d3d2eeaea3acc1 (patch) | |
tree | 6a947cdfb79222078ac580f809ff083b46971ae3 | |
parent | 9cf26c81a17a71c4ededd944d2668b576a4e404b (diff) |
libs: decoder: h264/h265: decode codec data only if opened
Fixes regression introduced by commit 2eb2b26a.
There is a use case when the decoder set the src caps and immediatly
tries to process the media codec_data, this happens before decoder is
even opened, thus priv->parser is not instantiated yet.
https://bugzilla.gnome.org/show_bug.cgi?id=787818
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_h264.c | 3 | ||||
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_h265.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c index da9b291e..d76c3876 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -4309,6 +4309,9 @@ gst_vaapi_decoder_h264_decode_codec_data (GstVaapiDecoder * base_decoder, GstH264ParserResult result; guint i, ofs, num_sps, num_pps; + if (!priv->is_opened) + return GST_VAAPI_DECODER_STATUS_SUCCESS; + unit.parsed_info = NULL; if (buf_size < 7) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c index bc80754e..53093d3e 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h265.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h265.c @@ -2653,6 +2653,9 @@ gst_vaapi_decoder_h265_decode_codec_data (GstVaapiDecoder * guint num_nal_arrays, num_nals; guint i, j, ofs; + if (!priv->is_opened) + return GST_VAAPI_DECODER_STATUS_SUCCESS; + unit.parsed_info = NULL; if (buf_size < 23) return GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA; |