aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2009-11-22 21:08:46 +0000
committerDavid Conrad <lessen42@gmail.com>2009-11-22 21:08:46 +0000
commit6c2289b52e63dcab6d8d729b3a75e02df2c02f3e (patch)
treed8a830a206e9f57ac22ef79ffe995075fd64a9df /libavcodec
parentaf89b1781f781d1346d42280a573a8944501b11d (diff)
downloadffmpeg-6c2289b52e63dcab6d8d729b3a75e02df2c02f3e.tar.gz
Set colorspace for libtheora encoding
Originally committed as revision 20583 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/libtheoraenc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
index 024e81a4ee..b87e86f63c 100644
--- a/libavcodec/libtheoraenc.c
+++ b/libavcodec/libtheoraenc.c
@@ -168,7 +168,13 @@ static av_cold int encode_init(AVCodecContext* avc_context)
t_info.aspect_numerator = 1;
t_info.aspect_denominator = 1;
}
- t_info.colorspace = TH_CS_UNSPECIFIED;
+
+ if (avc_context->color_primaries == AVCOL_PRI_BT470M)
+ t_info.colorspace = TH_CS_ITU_REC_470M;
+ else if (avc_context->color_primaries == AVCOL_PRI_BT470BG)
+ t_info.colorspace = TH_CS_ITU_REC_470BG;
+ else
+ t_info.colorspace = TH_CS_UNSPECIFIED;
if (avc_context->pix_fmt == PIX_FMT_YUV420P)
t_info.pixel_fmt = TH_PF_420;