changeset 1276:bc0b7f4637f0 libavformat

fix mac3audio.mov, pcm_s8 and pcm_u8 can only have sample size of 1 and only if mono, dont rely on bits per sample which can be wrong
author bcoudurier
date Thu, 24 Aug 2006 18:39:57 +0000
parents 5ded82940d38
children e27e94ac0c4b
files mov.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mov.c	Thu Aug 24 14:22:40 2006 +0000
+++ b/mov.c	Thu Aug 24 18:39:57 2006 +0000
@@ -1598,7 +1598,7 @@
                 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)
+            if (sc->sample_size > 1 || st->codec->codec_id == CODEC_ID_PCM_U8 || st->codec->codec_id == CODEC_ID_PCM_S8)
                 chunk_size = chunk_samples * sc->sample_size;
             else if (sc->sample_size_v1.den > 0 && (chunk_samples * sc->sample_size_v1.num % sc->sample_size_v1.den == 0))
                 chunk_size = chunk_samples * sc->sample_size_v1.num / sc->sample_size_v1.den;