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 12:50:46 -0600 |
commit | 9a130035e52a49e6804ff33eb399ea5f6be5c773 (patch) | |
tree | a404a24735f4aec548233f59f32422a28297ebb4 | |
parent | c00b35fe15ceb57936b61e9ef7d35cbcc474d12d (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 ae644c68..165f0eee 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -3781,6 +3781,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); |