Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-08 17:45:19 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-08-08 17:45:19 +0400
commit420f63984b39dbc847295126ee2e701df068dd53 (patch)
tree86789ed659d3d38b5bccff46bc62d6fe0927800a
parent91437631d76f8ba966c370df56795bf1cf2045ad (diff)
parent8cd67ddde46a42a33149e7d42a2ab47852ff2a83 (diff)
Merge commit '8cd67ddde46a42a33149e7d42a2ab47852ff2a83' into release/1.1
* commit '8cd67ddde46a42a33149e7d42a2ab47852ff2a83': cdgraphics: switch to bytestream2 Conflicts: libavcodec/cdgraphics.c See: ad002e1a13a8df934bd6cb2c84175a4780ab8942 Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/cdgraphics.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c
index 218d68a11c..25ed1bf3b7 100644
--- a/libavcodec/cdgraphics.c
+++ b/libavcodec/cdgraphics.c
@@ -269,7 +269,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;
@@ -286,19 +286,19 @@ static int cdg_decode_frame(AVCodecContext *avctx,
return AVERROR(EINVAL);
}
+ bytestream2_init(&gb, avpkt->data, avpkt->size);
+
ret = avctx->reget_buffer(avctx, &cc->frame);
if (ret) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return ret;
}
- 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) {