]> git.tue.mpg.de Git - paraslash.git/commitdiff
mp4: Rename overlong variable in mp4ff_parse_tag().
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 9 Aug 2021 18:42:17 +0000 (20:42 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 May 2022 19:37:35 +0000 (21:37 +0200)
The new "parent" name is just as descriptive and saves a few
characters.

mp4.c

diff --git a/mp4.c b/mp4.c
index b2a4795d924d4e8e03fccd7c5b29b8cfa3225b76..47d98bcf0403e46b1ca955efc2db45e0a4e0cf63 100644 (file)
--- a/mp4.c
+++ b/mp4.c
@@ -952,7 +952,7 @@ static int32_t mp4ff_set_metadata_name(const uint8_t atom_type, char **name)
        return 0;
 }
 
-static int32_t mp4ff_parse_tag(mp4ff_t * f, const uint8_t parent_atom_type,
+static int32_t mp4ff_parse_tag(mp4ff_t * f, const uint8_t parent,
                const int32_t size)
 {
        uint8_t atom_type;
@@ -987,11 +987,11 @@ static int32_t mp4ff_parse_tag(mp4ff_t * f, const uint8_t parent_atom_type,
                mp4ff_read_int32(f);    /* reserved */
 
                /* some need special attention */
-               if (parent_atom_type == ATOM_GENRE2 || parent_atom_type == ATOM_TEMPO) {
+               if (parent == ATOM_GENRE2 || parent == ATOM_TEMPO) {
                        if (subsize - header_size >= 8 + 2) {
                                uint16_t val = mp4ff_read_int16(f);
 
-                               if (parent_atom_type == ATOM_TEMPO) {
+                               if (parent == ATOM_TEMPO) {
                                        char temp[16];
                                        sprintf(temp, "%.5u BPM", val);
                                        mp4ff_tag_add_field(&(f-> tags), "tempo", temp, -1);
@@ -1002,9 +1002,9 @@ static int32_t mp4ff_parse_tag(mp4ff_t * f, const uint8_t parent_atom_type,
                                }
                                done = 1;
                        }
-               } else if (parent_atom_type == ATOM_TRACK || parent_atom_type == ATOM_DISC) {
+               } else if (parent == ATOM_TRACK || parent == ATOM_DISC) {
                        if (subsize - header_size >= (sizeof (char) + sizeof (uint8_t) * 3 + sizeof (uint32_t) +        /* version + flags + reserved */
-                                                                +(parent_atom_type == ATOM_TRACK ? sizeof (uint16_t) : 0)      /* leading uint16_t if ATOM_TRACK */
+                                                                +(parent == ATOM_TRACK ? sizeof (uint16_t) : 0)        /* leading uint16_t if ATOM_TRACK */
                                                                 +sizeof (uint16_t)     /* track / disc */
                                                                 +sizeof (uint16_t))    /* totaltracks / totaldiscs */) {
                                uint16_t index, total;
@@ -1012,17 +1012,17 @@ static int32_t mp4ff_parse_tag(mp4ff_t * f, const uint8_t parent_atom_type,
                                mp4ff_read_int16(f);
                                index = mp4ff_read_int16(f);
                                total = mp4ff_read_int16(f);
-                               if (parent_atom_type == ATOM_TRACK)
+                               if (parent == ATOM_TRACK)
                                        mp4ff_read_int16(f);
 
                                sprintf(temp, "%d", index);
-                               mp4ff_tag_add_field(&(f->tags), parent_atom_type == ATOM_TRACK ?
+                               mp4ff_tag_add_field(&(f->tags), parent == ATOM_TRACK ?
                                        "track" : "disc", temp, -1);
                                if (total > 0) {
                                        sprintf(temp, "%d",
                                                total);
                                        mp4ff_tag_add_field(& (f-> tags),
-                                               parent_atom_type == ATOM_TRACK?
+                                               parent == ATOM_TRACK?
                                                "totaltracks" : "totaldiscs", temp, -1);
                                }
                                done = 1;
@@ -1036,7 +1036,7 @@ static int32_t mp4ff_parse_tag(mp4ff_t * f, const uint8_t parent_atom_type,
        if (data) {
                if (!done) {
                        if (name == NULL)
-                               mp4ff_set_metadata_name(parent_atom_type, &name);
+                               mp4ff_set_metadata_name(parent , &name);
                        if (name)
                                mp4ff_tag_add_field(&(f->tags), name, data, len);
                }