[Mplayer-cvslog] CVS: 0_90/libmpdemux demux_gif.c,1.3,1.4

Arpi of Ize arpi at mplayerhq.hu
Fri Feb 21 20:45:40 CET 2003


Update of /cvsroot/mplayer/0_90/libmpdemux
In directory mail:/var/tmp.root/cvs-serv9042/libmpdemux

Modified Files:
	demux_gif.c 
Log Message:
adds an extra check to configure that looks for advanced functionality preferred
by demux_gif.  If no such function is found, then a workaround is enabled.
patch by Joey Parrish <joey at nicewarrior.org>


Index: demux_gif.c
===================================================================
RCS file: /cvsroot/mplayer/0_90/libmpdemux/demux_gif.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- demux_gif.c	8 Feb 2003 17:29:43 -0000	1.3
+++ demux_gif.c	21 Feb 2003 19:45:36 -0000	1.4
@@ -24,9 +24,12 @@
 
 #define GIF_SIGNATURE (('G' << 16) | ('I' << 8) | 'F')
 
+#ifndef HAVE_GIF_TVT_HACK
+// not supported by certain versions of the library
 int my_read_gif(GifFileType *gif, uint8_t *buf, int len) {
   return stream_read(gif->UserData, buf, len);
 }
+#endif
   
 int gif_check_file(demuxer_t *demuxer)
 {
@@ -156,7 +159,17 @@
   // go back to the beginning
   stream_seek(demuxer->stream,demuxer->stream->start_pos);
 
+#ifdef HAVE_GIF_TVT_HACK
+  // without the TVT functionality of libungif, a hard seek must be
+  // done to the beginning of the file.  this is because libgif is
+  // unable to use mplayer's cache, and without this lseek libgif will
+  // not read from the beginning of the file and the command will fail.
+  // with this hack enabled, you will lose the ability to stream a GIF.
+  lseek(demuxer->stream->fd, 0, SEEK_SET);
+  gif = DGifOpenFileHandle(demuxer->stream->fd);
+#else
   gif = DGifOpen(demuxer->stream, my_read_gif);
+#endif
   if (!gif) {
     PrintGifError();
     return NULL;



More information about the MPlayer-cvslog mailing list