goto close;
afhi->frequency = rv;
- ret = -E_MP4_BAD_CHANNEL_COUNT;
- rv = mp4_get_channel_count(c->mp4);
- if (rv <= 0)
- goto close;
- afhi->channels = rv;
+ afhi->channels = mp4_get_channel_count(c->mp4);
+ assert(afhi->channels > 0);
ret = -E_MP4_BAD_SAMPLE_COUNT;
rv = mp4_num_samples(c->mp4);
PARA_ERROR(MP3_INFO, "could not read mp3 info"), \
PARA_ERROR(MP4_READ, "mp4: read error or unexpected end of file"), \
PARA_ERROR(MP4_CORRUPT, "invalid/corrupt mp4 file"), \
- PARA_ERROR(MP4_BAD_CHANNEL_COUNT, "mp4: invalid number of channels"), \
PARA_ERROR(MP4_BAD_SAMPLE, "mp4: invalid sample number"), \
PARA_ERROR(MP4_BAD_SAMPLERATE, "mp4: invalid sample rate"), \
PARA_ERROR(MP4_BAD_SAMPLE_COUNT, "mp4: invalid number of samples"), \
return f->track.sample_rate;
}
-uint32_t mp4_get_channel_count(const struct mp4 *f)
+uint16_t mp4_get_channel_count(const struct mp4 *f)
{
return f->track.channel_count;
}
void mp4_close(struct mp4 *f);
int mp4_get_sample_size(const struct mp4 *f, uint32_t sample, uint32_t *result);
uint32_t mp4_get_sample_rate(const struct mp4 *f);
-uint32_t mp4_get_channel_count(const struct mp4 * f);
+uint16_t mp4_get_channel_count(const struct mp4 *f);
int32_t mp4_num_samples(const struct mp4 *f);
uint64_t mp4_get_duration(const struct mp4 *f);
int mp4_open_meta(const struct mp4_callback *cb, struct mp4 **result);