- if (!mp->in_sync) {
- // Not in sync - find a major sync header
-
- for (i = 0; i < buf_size; i++) {
- mp->pc.state = (mp->pc.state << 8) | buf[i];
- if ((mp->pc.state & 0xfffffffe) == 0xf8726fba &&
- // ignore if we do not have the data for the start of header
- mp->pc.index + i >= 7) {
- mp->in_sync = 1;
- mp->bytes_left = 0;
- break;
+ if (s->flags & PARSER_FLAG_COMPLETE_FRAMES) {
+ next = buf_size;
+ } else {
+ if (!mp->in_sync) {
+ // Not in sync - find a major sync header
+
+ for (i = 0; i < buf_size; i++) {
+ mp->pc.state = (mp->pc.state << 8) | buf[i];
+ if ((mp->pc.state & 0xfffffffe) == 0xf8726fba &&
+ // ignore if we do not have the data for the start of header
+ mp->pc.index + i >= 7) {
+ mp->in_sync = 1;
+ mp->bytes_left = 0;
+ break;
+ }