return 1;
}
-static int read_mp4a(struct mp4 *f)
-{
- int ret;
- struct mp4_track *t;
-
- if (f->total_tracks == 0)
- return -1;
- t = f->track[f->total_tracks - 1];
- /* reserved (6), data reference index (2), reserved (8) */
- skip_bytes(f, 16);
- ret = read_int16(f, &t->channel_count);
- if (ret <= 0)
- return ret;
- skip_bytes(f, 6);
- return read_int16(f, &t->sample_rate);
-}
-
static int read_stsd(struct mp4 *f)
{
int ret;
skip += size;
if (!f->audio_track && atom_type == ATOM_MP4A) {
f->audio_track = t;
- read_mp4a(f);
+ /* reserved (6), data reference index (2), reserved (8) */
+ skip_bytes(f, 16);
+ ret = read_int16(f, &t->channel_count);
+ if (ret <= 0)
+ return ret;
+ skip_bytes(f, 6);
+ ret = read_int16(f, &t->sample_rate);
+ if (ret <= 0)
+ return ret;
}
set_position(f, skip);
}