diff options
Diffstat (limited to 'libavcodec/vdpau.c')
-rw-r--r-- | libavcodec/vdpau.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c index 9805a8d0b1..1d68e70b47 100644 --- a/libavcodec/vdpau.c +++ b/libavcodec/vdpau.c @@ -94,7 +94,9 @@ int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, vdctx->device = hwctx->device; vdctx->get_proc_address = hwctx->get_proc_address; - if (level < 0) + if (hwctx->flags & AV_HWACCEL_FLAG_IGNORE_LEVEL) + level = 0; + else if (level < 0) return AVERROR(ENOTSUP); status = vdctx->get_proc_address(vdctx->device, @@ -313,7 +315,7 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, { VDPAUHWContext *hwctx; - if (flags != 0) + if (flags & ~AV_HWACCEL_FLAG_IGNORE_LEVEL) return AVERROR(EINVAL); if (av_reallocp(&avctx->hwaccel_context, sizeof(*hwctx))) @@ -325,6 +327,7 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, hwctx->context.decoder = VDP_INVALID_HANDLE; hwctx->device = device; hwctx->get_proc_address = get_proc; + hwctx->flags = flags; hwctx->reset = 1; return 0; } |