guint i;
// Remove all unused pictures
- if (GST_VAAPI_PICTURE_IS_IDR(picture))
- dpb_flush(decoder);
- else {
+ if (!GST_VAAPI_PICTURE_IS_IDR(picture)) {
i = 0;
while (i < priv->dpb_count) {
GstVaapiPictureH264 * const picture = priv->dpb[i];
priv->long_ref_count = long_ref_count;
}
-static gboolean
+static void
init_picture_refs(
GstVaapiDecoderH264 *decoder,
GstVaapiPictureH264 *picture,
default:
break;
}
- return TRUE;
}
static gboolean
if (nalu->type == GST_H264_NAL_SLICE_IDR) {
GST_DEBUG("<IDR>");
GST_VAAPI_PICTURE_FLAG_SET(picture, GST_VAAPI_PICTURE_FLAG_IDR);
+ dpb_flush(decoder);
}
/* Initialize slice type */
else
base_picture->structure = GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD;
+ /* Initialize reference flags */
if (nalu->ref_idc) {
GstH264DecRefPicMarking * const dec_ref_pic_marking =
&slice_hdr->dec_ref_pic_marking;
}
init_picture_poc(decoder, picture, slice_hdr);
-
- if (GST_VAAPI_PICTURE_IS_IDR(picture))
- dpb_flush(decoder);
-
- if (!init_picture_refs(decoder, picture, slice_hdr)) {
- GST_ERROR("failed to initialize references");
- return FALSE;
- }
+ init_picture_refs(decoder, picture, slice_hdr);
return TRUE;
}