aiffdec: do not set bit rate if block duration is unknown
authorJustin Ruggles <justin.ruggles@gmail.com>
Wed, 21 Mar 2012 18:30:33 +0000 (14:30 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Thu, 22 Mar 2012 15:45:36 +0000 (11:45 -0400)
CC: libav-stable@libav.org
libavformat/aiffdec.c

index 11bbcac..bbac1ab 100644 (file)
@@ -157,8 +157,10 @@ static unsigned int get_aiff_header(AVFormatContext *s, int size,
     if (!codec->block_align)
         codec->block_align = (codec->bits_per_coded_sample * codec->channels) >> 3;
 
     if (!codec->block_align)
         codec->block_align = (codec->bits_per_coded_sample * codec->channels) >> 3;
 
-    codec->bit_rate = codec->sample_rate * (codec->block_align << 3) /
-                      aiff->block_duration;
+    if (aiff->block_duration) {
+        codec->bit_rate = codec->sample_rate * (codec->block_align << 3) /
+                          aiff->block_duration;
+    }
 
     /* Chunk is over */
     if (size)
 
     /* Chunk is over */
     if (size)