From 26d25d567f49d0f98f7c21a18be7bd921e351f8d Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 12 Jan 2017 09:40:16 +0100 Subject: vaapi: properly set hw_subfmt field with new decode API This fixes direct rendering with hwdec_vaegl.c. The code duplication between update_image_params() and mp_image_copy_fields_from_av_frame() is quite annoying, bit will have to be resolved in another commit. --- video/mp_image.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'video/mp_image.c') diff --git a/video/mp_image.c b/video/mp_image.c index 2c4627c33e..9781386129 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -706,6 +707,11 @@ static void mp_image_copy_fields_from_av_frame(struct mp_image *dst, dst->fields |= MP_IMGFIELD_TOP_FIRST; if (src->repeat_pict == 1) dst->fields |= MP_IMGFIELD_REPEAT_FIRST; + + if (src->hw_frames_ctx) { + AVHWFramesContext *fctx = (void *)src->hw_frames_ctx->data; + dst->params.hw_subfmt = pixfmt2imgfmt(fctx->sw_format); + } } // Copy properties and data of the mp_image into the AVFrame, without taking -- cgit v1.2.3