return 0;
}
-static int32_t chunk_to_offset(const struct mp4 *f, int32_t track,
- int32_t chunk)
-{
- const struct mp4_track *p_track = f->track[track];
-
- if (p_track->stco_entry_count && (chunk > p_track->stco_entry_count)) {
- return p_track->stco_chunk_offset[p_track->stco_entry_count -
- 1];
- } else if (p_track->stco_entry_count) {
- return p_track->stco_chunk_offset[chunk - 1];
- } else {
- return 8;
- }
-
- return 0;
-}
-
/**
* Return the number of milliseconds of the given track.
*
for (srs = 0, n = chunk_sample; n < sample; n++)
srs += t->stsz_table[n];
}
- offset = chunk_to_offset(f, track, chunk) + srs;
- set_position(f, offset);
+ if (t->stco_entry_count > 0 && chunk > t->stco_entry_count)
+ offset = t->stco_chunk_offset[t->stco_entry_count - 1];
+ else if (t->stco_entry_count > 0)
+ offset = t->stco_chunk_offset[chunk - 1];
+ else
+ offset = 8;
+ set_position(f, offset + srs);
return 1;
}