summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
diff options
context:
space:
mode:
authorcantabile <cantabile.desu@gmail.com>2012-08-21 00:03:59 +0300
committerwm4 <wm4@nowhere>2012-08-21 18:17:41 +0200
commita1380f394597e06e04195b1812300550f3c2df40 (patch)
treedb2303737c451586f1f427e0f3b562f1c7f0dade /libmpcodecs/vd_ffmpeg.c
parent27262dec1be623618a2e55ab1dbc35371e0ec758 (diff)
downloadmpv-a1380f394597e06e04195b1812300550f3c2df40.tar.bz2
mpv-a1380f394597e06e04195b1812300550f3c2df40.tar.xz
video: honor the video's colormatrix and color range flags
If either of them is not defined, the old behavior is used: - the colormatrix is guessed based on resolution. - the color range is assumed to be tv aka limited range.
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r--libmpcodecs/vd_ffmpeg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index b30648b6f6..b2150579ea 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -42,6 +42,7 @@
#include "libmpdemux/demux_packet.h"
#include "codec-cfg.h"
#include "osdep/numcores.h"
+#include "libvo/csputils.h"
static const vd_info_t info = {
"libavcodec video codecs",
@@ -463,6 +464,10 @@ static int init_vo(sh_video_t *sh, enum PixelFormat pix_fmt)
};
else
supported_fmts = (const unsigned int[]){ctx->best_csp, 0xffffffff};
+
+ sh->colorspace = avcol_spc_to_mp_csp(avctx->colorspace);
+ sh->color_range = avcol_range_to_mp_csp_levels(avctx->color_range);
+
if (!mpcodecs_config_vo2(sh, sh->disp_w, sh->disp_h, supported_fmts,
ctx->best_csp))
return -1;