aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-02-13 19:26:45 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-02-13 19:26:45 +0000
commit501f162fdee4118b5503b3a686c871c3f885a760 (patch)
tree684d096caf39bc0103465c09ed3eb7fbb11aa27c
parent134e5a9a65261cb890304cfd897a3222be3b6db0 (diff)
downloadffmpeg-501f162fdee4118b5503b3a686c871c3f885a760.tar.gz
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
-rw-r--r--libavformat/mov.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 27a4e47262..5fd41f5f56 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1386,11 +1386,9 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
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 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
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;