From 992f71e95dcf57c917531f126ba7499ef9ed87d3 Mon Sep 17 00:00:00 2001 From: Ronald Bultje Date: Sat, 31 Mar 2012 17:10:54 +0000 Subject: msrle: convert MS RLE decoding function to bytestream2. Signed-off-by: Justin Ruggles --- libavcodec/aasc.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'libavcodec/aasc.c') diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c index 3cec079a34..edca24c08a 100644 --- a/libavcodec/aasc.c +++ b/libavcodec/aasc.c @@ -34,17 +34,10 @@ typedef struct AascContext { AVCodecContext *avctx; + GetByteContext gb; AVFrame frame; } AascContext; -#define FETCH_NEXT_STREAM_BYTE() \ - if (stream_ptr >= buf_size) \ - { \ - av_log(s->avctx, AV_LOG_ERROR, " AASC: stream ptr just went out of bounds (fetch)\n"); \ - break; \ - } \ - stream_byte = buf[stream_ptr++]; - static av_cold int aasc_decode_init(AVCodecContext *avctx) { AascContext *s = avctx->priv_data; @@ -84,7 +77,8 @@ static int aasc_decode_frame(AVCodecContext *avctx, } break; case 1: - ff_msrle_decode(avctx, (AVPicture*)&s->frame, 8, buf - 4, buf_size + 4); + bytestream2_init(&s->gb, buf - 4, buf_size + 4); + ff_msrle_decode(avctx, (AVPicture*)&s->frame, 8, &s->gb); break; default: av_log(avctx, AV_LOG_ERROR, "Unknown compression type %d\n", compr); -- cgit v1.2.3