diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-11 18:40:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-11 18:41:07 +0200 |
commit | 3301b248b0338ca53ad24ae77677bd733ed9d063 (patch) | |
tree | da1291d01d550fb8238e5550dc6b616d752df5a8 | |
parent | 7b67ce9ade01abcf0d5d08ada62011b43526a646 (diff) | |
parent | 5bf5a35fb5d452ea4b30cd7b853d92df6705d250 (diff) | |
download | ffmpeg-3301b248b0338ca53ad24ae77677bd733ed9d063.tar.gz |
Merge commit '5bf5a35fb5d452ea4b30cd7b853d92df6705d250' into release/2.2
* commit '5bf5a35fb5d452ea4b30cd7b853d92df6705d250':
cdgraphics: switch to bytestream2
Conflicts:
libavcodec/cdgraphics.c
See: ad002e1a13a8df934bd6cb2c84175a4780ab8942
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/cdgraphics.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index b7a8fa7ba2..69a2cb2f64 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -261,7 +261,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, static int cdg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { - const uint8_t *buf = avpkt->data; + GetByteContext gb; int buf_size = avpkt->size; int ret; uint8_t command, inst; @@ -278,6 +278,8 @@ static int cdg_decode_frame(AVCodecContext *avctx, return AVERROR(EINVAL); } + bytestream2_init(&gb, avpkt->data, avpkt->size); + if ((ret = ff_reget_buffer(avctx, cc->frame)) < 0) return ret; if (!avctx->frame_number) { @@ -285,13 +287,11 @@ static int cdg_decode_frame(AVCodecContext *avctx, memset(cc->frame->data[1], 0, AVPALETTE_SIZE); } - command = bytestream_get_byte(&buf); - inst = bytestream_get_byte(&buf); + command = bytestream2_get_byte(&gb); + inst = bytestream2_get_byte(&gb); inst &= CDG_MASK; - buf += 2; /// skipping 2 unneeded bytes - - if (buf_size > CDG_HEADER_SIZE) - bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE); + bytestream2_skip(&gb, 2); + bytestream2_get_buffer(&gb, cdg_data, sizeof(cdg_data)); if ((command & CDG_MASK) == CDG_COMMAND) { switch (inst) { |