diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c index bd089e2430..9909db5566 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.c @@ -587,6 +587,12 @@ decode_picture(GstVaapiDecoderMpeg4 *decoder, const guint8 *buf, guint buf_size) return status; } +static inline guint +get_vop_coding_type(GstVaapiPicture *picture) +{ + return picture->type - GST_VAAPI_PICTURE_TYPE_I; +} + static gboolean fill_picture(GstVaapiDecoderMpeg4 *decoder, GstVaapiPicture *picture) { @@ -666,7 +672,7 @@ fill_picture(GstVaapiDecoderMpeg4 *decoder, GstVaapiPicture *picture) case GST_MPEG4_B_VOP: pic_param->TRB = priv->trb; pic_param->backward_reference_picture = priv->next_picture->surface_id; - pic_param->vop_fields.bits.backward_reference_vop_coding_type = priv->prev_picture->type; + pic_param->vop_fields.bits.backward_reference_vop_coding_type = get_vop_coding_type(priv->prev_picture); // fall-through case GST_MPEG4_P_VOP: pic_param->TRD = priv->trd;