]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mp4: Rename mp4_total_tracks() to mp4_get_total_tracks().
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 18 Aug 2021 16:12:44 +0000 (18:12 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 May 2022 19:37:35 +0000 (21:37 +0200)
Just to be consistent with other public functions whose name contain
a predicate. Move the function down to related functions.

aac_afh.c
mp4.c
mp4.h

index 2226394aa2f2370d0e85b8bfc648328bc8452245..34ad7cbadf1e95296af4a36119f20b18dfdce764 100644 (file)
--- 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 477b4307244731a0702599c8e49cf2a89862efa3..49ab1371fbff23dd202555a656dd78c84d7b969b 100644 (file)
--- 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 9ff6f95ece00dd2ddd6e278f2c8a6302d8a5b9a6..0bf7481805242a79f757b1de66a88f122b3481ba 100644 (file)
--- 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);