From 5b7eb989f2fc85f5b1c2ee4951cbae750c1d6dd5 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 13 Jan 2007 12:37:53 +0000 Subject: Implement refmode == 2 in gif demuxer git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21910 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_gif.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'libmpdemux') diff --git a/libmpdemux/demux_gif.c b/libmpdemux/demux_gif.c index f287cf72ec..4c402b4076 100644 --- a/libmpdemux/demux_gif.c +++ b/libmpdemux/demux_gif.c @@ -145,14 +145,18 @@ static int demux_gif_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds) } memcpy_pic(dest, buf, w, h, priv->w, gif->Image.Width); - } - - 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 == 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); demuxer->video->dpos++; dp->pts = ((float)priv->current_pts) / 100; -- cgit v1.2.3