diff options
author | wm4 <wm4@nowhere> | 2015-05-28 21:56:13 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-05-28 21:56:13 +0200 |
commit | 6f5a10542c276ad4fa87a2f449dc4173e10fc47d (patch) | |
tree | f27fd184990556233bdfb19fb9de21ddc2063219 /video/decode/vd_lavc.c | |
parent | 0699a6c598bc1c8968f426be37b62052f7cb1eb9 (diff) | |
download | mpv-6f5a10542c276ad4fa87a2f449dc4173e10fc47d.tar.bz2 mpv-6f5a10542c276ad4fa87a2f449dc4173e10fc47d.tar.xz |
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.
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r-- | video/decode/vd_lavc.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; |