diff options
author | Julien Isorce <jisorce@oblong.com> | 2018-03-12 16:59:01 +0000 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2018-03-16 11:14:48 -0600 |
commit | bfa2fbd39bea8928bbfcfe0e914dc6384b2140a5 (patch) | |
tree | 959afa05991ade55b368046e0fa49fd3c70cc8d3 | |
parent | 01d55f5667e0b7bf71c9997dd332c5304899c3fd (diff) |
libs: decoder: h264: ensure num_ref_frames is greater than 0
Even if it is the h264parse fault or bad video file, vaapih264dec
should set a proper value for VAPictureParameterBufferH264.num_ref_frames
as the driver might use it.
Also see "info.ref_frames = dpb_size;" in
gstvaapidecoder_h264.c::ensure_context
https://bugzilla.gnome.org/show_bug.cgi?id=793836
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapidecoder_h264.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c index a0698659..184668c5 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -3857,6 +3857,9 @@ fill_picture (GstVaapiDecoderH264 * decoder, GstVaapiPictureH264 * picture) COPY_FIELD (sps, bit_depth_luma_minus8); COPY_FIELD (sps, bit_depth_chroma_minus8); COPY_FIELD (sps, num_ref_frames); + if (pic_param->num_ref_frames == 0) + pic_param->num_ref_frames = priv->dpb_size; + #if !VA_CHECK_VERSION(1,0,0) /* Deprecate H.264 baseline profile and FMO support */ COPY_FIELD (pps, num_slice_groups_minus1); |