int32_t chunk_sample, int32_t sample)
{
int32_t i, total;
- const struct mp4_track *p_track = f->track[track];
-
- if (p_track->stsz_sample_size) {
- return (sample - chunk_sample) * p_track->stsz_sample_size;
- } else {
- if (sample >= p_track->stsz_sample_count)
- return 0; //error
-
- for (i = chunk_sample, total = 0; i < sample; i++) {
- total += p_track->stsz_table[i];
- }
- }
+ const struct mp4_track *t = f->track[track];
+ if (t->stsz_sample_size)
+ return (sample - chunk_sample) * t->stsz_sample_size;
+ if (sample >= t->stsz_sample_count)
+ return 0; /* error */
+ for (i = chunk_sample, total = 0; i < sample; i++)
+ total += t->stsz_table[i];
return total;
}