[FFmpeg-cvslog] Always write all colours for animated gif files, including transparent ones .

Carl Eugen Hoyos git at videolan.org
Thu Dec 20 23:09:18 CET 2012


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu Dec 20 23:05:42 2012 +0100| [d4fdaafdb76a927be6fea15013807641bbcc6bd9] | committer: Carl Eugen Hoyos

Always write all colours for animated gif files, including transparent ones.

This fixes the colour of the transparent background (as seen with ffplay),
and makes the background of some non-keyframes transparent that was
incorrectly shown as opaque for some samples.

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

 libavcodec/gifdec.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index 9a3aef0..077aef0 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -241,8 +241,9 @@ static int gif_read_image(GifState *s)
         pr = ptr + width;
 
         for (px = ptr, idx = s->idx_line; px < pr; px++, idx++) {
-            if (*idx != s->transparent_color_index)
-                *px = pal[*idx];
+            *px = pal[*idx];
+            if (*idx == s->transparent_color_index)
+                *px &= 0xFFFFFF;
         }
 
         if (is_interleaved) {



More information about the ffmpeg-cvslog mailing list