forked from FFmpeg/FFmpeg
honor stsd v1 first, fix mace surge-2-8-MAC3.mov, beware of mulaw,alaw
Originally committed as revision 11928 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
134e5a9a65
commit
501f162fde
1 changed files with 5 additions and 5 deletions
|
@ -1386,11 +1386,9 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
|
||||||
i + 1 == sc->sample_to_chunk[stsc_index + 1].first)
|
i + 1 == sc->sample_to_chunk[stsc_index + 1].first)
|
||||||
stsc_index++;
|
stsc_index++;
|
||||||
chunk_samples = sc->sample_to_chunk[stsc_index].count;
|
chunk_samples = sc->sample_to_chunk[stsc_index].count;
|
||||||
/* get chunk size */
|
/* get chunk size, beware of alaw/ulaw/mace */
|
||||||
if (sc->sample_size > 1 || st->codec->bits_per_sample == 8)
|
if (sc->samples_per_frame > 0 &&
|
||||||
chunk_size = chunk_samples * sc->sample_size;
|
(chunk_samples * sc->bytes_per_frame % sc->samples_per_frame == 0)) {
|
||||||
else if (sc->samples_per_frame > 0 &&
|
|
||||||
(chunk_samples * sc->bytes_per_frame % sc->samples_per_frame == 0)) {
|
|
||||||
if (sc->samples_per_frame < 1024)
|
if (sc->samples_per_frame < 1024)
|
||||||
chunk_size = chunk_samples * sc->bytes_per_frame / sc->samples_per_frame;
|
chunk_size = chunk_samples * sc->bytes_per_frame / sc->samples_per_frame;
|
||||||
else {
|
else {
|
||||||
|
@ -1398,6 +1396,8 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
|
||||||
frames = chunk_samples / sc->samples_per_frame;
|
frames = chunk_samples / sc->samples_per_frame;
|
||||||
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 {
|
} else {
|
||||||
av_log(mov->fc, AV_LOG_ERROR, "could not determine chunk size, report problem\n");
|
av_log(mov->fc, AV_LOG_ERROR, "could not determine chunk size, report problem\n");
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Add table
Reference in a new issue