Commit 7fccfc99 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vdpau: use profile and level from AVCodecContext

parent 3bbd8b0c
...@@ -258,12 +258,12 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, const es_format_t *fmt) ...@@ -258,12 +258,12 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, const es_format_t *fmt)
VdpStatus err; VdpStatus err;
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(56, 2, 0)) #if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(56, 2, 0))
VdpDecoderProfile profile; VdpDecoderProfile profile;
int level = fmt->i_level; int level = avctx->level;
if (av_vdpau_get_profile(avctx, &profile)) if (av_vdpau_get_profile(avctx, &profile))
{ {
msg_Err(va, "unsupported codec %d or profile %d", avctx->codec_id, msg_Err(va, "unsupported codec %d or profile %d", avctx->codec_id,
fmt->i_profile); avctx->profile);
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -279,8 +279,7 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, const es_format_t *fmt) ...@@ -279,8 +279,7 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, const es_format_t *fmt)
level = VDP_DECODER_LEVEL_MPEG4_PART2_ASP_L5; level = VDP_DECODER_LEVEL_MPEG4_PART2_ASP_L5;
break; break;
case AV_CODEC_ID_H264: case AV_CODEC_ID_H264:
if ((fmt->i_profile & FF_PROFILE_H264_INTRA) if ((avctx->profile & FF_PROFILE_H264_INTRA) && level == 11)
&& (fmt->i_level == 11))
level = VDP_DECODER_LEVEL_H264_1b; level = VDP_DECODER_LEVEL_H264_1b;
default: default:
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment