From 11f9c2907b6ac56161690fa6b38a9e4e7dce2f13 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 18 Aug 2021 15:11:09 +0200 Subject: [PATCH] mp4: Move read_intX functions. This way, they are located next to each other, and are ordered by the size of the integer value they read. Pure code movement, no real changes. --- mp4.c | 62 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/mp4.c b/mp4.c index 60969cae..18c9882e 100644 --- a/mp4.c +++ b/mp4.c @@ -92,6 +92,37 @@ static uint64_t read_int64(struct mp4 *f) return read_u64_be(data); } +static uint32_t read_int32(struct mp4 *f) +{ + int8_t data[4]; + + read_data(f, data, 4); + return read_u32_be(data); +} + +static uint32_t read_int24(struct mp4 *f) +{ + int8_t data[4]; + + read_data(f, data, 3); + return read_u24_be(data); +} + +static uint16_t read_int16(struct mp4 *f) +{ + int8_t data[2]; + + read_data(f, data, 2); + return read_u16_be(data); +} + +static uint8_t read_int8(struct mp4 *f) +{ + uint8_t output; + read_data(f, &output, 1); + return output; +} + static bool atom_compare(int8_t a1, int8_t b1, int8_t c1, int8_t d1, int8_t a2, int8_t b2, int8_t c2, int8_t d2) { @@ -406,29 +437,6 @@ static void track_add(struct mp4 *f) f->track[f->total_tracks - 1] = para_calloc(sizeof(struct mp4_track)); } -static uint8_t read_int8(struct mp4 *f) -{ - uint8_t output; - read_data(f, &output, 1); - return output; -} - -static uint32_t read_int24(struct mp4 *f) -{ - int8_t data[4]; - - read_data(f, data, 3); - return read_u24_be(data); -} - -static uint32_t read_int32(struct mp4 *f) -{ - int8_t data[4]; - - read_data(f, data, 4); - return read_u32_be(data); -} - static int32_t read_stsz(struct mp4 *f) { int32_t i; @@ -523,14 +531,6 @@ static int32_t read_stco(struct mp4 *f) return 0; } -static uint16_t read_int16(struct mp4 *f) -{ - int8_t data[2]; - - read_data(f, data, 2); - return read_u16_be(data); -} - static int32_t read_mp4a(struct mp4 *f) { int32_t i; -- 2.39.2