Commit 7a88b7a9 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '1f3e56b6'

* commit '1f3e56b6':
  gifdec: convert to bytestream2

Conflicts:
	libavcodec/gifdec.c
	libavcodec/lzw.c
	libavcodec/lzw.h

See: 3fd60d80Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 564ae836 1f3e56b6
...@@ -64,7 +64,6 @@ typedef struct GifState { ...@@ -64,7 +64,6 @@ typedef struct GifState {
int stored_bg_color; int stored_bg_color;
GetByteContext gb; GetByteContext gb;
/* LZW compatible decoder */
LZWState *lzw; LZWState *lzw;
/* aux buffers */ /* aux buffers */
...@@ -404,7 +403,7 @@ static int gif_read_header1(GifState *s) ...@@ -404,7 +403,7 @@ static int gif_read_header1(GifState *s)
static int gif_parse_next_image(GifState *s, AVFrame *frame) static int gif_parse_next_image(GifState *s, AVFrame *frame)
{ {
while (bytestream2_get_bytes_left(&s->gb)) { while (bytestream2_get_bytes_left(&s->gb) > 0) {
int code = bytestream2_get_byte(&s->gb); int code = bytestream2_get_byte(&s->gb);
int ret; int ret;
...@@ -502,7 +501,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A ...@@ -502,7 +501,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
return ret; return ret;
*got_frame = 1; *got_frame = 1;
return avpkt->size; return bytestream2_tell(&s->gb);
} }
static av_cold int gif_decode_close(AVCodecContext *avctx) static av_cold int gif_decode_close(AVCodecContext *avctx)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment