From 07df939aa32f723deaec80cbfd6526912ee52348 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Mon, 9 Jul 2012 00:51:22 +0000 Subject: [PATCH] exr: support for reading pixelAspectRatio Signed-off-by: Paul B Mahol --- libavcodec/exr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 5ff2c6fc34..6388794b2b 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)