ref: fe4d6628ab50158cd5f47d1126ee0dec4fc50ae4
parent: 707ae6e5bee8fb4dcd24b39ff71c072c0e29e02d
author: menno <menno>
date: Sat Aug 17 07:17:39 EDT 2002
small changes in audio writing
--- a/frontend/audio.c
+++ b/frontend/audio.c
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: audio.c,v 1.7 2002/08/14 10:55:28 menno Exp $
+** $Id: audio.c,v 1.8 2002/08/17 11:17:39 menno Exp $
**/
#ifdef _WIN32
@@ -123,7 +123,6 @@
unsigned int bytes = (aufile->bits_per_sample + 7) / 8;
float data_size = (float)bytes * aufile->samples;
unsigned long word32;
- int ret;
*p++ = 'R'; *p++ = 'I'; *p++ = 'F'; *p++ = 'F';
@@ -177,9 +176,7 @@
*p++ = (unsigned char)(word32 >> 16);
*p++ = (unsigned char)(word32 >> 24);
- ret = fwrite(header, sizeof(header), 1, aufile->sndfile);
-
- return ret;
+ return fwrite(header, sizeof(header), 1, aufile->sndfile);
}
static int write_audio_16bit(audio_file *aufile, void *sample_buffer,
@@ -194,8 +191,8 @@
for (i = 0; i < samples; i++)
{
- data[i*2] = sample_buffer16[i] & 0xFF;
- data[i*2+1] = (sample_buffer16[i] >> 8) & 0xFF;
+ data[i*2] = (char)(sample_buffer16[i] & 0xFF);
+ data[i*2+1] = (char)((sample_buffer16[i] >> 8) & 0xFF);
}
ret = fwrite(data, samples, aufile->bits_per_sample/8, aufile->sndfile);
@@ -217,9 +214,9 @@
for (i = 0; i < samples; i++)
{
- data[i*3] = sample_buffer24[i] & 0xFF;
- data[i*3+1] = (sample_buffer24[i] >> 8) & 0xFF;
- data[i*3+2] = (sample_buffer24[i] >> 16) & 0xFF;
+ data[i*3] = (char)(sample_buffer24[i] & 0xFF);
+ data[i*3+1] = (char)((sample_buffer24[i] >> 8) & 0xFF);
+ data[i*3+2] = (char)((sample_buffer24[i] >> 16) & 0xFF);
}
ret = fwrite(data, samples, aufile->bits_per_sample/8, aufile->sndfile);
@@ -241,10 +238,10 @@
for (i = 0; i < samples; i++)
{
- data[i*4] = sample_buffer32[i] & 0xFF;
- data[i*4+1] = (sample_buffer32[i] >> 8) & 0xFF;
- data[i*4+2] = (sample_buffer32[i] >> 16) & 0xFF;
- data[i*4+3] = (sample_buffer32[i] >> 24) & 0xFF;
+ data[i*4] = (char)(sample_buffer32[i] & 0xFF);
+ data[i*4+1] = (char)((sample_buffer32[i] >> 8) & 0xFF);
+ data[i*4+2] = (char)((sample_buffer32[i] >> 16) & 0xFF);
+ data[i*4+3] = (char)((sample_buffer32[i] >> 24) & 0xFF);
}
ret = fwrite(data, samples, aufile->bits_per_sample/8, aufile->sndfile);
@@ -278,7 +275,7 @@
in *= -1.0;
negative = 1;
}
- in = frexp(in, &exponent);
+ in = (float)frexp(in, &exponent);
exponent += 126;
in *= (float)0x1000000;
mantissa = (((int)in) & 0x7FFFFF);
--- a/frontend/faad.dsp
+++ b/frontend/faad.dsp
@@ -66,7 +66,7 @@
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../include" /I "../common/mp4v2" /I "../common/faad" /I "../common/libsndfile/src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../include" /I "../common/mp4v2" /I "../common/faad" /I "../common/libsndfile/src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x413 /d "_DEBUG"
# ADD RSC /l 0x413 /d "_DEBUG"
BSC32=bscmake.exe