diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-07-09 00:51:22 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-07-09 02:51:06 +0000 |
commit | 07df939aa32f723deaec80cbfd6526912ee52348 (patch) | |
tree | 8f73c85f87b0736d533b8d52bf2fc27381c6094c /libavcodec/exr.c | |
parent | 16a433d68b23cbd8c8b7ece0c4b150ef0066876b (diff) | |
download | ffmpeg-streaming-07df939aa32f723deaec80cbfd6526912ee52348.zip ffmpeg-streaming-07df939aa32f723deaec80cbfd6526912ee52348.tar.gz |
exr: support for reading pixelAspectRatio
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/exr.c')
-rw-r--r-- | libavcodec/exr.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 5ff2c6f..6388794 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -300,6 +300,17 @@ static int decode_frame(AVCodecContext *avctx, continue; } + // Process the pixelAspectRatio variable + if (check_header_variable(avctx, &buf, buf_end, "pixelAspectRatio", "float", 31, &variable_buffer_data_size) >= 0) { + if (!variable_buffer_data_size) + return -1; + + avctx->sample_aspect_ratio = av_d2q(av_int2float(AV_RL32(buf)), 255); + + buf += variable_buffer_data_size; + continue; + } + // Process the compression variable if (check_header_variable(avctx, &buf, buf_end, "compression", "compression", 29, &variable_buffer_data_size) >= 0) { if (!variable_buffer_data_size) |