]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mp4: Convert "meta_only" to a boolean.
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 19 Aug 2021 17:13:31 +0000 (19:13 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 May 2022 19:37:35 +0000 (21:37 +0200)
Several functions receive the "meta_only" parameter to distinguish
between regular and metadata-only opens. The parameter can only be
zero or one, so use a boolean because true/false is more descriptive
than 1/0.

mp4.c

diff --git a/mp4.c b/mp4.c
index 469ec7d7da6ef6d71f8cfd50e701a4920b1e8f4e..e5ec9dd13ecd6ab71ef00e3657a7eb5a598a60eb 100644 (file)
--- a/mp4.c
+++ b/mp4.c
@@ -865,7 +865,7 @@ static int atom_read(struct mp4 *f, uint64_t size, uint8_t atom_type)
 }
 
 /* parse atoms that are sub atoms of other atoms */
-static int parse_sub_atoms(struct mp4 *f, uint64_t total_size, int meta_only)
+static int parse_sub_atoms(struct mp4 *f, uint64_t total_size, bool meta_only)
 {
        int ret;
        uint64_t size;
@@ -903,7 +903,7 @@ static int parse_sub_atoms(struct mp4 *f, uint64_t total_size, int meta_only)
        return 1;
 }
 
-static int parse_root_atoms(struct mp4 *f, int meta_only)
+static int parse_root_atoms(struct mp4 *f, bool meta_only)
 {
        int ret;
        uint64_t size;
@@ -938,7 +938,7 @@ struct mp4 *mp4_open_read(const struct mp4_callback *cb)
        struct mp4 *f = para_calloc(sizeof(struct mp4));
 
        f->cb = cb;
-       ret = parse_root_atoms(f, 0);
+       ret = parse_root_atoms(f, false);
        if (ret < 0) {
                free(f);
                return NULL;
@@ -1064,7 +1064,7 @@ struct mp4 *mp4_open_meta(const struct mp4_callback *cb)
        struct mp4 *f = para_calloc(sizeof(struct mp4));
 
        f->cb = cb;
-       ret = parse_root_atoms(f, 1);
+       ret = parse_root_atoms(f, true);
        if (ret < 0) {
                free(f);
                return NULL;