summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-05-05 19:53:49 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-05-05 19:53:49 +0000
commit9c24cd72363f14b303c6039413ed8eacc36c6653 (patch)
treec5ea2a7ab857600c1899441548202b7f49231d00 /libavcodec/mpeg12.c
parent1e24f1b25d08659f84a9c8fbb2789d3469daa0b9 (diff)
Extract colorspace fields from MPEG1/2.
Originally committed as revision 18747 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 019dc81085..e6e4ddcfc9 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1188,6 +1188,7 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx)
s->mpeg_enc_ctx.picture_number = 0;
s->repeat_field = 0;
s->mpeg_enc_ctx.codec_id= avctx->codec->id;
+ avctx->color_range= AVCOL_RANGE_MPEG;
return 0;
}
@@ -1420,9 +1421,9 @@ static void mpeg_decode_sequence_display_extension(Mpeg1Context *s1)
skip_bits(&s->gb, 3); /* video format */
color_description= get_bits1(&s->gb);
if(color_description){
- skip_bits(&s->gb, 8); /* color primaries */
- skip_bits(&s->gb, 8); /* transfer_characteristics */
- skip_bits(&s->gb, 8); /* matrix_coefficients */
+ s->avctx->color_primaries= get_bits(&s->gb, 8);
+ s->avctx->color_trc = get_bits(&s->gb, 8);
+ s->avctx->colorspace = get_bits(&s->gb, 8);
}
w= get_bits(&s->gb, 14);
skip_bits(&s->gb, 1); //marker