return total;
}
-static int32_t sample_to_offset(const struct mp4 *f, int32_t track,
- int32_t sample)
-{
- int32_t chunk, chunk_sample, chunk_offset1, chunk_offset2;
-
- chunk_of_sample(f, track, sample, &chunk_sample, &chunk);
-
- chunk_offset1 = chunk_to_offset(f, track, chunk);
- chunk_offset2 = chunk_offset1 + sample_range_size(f,
- track, chunk_sample, sample);
- return chunk_offset2;
-}
-
/**
* Return the number of milliseconds of the given track.
*
void mp4_set_sample_position(struct mp4 *f, int32_t track, int32_t sample)
{
- int32_t offset = sample_to_offset(f, track, sample);
+ int32_t offset, chunk, chunk_sample;
+
+ chunk_of_sample(f, track, sample, &chunk_sample, &chunk);
+ offset = chunk_to_offset(f, track, chunk)
+ + sample_range_size(f, track, chunk_sample, sample);
set_position(f, offset);
}