diff options
Diffstat (limited to 'video/decode')
-rw-r--r-- | video/decode/vaapi.c | 7 | ||||
-rw-r--r-- | video/decode/vd_lavc.c | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/video/decode/vaapi.c b/video/decode/vaapi.c index 8d7af19bfa..bd84fcc253 100644 --- a/video/decode/vaapi.c +++ b/video/decode/vaapi.c @@ -101,12 +101,6 @@ static int init_decoder(struct lavc_ctx *ctx, int w, int h) return 0; } -static struct mp_image *update_format(struct lavc_ctx *ctx, struct mp_image *img) -{ - va_surface_init_subformat(img); - return img; -} - static void uninit(struct lavc_ctx *ctx) { struct priv *p = ctx->hwdec_priv; @@ -222,7 +216,6 @@ const struct vd_lavc_hwdec mp_vd_lavc_vaapi = { .init_decoder = init_decoder, .lock = intel_shit_lock, .unlock = intel_crap_unlock, - .process_image = update_format, }; const struct vd_lavc_hwdec mp_vd_lavc_vaapi_copy = { diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 056a170d36..227401a677 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -24,6 +24,7 @@ #include <libavutil/common.h> #include <libavutil/opt.h> +#include <libavutil/hwcontext.h> #include <libavutil/intreadwrite.h> #include <libavutil/pixdesc.h> @@ -659,6 +660,11 @@ static void update_image_params(struct dec_video *vd, AVFrame *frame, .rotate = vd->codec->rotate, .stereo_in = vd->codec->stereo_mode, }; + + if (frame->hw_frames_ctx) { + AVHWFramesContext *fctx = (void *)frame->hw_frames_ctx->data; + out_params->hw_subfmt = pixfmt2imgfmt(fctx->sw_format); + } } static enum AVPixelFormat get_format_hwdec(struct AVCodecContext *avctx, |