set bps to uncompressed original sound data for compressed audio
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Mon, 25 Feb 2008 12:00:31 +0000 (12:00 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Mon, 25 Feb 2008 12:00:31 +0000 (12:00 +0000)
according to aiff specs, qt set it to 16 for mace and ima4,
fail if block align is not set.

Originally committed as revision 12198 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/aiff.c

index dede1d6..4a57464 100644 (file)
@@ -189,7 +189,12 @@ static int aiff_write_header(AVFormatContext *s)
     put_be32(pb, 0);                    /* file length */
     put_tag(pb, aifc ? "AIFC" : "AIFF");
 
-    if (aifc) {
+    if (aifc) { // compressed audio
+        enc->bits_per_sample = 16;
+        if (!enc->block_align) {
+            av_log(s, AV_LOG_ERROR, "block align not set\n");
+            return -1;
+        }
         /* Version chunk */
         put_tag(pb, "FVER");
         put_be32(pb, 4);