diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-12-08 16:18:23 +0400 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2012-12-10 02:01:00 +0400 |
commit | cef28b56027c3c9ca2359a50741fc5312d627ef8 (patch) | |
tree | c8dd1fe2b4f5397793841e0a4fca4fb72180fb7d /libavcodec/tak_parser.c | |
parent | 461b5bf4abf70f8b8baba01812682c77512d079c (diff) |
tak: reduce difference with qatar
Mostly cosmetics changes, but also makes
decoding little faster here.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/tak_parser.c')
-rw-r--r-- | libavcodec/tak_parser.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/libavcodec/tak_parser.c b/libavcodec/tak_parser.c index 94609f00ba..0f2fbc2b35 100644 --- a/libavcodec/tak_parser.c +++ b/libavcodec/tak_parser.c @@ -24,8 +24,8 @@ * TAK parser **/ -#include "parser.h" #include "tak.h" +#include "parser.h" typedef struct TAKParseContext { ParseContext pc; @@ -44,18 +44,18 @@ static int tak_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size) { TAKParseContext *t = s->priv_data; - ParseContext *pc = &t->pc; - int next = END_NOT_FOUND; + ParseContext *pc = &t->pc; + int next = END_NOT_FOUND; GetBitContext gb; int consumed = 0; - int needed = buf_size ? TAK_MAX_FRAME_HEADER_BYTES : 8; + 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)) - s->duration = t->ti.last_frame_samples ? t->ti.last_frame_samples : - t->ti.frame_samples; + s->duration = t->ti.last_frame_samples ? t->ti.last_frame_samples + : t->ti.frame_samples; *poutbuf = buf; *poutbuf_size = buf_size; return buf_size; @@ -63,7 +63,8 @@ static int tak_parse(AVCodecParserContext *s, AVCodecContext *avctx, while (buf_size || t->index + needed <= pc->index) { if (buf_size && t->index + TAK_MAX_FRAME_HEADER_BYTES > pc->index) { - int tmp_buf_size = FFMIN(2 * TAK_MAX_FRAME_HEADER_BYTES, buf_size); + int tmp_buf_size = FFMIN(2 * TAK_MAX_FRAME_HEADER_BYTES, + buf_size); const uint8_t *tmp_buf = buf; if (ff_combine_frame(pc, END_NOT_FOUND, &tmp_buf, &tmp_buf_size) != -1) @@ -86,13 +87,13 @@ static int tak_parse(AVCodecParserContext *s, AVCodecContext *avctx, get_bits_count(&gb) / 8)) { if (!pc->frame_start_found) { pc->frame_start_found = 1; - s->duration = t->ti.last_frame_samples ? - t->ti.last_frame_samples : - t->ti.frame_samples; + s->duration = t->ti.last_frame_samples ? + t->ti.last_frame_samples : + t->ti.frame_samples; } else { pc->frame_start_found = 0; - next = t->index - pc->index; - t->index = 0; + next = t->index - pc->index; + t->index = 0; goto found; } } @@ -109,7 +110,7 @@ found: } if (next != END_NOT_FOUND) { - next += consumed; + next += consumed; pc->overread = FFMAX(0, -next); } |