summaryrefslogtreecommitdiff
path: root/sys/va
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@intel.com>2021-07-16 13:21:11 +0800
committerHe Junyan <junyan.he@intel.com>2021-07-16 15:50:47 +0800
commit6a9f84a2dec6755bb9b53a50bec6d9611b8c0541 (patch)
tree730d8e146faf1c51d24cb3d3f264be397dfe8f94 /sys/va
parent26fe5527079c5ee6eb9f8982f3e3a50c62ddfb6d (diff)
downloadgstreamer-plugins-bad-6a9f84a2dec6755bb9b53a50bec6d9611b8c0541.tar.gz
va: h265dec: Do not add non reference frames into ref list.
The VA's ReferenceFrames should only contain the reference frame, we should not add the non reference frames into this list. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2414>
Diffstat (limited to 'sys/va')
-rw-r--r--sys/va/gstvah265dec.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/va/gstvah265dec.c b/sys/va/gstvah265dec.c
index c126e5a8f..bff3a975c 100644
--- a/sys/va/gstvah265dec.c
+++ b/sys/va/gstvah265dec.c
@@ -754,9 +754,16 @@ gst_va_h265_dec_start_picture (GstH265Decoder * decoder,
/* reference frames */
{
GArray *ref_list = gst_h265_dpb_get_pictures_all (dpb);
- for (i = 0; i < 15 && i < ref_list->len; i++) {
- GstH265Picture *pic = g_array_index (ref_list, GstH265Picture *, i);
- _fill_vaapi_pic (decoder, &pic_param->base.ReferenceFrames[i], pic);
+ guint j;
+
+ i = 0;
+ for (j = 0; j < 15 && j < ref_list->len; j++) {
+ GstH265Picture *pic = g_array_index (ref_list, GstH265Picture *, j);
+
+ if (pic->ref) {
+ _fill_vaapi_pic (decoder, &pic_param->base.ReferenceFrames[i], pic);
+ i++;
+ }
}
g_array_unref (ref_list);