summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-12 09:40:16 +0100
committerwm4 <wm4@nowhere>2017-01-12 13:58:28 +0100
commit26d25d567f49d0f98f7c21a18be7bd921e351f8d (patch)
treeddd2bed92d2ec16ab6d1da8dedcfbadc93a15b4f /video/decode/vd_lavc.c
parenta51e991b564113254d9262565ddb69e40e2fd726 (diff)
downloadmpv-26d25d567f49d0f98f7c21a18be7bd921e351f8d.tar.bz2
mpv-26d25d567f49d0f98f7c21a18be7bd921e351f8d.tar.xz
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.
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c6
1 files changed, 6 insertions, 0 deletions
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,