return result;
}
-static int32_t write_int32(struct mp4 *f, uint32_t data)
-{
- int8_t temp[4];
- write_u32_be(temp, data);
- return write_data(f, temp, sizeof(temp));
-}
-
int32_t mp4_meta_update(struct mp4 *f)
{
void *new_moov_data;
uint32_t new_moov_size;
+ uint8_t buf[4];
set_position(f, 0);
new_moov_data = modify_moov(f, &new_moov_size);
set_position(f, f->file_size); /* write new moov atom at EOF */
} else /* overwrite old moov atom */
set_position(f, f->moov_offset);
- write_int32(f, new_moov_size + 8);
+ write_u32_be(buf, new_moov_size + 8);
+ write_data(f, buf, 4);
write_data(f, "moov", 4);
write_data(f, new_moov_data, new_moov_size);
free(new_moov_data);