summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-10-16 14:37:28 +0200
committerwm4 <wm4@nowhere>2017-10-16 15:02:12 +0200
commitac295960b8486f104a6aa800d8d31ca2eeba99a0 (patch)
treecfe27fa57e2939810f8ae3b765b86c2b63a3dd45 /video
parent23da3ed21a3897c374e01e68988e7dc24b705cfa (diff)
downloadmpv-ac295960b8486f104a6aa800d8d31ca2eeba99a0.tar.bz2
mpv-ac295960b8486f104a6aa800d8d31ca2eeba99a0.tar.xz
video: make it possible to always override hardware decoding format
Mostly an obscure option for testing. But --videotoolbox-format can be deprecated, as it becomes redundant. We rely on the libavutil hwcontext implementation to reject invalid pixfmts, or not to blow up if they are incompatible.
Diffstat (limited to 'video')
-rw-r--r--video/decode/vd_lavc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index fe0de0e43f..f036a630b5 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -807,6 +807,8 @@ static int init_generic_hwaccel(struct dec_video *vd)
if (hwdec->image_format == IMGFMT_VIDEOTOOLBOX)
av_sw_format = imgfmt2pixfmt(vd->opts->videotoolbox_format);
+ if (vd->opts->hwdec_image_format)
+ av_sw_format = imgfmt2pixfmt(vd->opts->hwdec_image_format);
if (av_sw_format == AV_PIX_FMT_NONE) {
MP_VERBOSE(ctx, "Unsupported hw decoding format: %s\n",