Mercurial > mplayer.hg
changeset 9344:bd7b5078475e
1) codecs.conf changed recently and demux_gif no longer needs to spit
out BGR8 upside-down. the workaround for this is removed.
2) fixes a bug so that streaming gifs now works, and removes a
workaround no longer needed. now libgif uses mplayer's stream_read
function and thus http streaming, etc, works with demux_gif.
3) cosmetic clean-up because i no longer plan to support certain GIF
extensions that would be more difficult to implement.
patch by Joey Parrish <joey@nicewarrior.org>
author | arpi |
---|---|
date | Sat, 08 Feb 2003 15:49:03 +0000 |
parents | 5ac2ce9c0462 |
children | fef4f1a9de5e |
files | libmpdemux/demux_gif.c |
diffstat | 1 files changed, 7 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_gif.c Sat Feb 08 13:47:19 2003 +0000 +++ b/libmpdemux/demux_gif.c Sat Feb 08 15:49:03 2003 +0000 @@ -24,10 +24,12 @@ #define GIF_SIGNATURE (('G' << 16) | ('I' << 8) | 'F') +int my_read_gif(GifFileType *gif, uint8_t *buf, int len) { + return stream_read(gif->UserData, buf, len); +} + int gif_check_file(demuxer_t *demuxer) { - stream_reset(demuxer->stream); - stream_seek(demuxer->stream, 0); if (stream_read_int24(demuxer->stream) == GIF_SIGNATURE) return 1; return 0; @@ -82,9 +84,6 @@ } } printf("\n"); - // FIXME support these: - } else if (code == 0x01) { // plaintext extension - } else if (code == 0xFF) { // application extension } while (p != NULL) { if (DGifGetExtensionNext(gif, &p) == GIF_ERROR) { @@ -127,8 +126,7 @@ for (y = 0; y < gif->Image.Height; y++) { unsigned char *drow = dp->buffer; - int x = gif->Image.Height - y - 1; // BGR8 is flipped - unsigned char *gbuf = buf + (x * gif->Image.Width); + unsigned char *gbuf = buf + (y * gif->Image.Width); drow += gif->Image.Width * (y + gif->Image.Top); drow += gif->Image.Left; @@ -156,11 +154,9 @@ demuxer->seekable = 0; // FIXME // go back to the beginning - stream_reset(demuxer->stream); - stream_seek(demuxer->stream, 0); - lseek(demuxer->stream->fd, 0, SEEK_SET); + stream_seek(stream,stream->start_pos); - gif = DGifOpenFileHandle(demuxer->stream->fd); + gif = DGifOpen(demuxer->stream, my_read_gif); if (!gif) { PrintGifError(); return NULL;