[FFmpeg-cvslog] avcodec/lzw: ff_lzw_decode_tail() now returns the consumed bytes in lzw decompress

Ni Hui git at videolan.org
Tue Nov 10 23:24:26 CET 2015


ffmpeg | branch: master | Ni Hui <shuizhuyuanluo at 126.com> | Tue Nov 10 22:03:36 2015 +0800| [c75640e9c9e1d4fb6f043ec5f8fc16bc06a885df] | committer: Michael Niedermayer

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

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c75640e9c9e1d4fb6f043ec5f8fc16bc06a885df
---

 libavcodec/lzw.c |    3 ++-
 libavcodec/lzw.h |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/lzw.c b/libavcodec/lzw.c
index 6832c12..b0b9a34 100644
--- a/libavcodec/lzw.c
+++ b/libavcodec/lzw.c
@@ -93,7 +93,7 @@ static int lzw_get_code(struct LZWState * s)
     return c & s->curmask;
 }
 
-void ff_lzw_decode_tail(LZWState *p)
+int ff_lzw_decode_tail(LZWState *p)
 {
     struct LZWState *s = (struct LZWState *)p;
 
@@ -104,6 +104,7 @@ void ff_lzw_decode_tail(LZWState *p)
         }
     }else
         bytestream2_skip(&s->gb, bytestream2_get_bytes_left(&s->gb));
+    return bytestream2_tell(&s->gb);
 }
 
 av_cold void ff_lzw_decode_open(LZWState **p)
diff --git a/libavcodec/lzw.h b/libavcodec/lzw.h
index 4653c1c..6af8a6b 100644
--- a/libavcodec/lzw.h
+++ b/libavcodec/lzw.h
@@ -47,7 +47,7 @@ void ff_lzw_decode_open(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(LZWState *s, uint8_t *buf, int len);
-void ff_lzw_decode_tail(LZWState *lzw);
+int ff_lzw_decode_tail(LZWState *lzw);
 
 /** LZW encode state */
 struct LZWEncodeState;



More information about the ffmpeg-cvslog mailing list