va: av1enc: Fix the reference number setting bug

The current way will let the total reference number surplus the
reference number set by the "ref-frames" property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6379>
This commit is contained in:
He Junyan 2024-03-15 15:48:34 +08:00 committed by GStreamer Marge Bot
parent 52638c1b22
commit 1745a82516

View file

@ -2058,7 +2058,7 @@ _av1_generate_gop_structure (GstVaAV1Enc * self)
l0++;
list0--;
}
if (l0 + l1 > self->gop.num_ref_frames)
if (l0 + l1 >= self->gop.num_ref_frames)
break;
if (list1 > 0) {
@ -2066,7 +2066,7 @@ _av1_generate_gop_structure (GstVaAV1Enc * self)
list1--;
}
if (l0 + l1 > self->gop.num_ref_frames)
if (l0 + l1 >= self->gop.num_ref_frames)
break;
}