]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mp4: Make sample number be an unsigned parameter.
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 27 Aug 2021 13:23:24 +0000 (15:23 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 6 Jun 2022 18:46:37 +0000 (20:46 +0200)
There is no reason to convert the 32-bit unsigned paraslash chunk
number into a signed quantity here, as sample numbers are also stored
as 32 bit unsigned in the mp4 file.

mp4.c
mp4.h

diff --git a/mp4.c b/mp4.c
index 0bddac9c2f512c4cf8a6e1ef0f6f3aed044b8a21..869b80fa966dbcef2d039935a4a44053d21f963b 100644 (file)
--- a/mp4.c
+++ b/mp4.c
@@ -655,7 +655,7 @@ uint64_t mp4_get_duration(const struct mp4 *f)
        return t->duration * 1000 / t->time_scale;
 }
 
-int mp4_set_sample_position(struct mp4 *f, int32_t sample)
+int mp4_set_sample_position(struct mp4 *f, uint32_t sample)
 {
        const struct mp4_track *t = &f->track;
        int32_t offset, chunk, chunk_sample;
diff --git a/mp4.h b/mp4.h
index 49c4be18a5929c9e79e091704e9ab2e4112cc22b..ceb8dde29e84b48661734303fa09759821dd6565 100644 (file)
--- a/mp4.h
+++ b/mp4.h
@@ -19,7 +19,7 @@ struct mp4_metadata {
 
 struct mp4; /* opaque */
 
-int mp4_set_sample_position(struct mp4 *f, int32_t sample);
+int mp4_set_sample_position(struct mp4 *f, uint32_t sample);
 int mp4_open_read(const struct mp4_callback *cb, struct mp4 **result);
 void mp4_close(struct mp4 *f);
 int32_t mp4_get_sample_size(const struct mp4 *f, int sample);