From bfa2fbd39bea8928bbfcfe0e914dc6384b2140a5 Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Mon, 12 Mar 2018 16:59:01 +0000 Subject: 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 --- gst-libs/gst/vaapi/gstvaapidecoder_h264.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v1.2.3