From: Andre Noll <maan@tuebingen.mpg.de>
Date: Fri, 27 Aug 2021 13:23:24 +0000 (+0200)
Subject: mp4: Make sample number be an unsigned parameter.
X-Git-Tag: v0.7.1~7^2~15
X-Git-Url: https://git.tuebingen.mpg.de/?a=commitdiff_plain;h=83607bd0556f3c7aa5880567e3d089e76c0d9746;p=paraslash.git

mp4: Make sample number be an unsigned parameter.

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.
---

diff --git a/mp4.c b/mp4.c
index 0bddac9c..869b80fa 100644
--- 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 49c4be18..ceb8dde2 100644
--- 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);