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
This commit is contained in:
Julien Isorce 2018-03-12 16:59:01 +00:00 committed by Víctor Manuel Jáquez Leal
parent 01d55f5667
commit bfa2fbd39b

View file

@ -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);