From: Andre Date: Wed, 10 May 2006 17:19:12 +0000 (+0200) Subject: ignore zero bit when checking for frame start X-Git-Tag: v0.2.14~142 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=f94f6caa5b4053a3a205329f48bbb49c390c409a;p=paraslash.git ignore zero bit when checking for frame start --- diff --git a/aacdec.c b/aacdec.c index 3963bbc7..0eab773a 100644 --- a/aacdec.c +++ b/aacdec.c @@ -216,17 +216,13 @@ static ssize_t mp4dec(char *inbuffer, size_t len, struct filter_node *fn) if (padd->consumed_total < padd->offset[0]) padd->consumed = padd->offset[0] - padd->consumed_total; } - p = memchr(padd->inbuf + padd->consumed, 0x21, - padd->inbuf_len - padd->consumed); - if (!p) { - padd->consumed = padd->inbuf_len; + for (; padd->consumed < padd->inbuf_len; padd->consumed++) + if ((padd->inbuf[padd->consumed] & 0xfe) == 0x20) + break; + if (padd->consumed >= padd->inbuf_len) goto success; - } - if (p != padd->inbuf + padd->consumed) { - int skip = p - padd->inbuf + padd->consumed; - PARA_DEBUG_LOG("skipping %d bytes in inbuffer\n", skip); - padd->consumed += skip; - } + p = padd->inbuf + padd->consumed; +// PARA_NOTICE_LOG("p[0]: %lx\n", (long unsigned) *p); outbuffer = NeAACDecDecode(padd->decoder, &padd->frame_info, p, len - padd->consumed); ret = -E_AAC_DECODE;