]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mp4: Don't parse the movie header any more.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 11 Aug 2021 18:49:21 +0000 (20:49 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 May 2022 19:37:35 +0000 (21:37 +0200)
The duration and time scale are taken from the audio track while the
values stored in the movie header (if present) are ignored anyway.

mp4.c

diff --git a/mp4.c b/mp4.c
index 7179958cef75caa4436e154bf7db3816d4ec42e0..8d58c1f2b58270371808e020eb0f5eb9855b9b26 100644 (file)
--- a/mp4.c
+++ b/mp4.c
@@ -66,10 +66,6 @@ struct mp4 {
        uint64_t file_size;
        uint32_t error;
 
-       /* mvhd */
-       int32_t time_scale;
-       int32_t duration;
-
        /* incremental track index while reading the file */
        int32_t total_tracks;
 
@@ -640,32 +636,6 @@ static int32_t read_stsd(struct mp4 *f)
        return 0;
 }
 
-static int32_t read_mvhd(struct mp4 *f)
-{
-       int32_t i;
-
-       read_char(f);   /* version */
-       read_int24(f);  /* flags */
-       read_int32(f); /* creation_time */
-       read_int32(f); /* modification_time */
-       f->time_scale = read_int32(f);
-       f->duration = read_int32(f);
-       read_int32(f); /* preferred_rate */
-       read_int16(f); /* preferred_volume */
-       for (i = 0; i < 10; i++)
-               read_char(f); /* reserved */
-       for (i = 0; i < 9; i++)
-               read_int32(f); /* matrix */
-       read_int32(f); /* preview_time */
-       read_int32(f); /* preview_duration */
-       read_int32(f); /* poster_time */
-       read_int32(f); /* selection_time */
-       read_int32(f); /* selection_duration */
-       read_int32(f); /* current_time */
-       read_int32(f); /* next_track_id */
-       return 0;
-}
-
 static int32_t tag_add_field(struct mp4_metadata *tags, const char *item,
                const char *value, int32_t len)
 {
@@ -1058,9 +1028,6 @@ static int32_t atom_read(struct mp4 *f, int32_t size, uint8_t atom_type)
        } else if (atom_type == ATOM_STSD) {
                /* sample description box */
                read_stsd(f);
-       } else if (atom_type == ATOM_MVHD) {
-               /* movie header box */
-               read_mvhd(f);
        } else if (atom_type == ATOM_MDHD) {
                /* track header */
                read_mdhd(f);