+static int vdpau_mpeg2_init(AVCodecContext *avctx)
+{
+ VdpDecoderProfile profile;
+
+ switch (avctx->profile) {
+ case FF_PROFILE_MPEG2_MAIN:
+ profile = VDP_DECODER_PROFILE_MPEG2_MAIN;
+ break;
+ case FF_PROFILE_MPEG2_SIMPLE:
+ profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE;
+ break;
+ default:
+ return AVERROR(EINVAL);
+ }
+
+ return ff_vdpau_common_init(avctx, profile, VDP_DECODER_LEVEL_MPEG2_HL);
+}
+