[FFmpeg-devel] [PATCH] exr: support for reading pixelAspectRatio

Paul B Mahol onemda at gmail.com
Mon Jul 9 03:50:13 CEST 2012


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavcodec/exr.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index f5a3ff9..e0794ec 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -305,6 +305,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(1.0/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)
-- 
1.7.7



More information about the ffmpeg-devel mailing list