summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-03-23 19:20:43 +0100
committerLuca Barbato <lu_zero@gentoo.org>2014-05-12 12:59:16 +0200
commit5cbfdac2a82f4340971d31fcf05b333cdf6d3c12 (patch)
tree2138ed4b0bd3a12aaa85c3cd1be19a9c8aaa8d67 /video
parentc78b8b2c0cba56bbccfb3f8f8eb5de90b2d4cfeb (diff)
downloadmpv-5cbfdac2a82f4340971d31fcf05b333cdf6d3c12.tar.bz2
mpv-5cbfdac2a82f4340971d31fcf05b333cdf6d3c12.tar.xz
vd_lavc: Support hwaccel 1.2 and later
Hwaccel 1.2 populates only the third data field and assumes that the AVCodecContext is available to the dealloc function.
Diffstat (limited to 'video')
-rw-r--r--video/decode/vd_lavc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 57b391a6a2..1ba579abed 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -395,6 +395,9 @@ static void uninit_avctx(struct dec_video *vd)
vd_ffmpeg_ctx *ctx = vd->priv;
AVCodecContext *avctx = ctx->avctx;
+ if (ctx->hwdec && ctx->hwdec->uninit)
+ ctx->hwdec->uninit(ctx);
+
if (avctx) {
if (avctx->codec && avcodec_close(avctx) < 0)
MP_ERR(vd, "Could not close codec.\n");
@@ -405,9 +408,6 @@ static void uninit_avctx(struct dec_video *vd)
av_freep(&ctx->avctx);
- if (ctx->hwdec && ctx->hwdec->uninit)
- ctx->hwdec->uninit(ctx);
-
av_frame_free(&ctx->pic);
}
@@ -590,7 +590,7 @@ static int decode(struct dec_video *vd, struct demux_packet *packet,
av_frame_unref(ctx->pic);
if (!mpi)
return 0;
- assert(mpi->planes[0]);
+ assert(mpi->planes[0] || mpi->planes[3]);
mp_image_set_params(mpi, &params);
if (ctx->hwdec && ctx->hwdec->process_image)