]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mp4: Drop metadata parameter from mp4_meta_update().
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 14 Aug 2021 16:48:56 +0000 (18:48 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 May 2022 19:37:35 +0000 (21:37 +0200)
The function can as well access the modified metadata structure via
the mp4 pointer. Drop the parameter also from modify_moov() for the
same reason.

aac_afh.c
mp4.c
mp4.h

index 1522b5f0f7e1c8502439fd31b7884f246ef9079c..3c8ba867ac0fde6fc641f1c819ff8fe1a915c7c9 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -269,7 +269,7 @@ static int aac_afh_rewrite_tags(const char *map, size_t mapsize,
        if (!found_comment)
                add_tag(metadata, "comment", tags->comment);
        ret = -E_MP4_META_WRITE;
-       if (!mp4_meta_update(mp4, metadata))
+       if (!mp4_meta_update(mp4))
                goto close;
        ret = 1;
 close:
diff --git a/mp4.c b/mp4.c
index 49fb22b97a640101c5e20ebf472610e6a28b802d..1158a381f9b54f3a175ca9f55d5c5c620b15e63b 100644 (file)
--- a/mp4.c
+++ b/mp4.c
@@ -1571,8 +1571,8 @@ static uint32_t fix_byte_order_32(uint32_t src)
        return read_u32_be(&src);
 }
 
-static uint32_t modify_moov(struct mp4 *f, const struct mp4_metadata *data,
-               void **out_buffer, uint32_t * out_size)
+static uint32_t modify_moov(struct mp4 *f, void **out_buffer,
+               uint32_t *out_size)
 {
        uint64_t total_base = f->moov_offset + 8;
        uint32_t total_size = (uint32_t) (f->moov_size - 8);
@@ -1590,7 +1590,7 @@ static uint32_t modify_moov(struct mp4 *f, const struct mp4_metadata *data,
                struct membuffer *buf;
                void *new_udta_buffer;
                uint32_t new_udta_size;
-               if (!create_udta(data, &new_udta_buffer, &new_udta_size))
+               if (!create_udta(&f->tags, &new_udta_buffer, &new_udta_size))
                        return 0;
 
                buf = membuffer_create();
@@ -1614,7 +1614,7 @@ static uint32_t modify_moov(struct mp4 *f, const struct mp4_metadata *data,
                        void *new_meta_buffer;
                        uint32_t new_meta_size;
 
-                       if (!create_meta(data, &new_meta_buffer, &new_meta_size))
+                       if (!create_meta(&f->tags, &new_meta_buffer, &new_meta_size))
                                return 0;
 
                        buf = membuffer_create();
@@ -1642,7 +1642,7 @@ static uint32_t modify_moov(struct mp4 *f, const struct mp4_metadata *data,
                ilst_offset = get_position(f);
                ilst_size = read_int32(f);
 
-               if (!create_ilst(data, &new_ilst_buffer, &new_ilst_size))
+               if (!create_ilst(&f->tags, &new_ilst_buffer, &new_ilst_size))
                        return 0;
 
                size_delta = new_ilst_size - (ilst_size - 8);
@@ -1704,13 +1704,13 @@ static int32_t write_int32(struct mp4 *f, uint32_t data)
        return write_data(f, temp, sizeof(temp));
 }
 
-int32_t mp4_meta_update(struct mp4 *f, struct mp4_metadata *meta)
+int32_t mp4_meta_update(struct mp4 *f)
 {
        void *new_moov_data;
        uint32_t new_moov_size;
 
        set_position(f, 0);
-       if (!modify_moov(f, meta, &new_moov_data, &new_moov_size)) {
+       if (!modify_moov(f, &new_moov_data, &new_moov_size)) {
                mp4_close(f);
                return 0;
        }
diff --git a/mp4.h b/mp4.h
index eb8cf87a1c3ac4a5774e3c24d78cffa77e7bc30a..1d48174af6cd30635a31522f393285068a580de9 100644 (file)
--- a/mp4.h
+++ b/mp4.h
@@ -32,7 +32,7 @@ uint64_t mp4_get_duration(const struct mp4 *f, int32_t track);
 struct mp4 *mp4_open_meta(const struct mp4_callback *cb);
 
 struct mp4_metadata *mp4_get_meta(struct mp4 *f);
-int32_t mp4_meta_update(struct mp4 *f, struct mp4_metadata *meta);
+int32_t mp4_meta_update(struct mp4 *f);
 char *mp4_meta_get_artist(const struct mp4 *f);
 char *mp4_meta_get_title(const struct mp4 *f);
 char *mp4_meta_get_date(const struct mp4 *f);