mirror of
https://github.com/mpv-player/mpv
synced 2024-12-12 01:46:16 +00:00
cuda: fix AVHWFramesContext initialization
This was partially done. Strangely it worked anyway.
This commit is contained in:
parent
6b00663755
commit
3a85976f8e
@ -60,6 +60,12 @@ static int init_decoder(struct lavc_ctx *ctx, int w, int h)
|
|||||||
|
|
||||||
AVHWFramesContext *hwframe_ctx = (void* )avctx->hw_frames_ctx->data;
|
AVHWFramesContext *hwframe_ctx = (void* )avctx->hw_frames_ctx->data;
|
||||||
hwframe_ctx->format = AV_PIX_FMT_CUDA;
|
hwframe_ctx->format = AV_PIX_FMT_CUDA;
|
||||||
|
hwframe_ctx->width = w;
|
||||||
|
hwframe_ctx->height = h;
|
||||||
|
hwframe_ctx->sw_format = avctx->sw_pix_fmt;
|
||||||
|
|
||||||
|
if (av_hwframe_ctx_init(avctx->hw_frames_ctx) < 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user