diff options
author | Ronald Bultje <rsbultje@gmail.com> | 2012-03-31 17:10:54 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-04-11 16:30:41 -0400 |
commit | 992f71e95dcf57c917531f126ba7499ef9ed87d3 (patch) | |
tree | 86b87901df13fd4a3df9eb668079e92653c4f28e /libavcodec/aasc.c | |
parent | 729f90e26802057f06905ab15a34612168eeac80 (diff) | |
download | ffmpeg-992f71e95dcf57c917531f126ba7499ef9ed87d3.tar.gz |
msrle: convert MS RLE decoding function to bytestream2.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
Diffstat (limited to 'libavcodec/aasc.c')
-rw-r--r-- | libavcodec/aasc.c | 12 |
1 files changed, 3 insertions, 9 deletions
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); |