changeset 21892:cf67d7115d99

Implement refmode == 2 in gif demuxer
author reimar
date Sat, 13 Jan 2007 12:37:53 +0000
parents d718eeaf06ea
children 4a83d090520c
files libmpdemux/demux_gif.c
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_gif.c	Sat Jan 13 12:19:42 2007 +0000
+++ b/libmpdemux/demux_gif.c	Sat Jan 13 12:37:53 2007 +0000
@@ -145,15 +145,19 @@
     }
 
     memcpy_pic(dest, buf, w, h, priv->w, gif->Image.Width);
+
+  priv->useref = 1;
+  if (refmode == 1) memcpy(priv->refimg, dp->buffer, priv->w * priv->h);
+    if (refmode == 2 && priv->useref) {
+      dest = priv->refimg + priv->w * t + l;
+      memset(buf, gif->SBackGroundColor, len);
+      memcpy_pic(dest, buf, w, h, priv->w, gif->Image.Width);
+    }
+  if (!refmode) priv->useref = 0;
   }
 
   free(buf);
 
-  priv->useref = 1;
-  if (refmode == 1) memcpy(priv->refimg, dp->buffer, priv->w * priv->h);
-  // TODO: refmode == 2, set area of current image to background color
-  if (!refmode) priv->useref = 0;
-
   demuxer->video->dpos++;
   dp->pts = ((float)priv->current_pts) / 100;
   dp->pos = stream_tell(demuxer->stream);