From: Andre Noll Date: Wed, 11 Aug 2021 18:49:21 +0000 (+0200) Subject: mp4: Don't parse the movie header any more. X-Git-Tag: v0.7.1~7^2~98 X-Git-Url: http://git.tuebingen.mpg.de/?a=commitdiff_plain;h=9f41e0a646faa238673bfdbe4dbdccb9cea37b7d;p=paraslash.git mp4: Don't parse the movie header any more. The duration and time scale are taken from the audio track while the values stored in the movie header (if present) are ignored anyway. --- diff --git a/mp4.c b/mp4.c index 7179958c..8d58c1f2 100644 --- 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);