aboutsummaryrefslogtreecommitdiff
path: root/libavcodec/exr.c
diff options
context:
space:
mode:
authorPaul B Mahol2012-07-09 00:51:22 +0000
committerPaul B Mahol2012-07-09 02:51:06 +0000
commit07df939aa32f723deaec80cbfd6526912ee52348 (patch)
tree8f73c85f87b0736d533b8d52bf2fc27381c6094c /libavcodec/exr.c
parent16a433d68b23cbd8c8b7ece0c4b150ef0066876b (diff)
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.c11
1 files changed, 11 insertions, 0 deletions
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)