diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-03-25 14:13:23 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2012-03-31 12:37:42 +0200 |
commit | 50059bde77674977d9134f3c1151a63cb7a2391c (patch) | |
tree | e377c737057e3aed78a00a6613ddd920a6fd9d1e /libavformat/mov.c | |
parent | e0ad7f74c762fb303b1374bb53865c5639649b29 (diff) | |
download | ffmpeg-50059bde77674977d9134f3c1151a63cb7a2391c.tar.gz |
MOV: Fix old-style muxed raw-audio data.
This patch fixes the sample from trac issue #522.
The issue is that the mov demuxer insists on using its
calculated sample_size (which is nonsense for old-style tracks)
instead of the one encoded in the track.
The old raw audio code should be using the value in stsz, because
the size of a single sample never makes sense for the size of
a full audio packet, whereas the new code will multiply the
sample size by the chunk size, so it should use the calculated value.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 372005c75f..4541a6ec18 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1644,6 +1644,7 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom) sample_size = avio_rb32(pb); if (!sc->sample_size) /* do not overwrite value computed in stsd */ sc->sample_size = sample_size; + sc->alt_sample_size = sample_size; field_size = 32; } else { sample_size = 0; @@ -1874,7 +1875,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st) } if (keyframe) distance = 0; - sample_size = sc->sample_size > 0 ? sc->sample_size : sc->sample_sizes[current_sample]; + sample_size = sc->alt_sample_size > 0 ? sc->alt_sample_size : sc->sample_sizes[current_sample]; if (sc->pseudo_stream_id == -1 || sc->stsc_data[stsc_index].id - 1 == sc->pseudo_stream_id) { AVIndexEntry *e = &st->index_entries[st->nb_index_entries++]; |