From 1557ca6712ef86e03fd4109311f10d6c45875fc4 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Wed, 28 Sep 2016 12:06:56 -0700 Subject: [PATCH] cuda: initialize hwframes format In retrospect, this seems obvious, but ffmpeg didn't complain until a recent update. --- video/decode/cuda.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video/decode/cuda.c b/video/decode/cuda.c index f41aed2e7c..f9dd418fd5 100644 --- a/video/decode/cuda.c +++ b/video/decode/cuda.c @@ -57,6 +57,7 @@ static int init_decoder(struct lavc_ctx *ctx, int w, int h) AVCodecContext *avctx = ctx->avctx; AVCUDADeviceContext *device_hwctx; AVHWDeviceContext *device_ctx; + AVHWFramesContext *hwframe_ctx; CUVIDContext *priv = ctx->hwdec_priv; int ret = 0; @@ -89,6 +90,9 @@ static int init_decoder(struct lavc_ctx *ctx, int w, int h) goto error; } + hwframe_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data; + hwframe_ctx->format = AV_PIX_FMT_CUDA; + return 0; error: