[FFmpeg-cvslog] gifdec: read pixel aspect ratio

Paul B Mahol git at videolan.org
Sun Dec 2 18:02:04 CET 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Dec  1 12:36:16 2012 +0000| [49435d3888bda5be392665c734bcbe6f09507546] | committer: Paul B Mahol

gifdec: read pixel aspect ratio

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49435d3888bda5be392665c734bcbe6f09507546
---

 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;
+    }
 
     av_dlog(s->avctx, "screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
            s->screen_width, s->screen_height, s->bits_per_pixel,



More information about the ffmpeg-cvslog mailing list