aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-01-19 15:53:32 -0300
committerJames Almer <jamrial@gmail.com>2018-01-29 23:09:23 -0300
commitede6e7494f61927d20216cdbc6f85cfba2341654 (patch)
tree73c4739eb1d71b5e3b6534b95323ef175e5707e6
parent55ebf707d0abf720a2b02fc5ebc47eb742bfbe99 (diff)
downloadffmpeg-ede6e7494f61927d20216cdbc6f85cfba2341654.tar.gz
avcodec/mlp_parser: reindent after last commit
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/mlp_parser.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index 4827354f18..185bd4d667 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -259,65 +259,65 @@ static int mlp_parse(AVCodecParserContext *s,
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;
+ 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 (!mp->in_sync) {
- if (ff_combine_frame(&mp->pc, END_NOT_FOUND, &buf, &buf_size) != -1)
+ if (!mp->in_sync) {
+ if (ff_combine_frame(&mp->pc, END_NOT_FOUND, &buf, &buf_size) != -1)
+ av_log(avctx, AV_LOG_WARNING, "ff_combine_frame failed\n");
+ return buf_size;
+ }
+
+ if ((ret = ff_combine_frame(&mp->pc, i - 7, &buf, &buf_size)) < 0) {
av_log(avctx, AV_LOG_WARNING, "ff_combine_frame failed\n");
- return buf_size;
- }
+ return ret;
+ }
- if ((ret = ff_combine_frame(&mp->pc, i - 7, &buf, &buf_size)) < 0) {
- av_log(avctx, AV_LOG_WARNING, "ff_combine_frame failed\n");
- return ret;
+ return i - 7;
}
- return i - 7;
- }
+ if (mp->bytes_left == 0) {
+ // Find length of this packet
- if (mp->bytes_left == 0) {
- // Find length of this packet
-
- /* Copy overread bytes from last frame into buffer. */
- for(; mp->pc.overread>0; mp->pc.overread--) {
- mp->pc.buffer[mp->pc.index++]= mp->pc.buffer[mp->pc.overread_index++];
- }
+ /* Copy overread bytes from last frame into buffer. */
+ for(; mp->pc.overread>0; mp->pc.overread--) {
+ mp->pc.buffer[mp->pc.index++]= mp->pc.buffer[mp->pc.overread_index++];
+ }
- if (mp->pc.index + buf_size < 2) {
- if (ff_combine_frame(&mp->pc, END_NOT_FOUND, &buf, &buf_size) != -1)
- av_log(avctx, AV_LOG_WARNING, "ff_combine_frame failed\n");
- return buf_size;
- }
+ if (mp->pc.index + buf_size < 2) {
+ if (ff_combine_frame(&mp->pc, END_NOT_FOUND, &buf, &buf_size) != -1)
+ av_log(avctx, AV_LOG_WARNING, "ff_combine_frame failed\n");
+ return buf_size;
+ }
- mp->bytes_left = ((mp->pc.index > 0 ? mp->pc.buffer[0] : buf[0]) << 8)
- | (mp->pc.index > 1 ? mp->pc.buffer[1] : buf[1-mp->pc.index]);
- mp->bytes_left = (mp->bytes_left & 0xfff) * 2;
- if (mp->bytes_left <= 0) { // prevent infinite loop
- goto lost_sync;
+ mp->bytes_left = ((mp->pc.index > 0 ? mp->pc.buffer[0] : buf[0]) << 8)
+ | (mp->pc.index > 1 ? mp->pc.buffer[1] : buf[1-mp->pc.index]);
+ mp->bytes_left = (mp->bytes_left & 0xfff) * 2;
+ if (mp->bytes_left <= 0) { // prevent infinite loop
+ goto lost_sync;
+ }
+ mp->bytes_left -= mp->pc.index;
}
- mp->bytes_left -= mp->pc.index;
- }
- next = (mp->bytes_left > buf_size) ? END_NOT_FOUND : mp->bytes_left;
+ next = (mp->bytes_left > buf_size) ? END_NOT_FOUND : mp->bytes_left;
- if (ff_combine_frame(&mp->pc, next, &buf, &buf_size) < 0) {
- mp->bytes_left -= buf_size;
- return buf_size;
- }
+ if (ff_combine_frame(&mp->pc, next, &buf, &buf_size) < 0) {
+ mp->bytes_left -= buf_size;
+ return buf_size;
+ }
- mp->bytes_left = 0;
+ mp->bytes_left = 0;
}
sync_present = (AV_RB32(buf + 4) & 0xfffffffe) == 0xf8726fba;