From 07f8018a026871ee69cd0e963b0bc76f41990bb9 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 18 Aug 2021 18:12:44 +0200 Subject: [PATCH] mp4: Rename mp4_total_tracks() to mp4_get_total_tracks(). Just to be consistent with other public functions whose name contain a predicate. Move the function down to related functions. --- aac_afh.c | 2 +- mp4.c | 12 ++++++------ mp4.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/aac_afh.c b/aac_afh.c index 2226394a..34ad7cba 100644 --- a/aac_afh.c +++ b/aac_afh.c @@ -51,7 +51,7 @@ static uint32_t aac_afh_seek_cb(void *user_data, uint64_t pos) static int32_t aac_afh_get_track(struct mp4 *mp4) { - int32_t i, num_tracks = mp4_total_tracks(mp4); + int32_t i, num_tracks = mp4_get_total_tracks(mp4); assert(num_tracks >= 0); for (i = 0; i < num_tracks; i++) diff --git a/mp4.c b/mp4.c index 477b4307..49ab1371 100644 --- a/mp4.c +++ b/mp4.c @@ -61,11 +61,6 @@ struct mp4 { struct mp4_metadata meta; }; -int32_t mp4_total_tracks(const struct mp4 *f) -{ - return f->total_tracks; -} - /* * Returns -1, 0, or 1 on errors/EOF/success. Partial reads followed by EOF or * read errors are treated as errors. @@ -1084,7 +1079,7 @@ static int32_t sample_to_offset(const struct mp4 *f, int32_t track, * Return the number of milliseconds of the given track. * * \param f As returned by \ref mp4_open_read(), must not be NULL. - * \param track Between zero and the value returned by \ref mp4_total_tracks(). + * \param track Between zero and the value returned by \ref mp4_get_total_tracks(). * * The function returns zero if the audio file is of zero length or contains a * corrupt track header. @@ -1098,6 +1093,11 @@ uint64_t mp4_get_duration(const struct mp4 *f, int32_t track) return t->duration * 1000 / t->timeScale; } +int32_t mp4_get_total_tracks(const struct mp4 *f) +{ + return f->total_tracks; +} + /** * Check whether the given track number corresponds to an audio track. * diff --git a/mp4.h b/mp4.h index 9ff6f95e..0bf74818 100644 --- a/mp4.h +++ b/mp4.h @@ -20,7 +20,7 @@ struct mp4_metadata { struct mp4; /* opaque */ void mp4_set_sample_position(struct mp4 *f, int32_t track, int32_t sample); -int32_t mp4_total_tracks(const struct mp4 *f); +int32_t mp4_get_total_tracks(const struct mp4 *f); bool mp4_is_audio_track(const struct mp4 *f, int32_t track); struct mp4 *mp4_open_read(const struct mp4_callback *cb); void mp4_close(struct mp4 *f); -- 2.39.2