f->last_atom = atom_type;
if (atom_type == ATOM_MOOV && size > header_size) {
- f->moov_read = 1;
f->moov_offset = mp4ff_position(f) - header_size;
f->moov_size = size;
}
return chunk_offset2;
}
-int32_t mp4ff_set_sample_position(mp4ff_t * f, const int32_t track,
- const int32_t sample)
+void mp4ff_set_sample_position(mp4ff_t *f, const int32_t track,
+ const int32_t sample)
{
- int32_t offset;
-
- offset = mp4ff_sample_to_offset(f, track, sample);
+ int32_t offset = mp4ff_sample_to_offset(f, track, sample);
mp4ff_set_position(f, offset);
-
- return 0;
}
-static int32_t mp4ff_audio_frame_size(const mp4ff_t * f, const int32_t track,
- const int32_t sample)
+int32_t mp4ff_get_sample_size(const mp4ff_t *f, int track, int sample)
{
- int32_t bytes;
- const mp4ff_track_t *p_track = f->track[track];
-
- if (p_track->stsz_sample_size) {
- bytes = p_track->stsz_sample_size;
- } else {
- bytes = p_track->stsz_table[sample];
- }
+ const mp4ff_track_t *t = f->track[track];
- return bytes;
-}
-
-int32_t mp4ff_read_sample_getsize(mp4ff_t * f, const int track,
- const int sample)
-{
- int32_t temp = mp4ff_audio_frame_size(f, track, sample);
- if (temp < 0)
- temp = 0;
- return temp;
+ if (t->stsz_sample_size != 0)
+ return t->stsz_sample_size;
+ return t->stsz_table[sample];
}
uint32_t mp4ff_get_sample_rate(const mp4ff_t * f, const int32_t track)