summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2005-08-06 17:05:51 +0000
committerSimon Howard2005-08-06 17:05:51 +0000
commit5673503ff3524db56ae73cbe29ad0a2571beb657 (patch)
treee0ffd06eb87f856f22df8d8481aaeb489ca5099c /src
parentd2c5206b1489770c37504426c6d7e9448287479e (diff)
downloadchocolate-doom-5673503ff3524db56ae73cbe29ad0a2571beb657.tar.gz
chocolate-doom-5673503ff3524db56ae73cbe29ad0a2571beb657.tar.bz2
chocolate-doom-5673503ff3524db56ae73cbe29ad0a2571beb657.zip
Remove debug messages, send error messages to stderr
Fix overflow when playing large sound files Subversion-branch: /trunk/chocolate-doom Subversion-revision: 43
Diffstat (limited to 'src')
-rw-r--r--src/i_sound.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/i_sound.c b/src/i_sound.c
index 263f31d5..2b1ef9be 100644
--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_sound.c 42 2005-08-05 17:53:07Z fraggle $
+// $Id: i_sound.c 43 2005-08-06 17:05:51Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,10 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.8 2005/08/06 17:05:51 fraggle
+// Remove debug messages, send error messages to stderr
+// Fix overflow when playing large sound files
+//
// Revision 1.7 2005/08/05 17:53:07 fraggle
// More sensible defaults
//
@@ -51,7 +55,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_sound.c 42 2005-08-05 17:53:07Z fraggle $";
+rcsid[] = "$Id: i_sound.c 43 2005-08-06 17:05:51Z fraggle $";
#include <stdio.h>
#include <stdlib.h>
@@ -129,7 +133,7 @@ static Mix_Chunk *getsfx(int sound)
sound_chunks[sound].allocated = 1;
sound_chunks[sound].abuf = expand_sound_data(data + 8, samplerate, length);
- sound_chunks[sound].alen = (length * 2 * 22050) / samplerate;
+ sound_chunks[sound].alen = (length * 2) * (22050 / samplerate);
sound_chunks[sound].volume = 32;
}
@@ -294,13 +298,13 @@ I_InitSound()
{
if (SDL_Init(SDL_INIT_AUDIO) < 0)
{
- printf("Unable to set up sound.\n");
+ fprintf(stderr, "Unable to set up sound.\n");
return;
}
if (Mix_OpenAudio(22050, AUDIO_U8, 2, 1024) < 0)
{
- printf("Error initialising SDL_mixer: %s\n", SDL_GetError());
+ fprintf(stderr, "Error initialising SDL_mixer: %s\n", SDL_GetError());
}
Mix_AllocateChannels(16);
@@ -308,8 +312,6 @@ I_InitSound()
sound_initialised = 1;
SDL_PauseAudio(0);
-
- printf("sound started.\n");
}