From: Andre Noll Date: Mon, 23 Aug 2021 18:12:30 +0000 (+0200) Subject: mp4: Kill fix_byte_order_32(). X-Git-Tag: v0.7.1~7^2~29 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=046cc332e3e50ff1338aa54a19592a5d5af4de24;p=paraslash.git mp4: Kill fix_byte_order_32(). All quantities stored in mp4 files are in big endian format, There's no reason to "fix" anything, just write out the 32 bit numbers using write_u32_be(). --- diff --git a/mp4.c b/mp4.c index 1ab20054..d73165a3 100644 --- a/mp4.c +++ b/mp4.c @@ -901,11 +901,6 @@ static void create_ilst(const struct mp4_metadata *meta, uint8_t *out) } } -static uint32_t fix_byte_order_32(uint32_t src) -{ - return read_u32_be(&src); -} - static void *modify_moov(struct mp4 *f, uint32_t *out_size) { int ret; @@ -931,7 +926,7 @@ static void *modify_moov(struct mp4 *f, uint32_t *out_size) ret = read_int32(f, &tmp); if (ret <= 0) return NULL; - *(uint32_t *)p_out = fix_byte_order_32(tmp + size_delta); + write_u32_be(p_out, tmp + size_delta); p_out += 4; ret = read_data(f, p_out, 4); if (ret <= 0) @@ -944,7 +939,7 @@ static void *modify_moov(struct mp4 *f, uint32_t *out_size) ret = read_int32(f, &tmp); if (ret <= 0) return NULL; - *(uint32_t *)p_out = fix_byte_order_32(tmp + size_delta); + write_u32_be(p_out, tmp + size_delta); p_out += 4; ret = read_data(f, p_out, 4); if (ret <= 0) @@ -957,7 +952,7 @@ static void *modify_moov(struct mp4 *f, uint32_t *out_size) ret = read_int32(f, &tmp); if (ret <= 0) return NULL; - *(uint32_t *)p_out = fix_byte_order_32(tmp + size_delta); + write_u32_be(p_out, tmp + size_delta); p_out += 4; ret = read_data(f, p_out, 4); if (ret <= 0)