From 83607bd0556f3c7aa5880567e3d089e76c0d9746 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 27 Aug 2021 15:23:24 +0200 Subject: [PATCH] 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. --- mp4.c | 2 +- mp4.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); -- 2.39.5