We don't need to iterate over the entries of the stts_sample_count
array because the number stored in the stsz_sample_count field should
be identical to the sum of the sample counts.
uint32_t mp4_num_samples(const struct mp4 *f)
{
- const struct mp4_track *t = &f->track;
- uint32_t total = 0;
-
- for (uint32_t n = 0; n < t->stts_entry_count; n++)
- total += t->stts_sample_count[n];
- return total;
+ return f->track.stsz_sample_count;
}
int mp4_open_meta(const struct mp4_callback *cb, struct mp4 **result)