[chocolate-doom] 37/83: Remove debug messages, send error messages to stderr Fix overflow when playing large sound files
Jonathan Dowland
jmtd at moszumanska.debian.org
Mon Jan 30 15:06:24 UTC 2017
This is an automated email from the git hooks/post-receive script.
jmtd pushed a commit to annotated tag chocolate-doom-0.0.1
in repository chocolate-doom.
commit 5673503ff3524db56ae73cbe29ad0a2571beb657
Author: Simon Howard <fraggle at gmail.com>
Date: Sat Aug 6 17:05:51 2005 +0000
Remove debug messages, send error messages to stderr
Fix overflow when playing large sound files
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 43
---
src/i_sound.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/i_sound.c b/src/i_sound.c
index 263f31d..2b1ef9b 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");
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/chocolate-doom.git
More information about the Pkg-games-commits
mailing list