mirror of https://github.com/mpv-player/mpv
cuda: initialize hwframes format
In retrospect, this seems obvious, but ffmpeg didn't complain until a recent update.
This commit is contained in:
parent
b344da22ae
commit
1557ca6712
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue