diff options
author | sebist <sebok.istvan@gmail.com> | 2012-04-17 09:36:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-17 19:36:15 +0200 |
commit | 7a3d2258a603fa177d688e4b661866bd8782c96c (patch) | |
tree | 977785512111ecd4c070566f327214db1aa471d6 /libavcodec/crystalhd.c | |
parent | e128182afd7ea32194dde837d024c5f0f8d8f6f3 (diff) | |
download | ffmpeg-7a3d2258a603fa177d688e4b661866bd8782c96c.tar.gz |
CrystalHD: Set aspect ratio.
Signed-off-by: sebist <sebok.istvan@gmail.com>
Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/crystalhd.c')
-rw-r--r-- | libavcodec/crystalhd.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index 2bae8f4881..9acb5122e8 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -741,6 +741,56 @@ static inline CopyRet receive_frame(AVCodecContext *avctx, av_log(avctx, AV_LOG_VERBOSE, "CrystalHD: Initial format change\n"); avctx->width = output.PicInfo.width; avctx->height = output.PicInfo.height; + switch ( output.PicInfo.aspect_ratio ) { + case vdecAspectRatioSquare: + avctx->sample_aspect_ratio = (AVRational) { 1, 1}; + break; + case vdecAspectRatio12_11: + avctx->sample_aspect_ratio = (AVRational) { 12, 11}; + break; + case vdecAspectRatio10_11: + avctx->sample_aspect_ratio = (AVRational) { 10, 11}; + break; + case vdecAspectRatio16_11: + avctx->sample_aspect_ratio = (AVRational) { 16, 11}; + break; + case vdecAspectRatio40_33: + avctx->sample_aspect_ratio = (AVRational) { 40, 33}; + break; + case vdecAspectRatio24_11: + avctx->sample_aspect_ratio = (AVRational) { 24, 11}; + break; + case vdecAspectRatio20_11: + avctx->sample_aspect_ratio = (AVRational) { 20, 11}; + break; + case vdecAspectRatio32_11: + avctx->sample_aspect_ratio = (AVRational) { 32, 11}; + break; + case vdecAspectRatio80_33: + avctx->sample_aspect_ratio = (AVRational) { 80, 33}; + break; + case vdecAspectRatio18_11: + avctx->sample_aspect_ratio = (AVRational) { 18, 11}; + break; + case vdecAspectRatio15_11: + avctx->sample_aspect_ratio = (AVRational) { 15, 11}; + break; + case vdecAspectRatio64_33: + avctx->sample_aspect_ratio = (AVRational) { 64, 33}; + break; + case vdecAspectRatio160_99: + avctx->sample_aspect_ratio = (AVRational) {160, 99}; + break; + case vdecAspectRatio4_3: + avctx->sample_aspect_ratio = (AVRational) { 4, 3}; + break; + case vdecAspectRatio16_9: + avctx->sample_aspect_ratio = (AVRational) { 16, 9}; + break; + case vdecAspectRatio221_1: + avctx->sample_aspect_ratio = (AVRational) {221, 1}; + break; + } return RET_COPY_AGAIN; } else if (ret == BC_STS_SUCCESS) { int copy_ret = -1; |