From 57876d8b3bb054060dd4d6c2456b81fe0f1e846e Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 18 Aug 2021 15:08:25 +0200 Subject: [PATCH] mp4: Rename read_char() to read_int8(). That's more to the point, and is consistent with the other functions which read integer values. --- mp4.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mp4.c b/mp4.c index 49b97504..60969cae 100644 --- a/mp4.c +++ b/mp4.c @@ -406,7 +406,7 @@ static void track_add(struct mp4 *f) f->track[f->total_tracks - 1] = para_calloc(sizeof(struct mp4_track)); } -static uint8_t read_char(struct mp4 *f) +static uint8_t read_int8(struct mp4 *f) { uint8_t output; read_data(f, &output, 1); @@ -437,7 +437,7 @@ static int32_t read_stsz(struct mp4 *f) if (f->total_tracks == 0) return f->error++; t = f->track[f->total_tracks - 1]; - read_char(f); /* version */ + read_int8(f); /* version */ read_int24(f); /* flags */ t->stsz_sample_size = read_int32(f); t->stsz_sample_count = read_int32(f); @@ -460,7 +460,7 @@ static int32_t read_stts(struct mp4 *f) t = f->track[f->total_tracks - 1]; if (t->stts_entry_count) return 0; - read_char(f); /* version */ + read_int8(f); /* version */ read_int24(f); /* flags */ t->stts_entry_count = read_int32(f); @@ -485,7 +485,7 @@ static int32_t read_stsc(struct mp4 *f) return f->error++; t = f->track[f->total_tracks - 1]; - read_char(f); /* version */ + read_int8(f); /* version */ read_int24(f); /* flags */ t->stsc_entry_count = read_int32(f); t->stsc_first_chunk = para_malloc(t->stsc_entry_count * sizeof(int32_t)); @@ -512,7 +512,7 @@ static int32_t read_stco(struct mp4 *f) return f->error++; t = f->track[f->total_tracks - 1]; - read_char(f); /* version */ + read_int8(f); /* version */ read_int24(f); /* flags */ t->stco_entry_count = read_int32(f); t->stco_chunk_offset = para_malloc(t->stco_entry_count @@ -542,9 +542,8 @@ static int32_t read_mp4a(struct mp4 *f) return f->error++; t = f->track[f->total_tracks - 1]; - for (i = 0; i < 6; i++) { - read_char(f); /* reserved */ - } + for (i = 0; i < 6; i++) + read_int8(f); /* reserved */ /* data_reference_index */ read_int16(f); read_int32(f); /* reserved */ @@ -575,7 +574,7 @@ static int32_t read_stsd(struct mp4 *f) return f->error++; t = f->track[f->total_tracks - 1]; - read_char(f); /* version */ + read_int8(f); /* version */ read_int24(f); /* flags */ entry_count = read_int32(f); @@ -655,7 +654,7 @@ static void parse_tag(struct mp4 *f, uint8_t parent, int32_t size) destpos = get_position(f) + subsize - header_size; if (atom_type != ATOM_DATA) continue; - read_char(f); /* version */ + read_int8(f); /* version */ read_int24(f); /* flags */ read_int32(f); /* reserved */ free(data); @@ -732,7 +731,7 @@ static int32_t read_meta(struct mp4 *f, uint64_t size) uint8_t atom_type; uint8_t header_size = 0; - read_char(f); /* version */ + read_int8(f); /* version */ read_int24(f); /* flags */ while (sumsize < (size - (header_size + 4))) { -- 2.39.5