aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-05-17 00:30:19 +0200
committerJames Almer <jamrial@gmail.com>2019-07-16 16:18:10 -0300
commit6854127a76988e3aa3fafce3c01cb098f80f4bef (patch)
treebbc6b21bf84220e3f04882571ead38e8f3fa9053 /libavformat
parent71c908817ec6173afb9bfbae404c6ce824cd965c (diff)
downloadffmpeg-6854127a76988e3aa3fafce3c01cb098f80f4bef.tar.gz
avformat/matroskadec: Reindent after previous commit
Also use the smallest scope possible for a loop variable. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskadec.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 31bb6936eb..e78fd0016f 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1068,36 +1068,36 @@ static EbmlSyntax *ebml_parse_id(EbmlSyntax *syntax, uint32_t id)
static int ebml_parse_nest(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
void *data)
{
- int i, res;
+ int res;
if (data) {
- for (i = 0; syntax[i].id; i++)
- switch (syntax[i].type) {
- case EBML_UINT:
- *(uint64_t *) ((char *) data + syntax[i].data_offset) = syntax[i].def.u;
- break;
- case EBML_SINT:
- *(int64_t *) ((char *) data + syntax[i].data_offset) = syntax[i].def.i;
- break;
- case EBML_FLOAT:
- *(double *) ((char *) data + syntax[i].data_offset) = syntax[i].def.f;
- break;
- case EBML_STR:
- case EBML_UTF8:
- // the default may be NULL
- if (syntax[i].def.s) {
- uint8_t **dst = (uint8_t **) ((uint8_t *) data + syntax[i].data_offset);
- *dst = av_strdup(syntax[i].def.s);
- if (!*dst)
- return AVERROR(ENOMEM);
+ for (int i = 0; syntax[i].id; i++)
+ switch (syntax[i].type) {
+ case EBML_UINT:
+ *(uint64_t *) ((char *) data + syntax[i].data_offset) = syntax[i].def.u;
+ break;
+ case EBML_SINT:
+ *(int64_t *) ((char *) data + syntax[i].data_offset) = syntax[i].def.i;
+ break;
+ case EBML_FLOAT:
+ *(double *) ((char *) data + syntax[i].data_offset) = syntax[i].def.f;
+ break;
+ case EBML_STR:
+ case EBML_UTF8:
+ // the default may be NULL
+ if (syntax[i].def.s) {
+ uint8_t **dst = (uint8_t **) ((uint8_t *) data + syntax[i].data_offset);
+ *dst = av_strdup(syntax[i].def.s);
+ if (!*dst)
+ return AVERROR(ENOMEM);
+ }
+ break;
}
- break;
- }
- if (!matroska->levels[matroska->num_levels - 1].length) {
- matroska->num_levels--;
- return 0;
- }
+ if (!matroska->levels[matroska->num_levels - 1].length) {
+ matroska->num_levels--;
+ return 0;
+ }
}
do {
@@ -1229,18 +1229,18 @@ static int ebml_parse(MatroskaDemuxContext *matroska,
}
if (data) {
- data = (char *) data + syntax->data_offset;
- if (syntax->list_elem_size) {
- EbmlList *list = data;
- void *newelem = av_realloc_array(list->elem, list->nb_elem + 1,
- syntax->list_elem_size);
- if (!newelem)
- return AVERROR(ENOMEM);
- list->elem = newelem;
- data = (char *) list->elem + list->nb_elem * syntax->list_elem_size;
- memset(data, 0, syntax->list_elem_size);
- list->nb_elem++;
- }
+ data = (char *) data + syntax->data_offset;
+ if (syntax->list_elem_size) {
+ EbmlList *list = data;
+ void *newelem = av_realloc_array(list->elem, list->nb_elem + 1,
+ syntax->list_elem_size);
+ if (!newelem)
+ return AVERROR(ENOMEM);
+ list->elem = newelem;
+ data = (char *) list->elem + list->nb_elem * syntax->list_elem_size;
+ memset(data, 0, syntax->list_elem_size);
+ list->nb_elem++;
+ }
}
if (syntax->type != EBML_STOP) {