summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorDavid Conrad <lessen42@gmail.com>2009-05-11 04:34:23 +0000
committerDavid Conrad <lessen42@gmail.com>2009-05-11 04:34:23 +0000
commit580a7465fb416782a1d5ad95011351b9c257f0de (patch)
treef26ec625283620ebc2c6df689bd6cbffba0d6cc8 /libavcodec/mpeg12.c
parent014b7ecb6643332af35251c751aebd04bac4bb1e (diff)
Add a chroma_sample_location field to define positioning of chroma samples
Originally committed as revision 18795 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index e6e4ddcfc9..d9157806cb 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1189,6 +1189,10 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx)
s->repeat_field = 0;
s->mpeg_enc_ctx.codec_id= avctx->codec->id;
avctx->color_range= AVCOL_RANGE_MPEG;
+ if (avctx->codec->id == CODEC_ID_MPEG1VIDEO)
+ avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
+ else
+ avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
return 0;
}