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

Paul B Mahol onemda at gmail.com
Mon Jul 9 04:52:17 CEST 2012


On 7/9/12, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Mon, Jul 09, 2012 at 01:50:13AM +0000, Paul B Mahol wrote:
>> 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;
>> +        }
>> +
>
> LGTM from a quick & tired look

Pushed with (nonsense) division removed.


More information about the ffmpeg-devel mailing list