diff options
author | Alexandra Hájková <alexandra@khirnov.net> | 2016-04-13 21:00:34 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2017-01-25 11:06:58 +0100 |
commit | 381a4e31a6b801a046e38b0e2b08fb61499157a7 (patch) | |
tree | 4f5dd5f494063f79c2ccb6630ee1e481de725879 /libavcodec/tak_parser.c | |
parent | 2e0e150144d6c8fe641a45141638559fbf4d9642 (diff) | |
download | ffmpeg-streaming-381a4e31a6b801a046e38b0e2b08fb61499157a7.zip ffmpeg-streaming-381a4e31a6b801a046e38b0e2b08fb61499157a7.tar.gz |
tak: Convert to the new bitstream reader
Diffstat (limited to 'libavcodec/tak_parser.c')
-rw-r--r-- | libavcodec/tak_parser.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libavcodec/tak_parser.c b/libavcodec/tak_parser.c index 9ac1deb..82fb7e8 100644 --- a/libavcodec/tak_parser.c +++ b/libavcodec/tak_parser.c @@ -25,6 +25,7 @@ **/ #define BITSTREAM_READER_LE +#include "bitstream.h" #include "parser.h" #include "tak.h" @@ -47,14 +48,14 @@ static int tak_parse(AVCodecParserContext *s, AVCodecContext *avctx, TAKParseContext *t = s->priv_data; ParseContext *pc = &t->pc; int next = END_NOT_FOUND; - GetBitContext gb; + BitstreamContext bc; int consumed = 0; int needed = buf_size ? TAK_MAX_FRAME_HEADER_BYTES : 8; if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) { TAKStreamInfo ti; - init_get_bits(&gb, buf, buf_size); - if (!ff_tak_decode_frame_header(avctx, &gb, &ti, 127)) + bitstream_init(&bc, buf, buf_size); + if (!ff_tak_decode_frame_header(avctx, &bc, &ti, 127)) s->duration = t->ti.last_frame_samples ? t->ti.last_frame_samples : t->ti.frame_samples; *poutbuf = buf; @@ -79,14 +80,14 @@ static int tak_parse(AVCodecParserContext *s, AVCodecContext *avctx, pc->buffer[t->index + 1] == 0xA0) { TAKStreamInfo ti; - init_get_bits(&gb, pc->buffer + t->index, - 8 * (pc->index - t->index)); - if (!ff_tak_decode_frame_header(avctx, &gb, + bitstream_init8(&bc, pc->buffer + t->index, + pc->index - t->index); + if (!ff_tak_decode_frame_header(avctx, &bc, pc->frame_start_found ? &ti : &t->ti, 127) && !ff_tak_check_crc(pc->buffer + t->index, - get_bits_count(&gb) / 8)) { + bitstream_tell(&bc) / 8)) { if (!pc->frame_start_found) { pc->frame_start_found = 1; s->duration = t->ti.last_frame_samples ? |