[FFmpeg-devel] [PATCH] gifdec: read pixel aspect ratio

Paul B Mahol onemda at gmail.com
Sat Dec 1 21:59:03 CET 2012


On 12/1/12, Reimar Doeffinger <Reimar.Doeffinger at gmx.de> wrote:
> On Sat, Dec 01, 2012 at 12:37:54PM +0000, Paul B Mahol wrote:
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>>  libavcodec/gifdec.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
>> index dd4bca2..3e3c9a5 100644
>> --- a/libavcodec/gifdec.c
>> +++ b/libavcodec/gifdec.c
>> @@ -387,7 +387,11 @@ static int gif_read_header1(GifState *s)
>>      s->has_global_palette = (v & 0x80);
>>      s->bits_per_pixel = (v & 0x07) + 1;
>>      background_color_index = bytestream_get_byte(&s->bytestream);
>> -    bytestream_get_byte(&s->bytestream);                /* ignored */
>> +    n = bytestream_get_byte(&s->bytestream);
>> +    if (n) {
>> +        s->avctx->sample_aspect_ratio.num = n + 15;
>> +        s->avctx->sample_aspect_ratio.den = 64;
>> +    }
>
> I think this fraction should be reduced?
> At least I seem to remember that we generally promise that fractions are
> reduced.

It is reduced when needed.


More information about the ffmpeg-devel mailing list