From 6f5a10542c276ad4fa87a2f449dc4173e10fc47d Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 28 May 2015 21:56:13 +0200 Subject: vdpau: add support for the "new" libavcodec vdpau API Yet another of these dozens of hwaccel changes. This time, libavcodec provides utility functions, which initialize the vdpau decoder and map codec profiles. So a lot of work the API user had to do falls away. This also will give us support for high bit depth profiles, and possibly HEVC once libavcodec supports it. --- video/decode/vd_lavc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 7c95f00e2c..de917a7820 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -517,11 +517,13 @@ static enum AVPixelFormat get_format_hwdec(struct AVCodecContext *avctx, ctx->hwdec_w != avctx->coded_width || ctx->hwdec_h != avctx->coded_height || ctx->hwdec_fmt != ctx->hwdec->image_format || - ctx->hwdec_profile != avctx->profile; + ctx->hwdec_profile != avctx->profile || + ctx->hwdec_request_reinit; ctx->hwdec_w = avctx->coded_width; ctx->hwdec_h = avctx->coded_height; ctx->hwdec_fmt = ctx->hwdec->image_format; ctx->hwdec_profile = avctx->profile; + ctx->hwdec_request_reinit = false; if (ctx->hwdec->init_decoder && change) { if (ctx->hwdec->init_decoder(ctx, ctx->hwdec_fmt, ctx->hwdec_w, ctx->hwdec_h) < 0) @@ -620,6 +622,9 @@ static int decode(struct dec_video *vd, struct demux_packet *packet, return -1; } + if (ctx->hwdec_request_reinit) + avcodec_flush_buffers(avctx); + // Skipped frame, or delayed output due to multithreaded decoding. if (!got_picture) return 0; -- cgit v1.2.3