Browse Source

avcodec/lzw: ff_lzw_decode_tail() now returns the consumed bytes in lzw decompress

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.0
Ni Hui Michael Niedermayer 9 years ago
parent
commit
c75640e9c9
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      libavcodec/lzw.c
  2. +1
    -1
      libavcodec/lzw.h

+ 2
- 1
libavcodec/lzw.c View File

@@ -93,7 +93,7 @@ static int lzw_get_code(struct LZWState * s)
return c & s->curmask; return c & s->curmask;
} }


void ff_lzw_decode_tail(LZWState *p)
int ff_lzw_decode_tail(LZWState *p)
{ {
struct LZWState *s = (struct LZWState *)p; struct LZWState *s = (struct LZWState *)p;


@@ -104,6 +104,7 @@ void ff_lzw_decode_tail(LZWState *p)
} }
}else }else
bytestream2_skip(&s->gb, bytestream2_get_bytes_left(&s->gb)); bytestream2_skip(&s->gb, bytestream2_get_bytes_left(&s->gb));
return bytestream2_tell(&s->gb);
} }


av_cold void ff_lzw_decode_open(LZWState **p) av_cold void ff_lzw_decode_open(LZWState **p)


+ 1
- 1
libavcodec/lzw.h View File

@@ -47,7 +47,7 @@ void ff_lzw_decode_open(LZWState **p);
void ff_lzw_decode_close(LZWState **p); void ff_lzw_decode_close(LZWState **p);
int ff_lzw_decode_init(LZWState *s, int csize, const uint8_t *buf, int buf_size, int mode); int ff_lzw_decode_init(LZWState *s, int csize, const uint8_t *buf, int buf_size, int mode);
int ff_lzw_decode(LZWState *s, uint8_t *buf, int len); int ff_lzw_decode(LZWState *s, uint8_t *buf, int len);
void ff_lzw_decode_tail(LZWState *lzw);
int ff_lzw_decode_tail(LZWState *lzw);


/** LZW encode state */ /** LZW encode state */
struct LZWEncodeState; struct LZWEncodeState;


Loading…
Cancel
Save