summaryrefslogtreecommitdiff
path: root/libavcodec/tscc.c
diff options
context:
space:
mode:
authorRonald Bultje <rsbultje@gmail.com>2012-03-31 17:10:54 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2012-04-11 16:30:41 -0400
commit992f71e95dcf57c917531f126ba7499ef9ed87d3 (patch)
tree86b87901df13fd4a3df9eb668079e92653c4f28e /libavcodec/tscc.c
parent729f90e26802057f06905ab15a34612168eeac80 (diff)
msrle: convert MS RLE decoding function to bytestream2.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
Diffstat (limited to 'libavcodec/tscc.c')
-rw-r--r--libavcodec/tscc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
index 3e3073d3cd..c1c6eb4e60 100644
--- a/libavcodec/tscc.c
+++ b/libavcodec/tscc.c
@@ -58,6 +58,7 @@ typedef struct TsccContext {
unsigned int decomp_size;
// Decompression buffer
unsigned char* decomp_buf;
+ GetByteContext gb;
int height;
z_stream zstream;
@@ -105,8 +106,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
}
- if(zret != Z_DATA_ERROR)
- ff_msrle_decode(avctx, (AVPicture*)&c->pic, c->bpp, c->decomp_buf, c->decomp_size - c->zstream.avail_out);
+ if (zret != Z_DATA_ERROR) {
+ bytestream2_init(&c->gb, c->decomp_buf,
+ c->decomp_size - c->zstream.avail_out);
+ ff_msrle_decode(avctx, (AVPicture*)&c->pic, c->bpp, &c->gb);
+ }
/* make the palette available on the way out */
if (c->avctx->pix_fmt == PIX_FMT_PAL8) {