Mercurial > libavformat.hg
changeset 3041:f68603a02de9 libavformat
honor stsd v1 first, fix mace surge-2-8-MAC3.mov, beware of mulaw,alaw
author | bcoudurier |
---|---|
date | Wed, 13 Feb 2008 19:26:45 +0000 |
parents | ca38ffc89883 |
children | 55389742397f |
files | mov.c |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mov.c Wed Feb 13 13:11:10 2008 +0000 +++ b/mov.c Wed Feb 13 19:26:45 2008 +0000 @@ -1386,11 +1386,9 @@ i + 1 == sc->sample_to_chunk[stsc_index + 1].first) stsc_index++; chunk_samples = sc->sample_to_chunk[stsc_index].count; - /* get chunk size */ - if (sc->sample_size > 1 || st->codec->bits_per_sample == 8) - chunk_size = chunk_samples * sc->sample_size; - else if (sc->samples_per_frame > 0 && - (chunk_samples * sc->bytes_per_frame % sc->samples_per_frame == 0)) { + /* get chunk size, beware of alaw/ulaw/mace */ + if (sc->samples_per_frame > 0 && + (chunk_samples * sc->bytes_per_frame % sc->samples_per_frame == 0)) { if (sc->samples_per_frame < 1024) chunk_size = chunk_samples * sc->bytes_per_frame / sc->samples_per_frame; else { @@ -1398,6 +1396,8 @@ frames = chunk_samples / sc->samples_per_frame; chunk_samples = sc->samples_per_frame; } + } else if (sc->sample_size > 1 || st->codec->bits_per_sample == 8) { + chunk_size = chunk_samples * sc->sample_size; } else { av_log(mov->fc, AV_LOG_ERROR, "could not determine chunk size, report problem\n"); goto out;