vp9decoder: Simplify gst_v4l2_codecs_vp9_dec_fill_refs()

In case reference_frames is NULL, return outright. Remove the
duplicate check from subsequent conditionals. No functional change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5791>
This commit is contained in:
Marek Vasut 2023-12-10 14:23:42 +01:00 committed by GStreamer Marge Bot
parent 4560cdff5c
commit 552a171671

View file

@ -271,19 +271,22 @@ gst_v4l2_codecs_vp9_dec_fill_refs (GstV4l2CodecVp9Dec * self,
{ {
GstVp9Picture *ref_pic; GstVp9Picture *ref_pic;
if (reference_frames && reference_frames->pic_list[h->ref_frame_idx[0]]) { if (!reference_frames)
return;
if (reference_frames->pic_list[h->ref_frame_idx[0]]) {
ref_pic = reference_frames->pic_list[h->ref_frame_idx[0]]; ref_pic = reference_frames->pic_list[h->ref_frame_idx[0]];
self->v4l2_vp9_frame.last_frame_ts = self->v4l2_vp9_frame.last_frame_ts =
GST_CODEC_PICTURE_FRAME_NUMBER (ref_pic) * G_GUINT64_CONSTANT (1000); GST_CODEC_PICTURE_FRAME_NUMBER (ref_pic) * G_GUINT64_CONSTANT (1000);
} }
if (reference_frames && reference_frames->pic_list[h->ref_frame_idx[1]]) { if (reference_frames->pic_list[h->ref_frame_idx[1]]) {
ref_pic = reference_frames->pic_list[h->ref_frame_idx[1]]; ref_pic = reference_frames->pic_list[h->ref_frame_idx[1]];
self->v4l2_vp9_frame.golden_frame_ts = self->v4l2_vp9_frame.golden_frame_ts =
GST_CODEC_PICTURE_FRAME_NUMBER (ref_pic) * G_GUINT64_CONSTANT (1000); GST_CODEC_PICTURE_FRAME_NUMBER (ref_pic) * G_GUINT64_CONSTANT (1000);
} }
if (reference_frames && reference_frames->pic_list[h->ref_frame_idx[2]]) { if (reference_frames->pic_list[h->ref_frame_idx[2]]) {
ref_pic = reference_frames->pic_list[h->ref_frame_idx[2]]; ref_pic = reference_frames->pic_list[h->ref_frame_idx[2]];
self->v4l2_vp9_frame.alt_frame_ts = self->v4l2_vp9_frame.alt_frame_ts =
GST_CODEC_PICTURE_FRAME_NUMBER (ref_pic) * G_GUINT64_CONSTANT (1000); GST_CODEC_PICTURE_FRAME_NUMBER (ref_pic) * G_GUINT64_CONSTANT (1000);