changeset 3906:b3a0c732d0d7 libavformat

set default bps to 16 in wav header
author bcoudurier
date Sun, 07 Sep 2008 04:17:15 +0000
parents 91987686113d
children 7c71e9cabf0e
files riff.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/riff.c	Sun Sep 07 01:25:47 2008 +0000
+++ b/riff.c	Sun Sep 07 04:17:15 2008 +0000
@@ -248,7 +248,8 @@
     } else if (enc->codec_id == CODEC_ID_ADPCM_IMA_WAV || enc->codec_id == CODEC_ID_ADPCM_MS || enc->codec_id == CODEC_ID_ADPCM_G726 || enc->codec_id == CODEC_ID_ADPCM_YAMAHA) { //
         bps = 4;
     } else {
-        bps = av_get_bits_per_sample(enc->codec_id);
+        if (!(bps = av_get_bits_per_sample(enc->codec_id)))
+            bps = 16; // default to 16
     }
     if(bps != enc->bits_per_sample && enc->bits_per_sample){
         av_log(enc, AV_LOG_WARNING, "requested bits_per_sample (%d) and actually stored (%d) differ\n", enc->bits_per_sample, bps);