The sample rate and the number of samples are stored as 16-bit/32-bit
unsigned integers in the mp4 file, so let mp4_get_sample_rate()
and mp4_num_samples() return these types.
-uint32_t mp4_get_sample_rate(const struct mp4 *f)
+uint16_t mp4_get_sample_rate(const struct mp4 *f)
{
return f->track.sample_rate;
}
{
return f->track.sample_rate;
}
return f->track.channel_count;
}
return f->track.channel_count;
}
-int32_t mp4_num_samples(const struct mp4 *f)
+uint32_t mp4_num_samples(const struct mp4 *f)
{
const struct mp4_track *t = &f->track;
{
const struct mp4_track *t = &f->track;
for (uint32_t n = 0; n < t->stts_entry_count; n++)
total += t->stts_sample_count[n];
for (uint32_t n = 0; n < t->stts_entry_count; n++)
total += t->stts_sample_count[n];
int mp4_open_read(const struct mp4_callback *cb, struct mp4 **result);
void mp4_close(struct mp4 *f);
int mp4_get_sample_size(const struct mp4 *f, uint32_t sample, uint32_t *result);
int mp4_open_read(const struct mp4_callback *cb, struct mp4 **result);
void mp4_close(struct mp4 *f);
int mp4_get_sample_size(const struct mp4 *f, uint32_t sample, uint32_t *result);
-uint32_t mp4_get_sample_rate(const struct mp4 *f);
+uint16_t mp4_get_sample_rate(const struct mp4 *f);
uint16_t mp4_get_channel_count(const struct mp4 *f);
uint16_t mp4_get_channel_count(const struct mp4 *f);
-int32_t mp4_num_samples(const struct mp4 *f);
+uint32_t mp4_num_samples(const struct mp4 *f);
uint64_t mp4_get_duration(const struct mp4 *f);
int mp4_open_meta(const struct mp4_callback *cb, struct mp4 **result);
struct mp4_metadata *mp4_get_meta(struct mp4 *f);
uint64_t mp4_get_duration(const struct mp4 *f);
int mp4_open_meta(const struct mp4_callback *cb, struct mp4 **result);
struct mp4_metadata *mp4_get_meta(struct mp4 *f);