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

Michael Niedermayer michaelni at gmx.at
Mon Jul 9 04:30:19 CEST 2012


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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120709/779e5179/attachment.asc>


More information about the ffmpeg-devel mailing list