changeset 441:5b00e43ec23c

Patches to make SDL_sound more Visual C happy.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 31 Jan 2003 01:53:12 +0000
parents 6d94441c854e
children 6800c239cc93
files SDL_sound.c SDL_sound_internal.h alt_audio_convert.c alt_audio_convert.h decoders/mpglib/layer3.c decoders/mpglib/mpglib_sdlsound.h
diffstat 6 files changed, 23 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/SDL_sound.c	Sun Jan 12 22:06:38 2003 +0000
+++ b/SDL_sound.c	Fri Jan 31 01:53:12 2003 +0000
@@ -38,6 +38,7 @@
 #include <ctype.h>
 
 #include "SDL.h"
+#include "SDL_thread.h"
 #include "SDL_sound.h"
 
 #define __SDL_SOUND_INTERNAL__
@@ -389,7 +390,7 @@
 Uint32 __Sound_convertMsToBytePos(Sound_AudioInfo *info, Uint32 ms)
 {
     /* "frames" == "sample frames" */
-    float frames_per_ms = ((float) info->rate) / 1000.0;
+    float frames_per_ms = ((float) info->rate) / 1000.0f;
     Uint32 frame_offset = (Uint32) (frames_per_ms * ((float) ms));
     Uint32 frame_size = (Uint32) ((info->format & 0xFF) / 8) * info->channels;
     return(frame_offset * frame_size);
--- a/SDL_sound_internal.h	Sun Jan 12 22:06:38 2003 +0000
+++ b/SDL_sound_internal.h	Fri Jan 31 01:53:12 2003 +0000
@@ -236,6 +236,15 @@
 } Sound_AudioCVT;
 #endif
 
+extern SNDDECLSPEC int Sound_BuildAudioCVT(Sound_AudioCVT *cvt,
+                        Uint16 src_format, Uint8 src_channels, Uint32 src_rate,
+                        Uint16 dst_format, Uint8 dst_channels, Uint32 dst_rate,
+                        Uint32 dst_size);
+
+extern SNDDECLSPEC int Sound_ConvertAudio(Sound_AudioCVT *cvt);
+
+
+
 typedef struct __SOUND_SAMPLEINTERNAL__
 {
     Sound_Sample *next;
--- a/alt_audio_convert.c	Sun Jan 12 22:06:38 2003 +0000
+++ b/alt_audio_convert.c	Fri Jan 31 01:53:12 2003 +0000
@@ -1011,8 +1011,8 @@
 
 
 int Sound_BuildAudioCVT(Sound_AudioCVT *Data,
-    Uint16 src_format, Uint8 src_channels, int src_rate,
-    Uint16 dst_format, Uint8 dst_channels, int dst_rate, Uint32 bufsize)
+    Uint16 src_format, Uint8 src_channels, Uint32 src_rate,
+    Uint16 dst_format, Uint8 dst_channels, Uint32 dst_rate, Uint32 bufsize)
 {
     SDL_AudioSpec src, dst;
     int ret;
--- a/alt_audio_convert.h	Sun Jan 12 22:06:38 2003 +0000
+++ b/alt_audio_convert.h	Fri Jan 31 01:53:12 2003 +0000
@@ -76,15 +76,9 @@
 #define SNDDECLSPEC DECLSPEC
 #endif
 
-extern SNDDECLSPEC int Sound_ConvertAudio( Sound_AudioCVT *Data );
-
 extern SNDDECLSPEC int Sound_AltConvertAudio( Sound_AudioCVT *Data,
     Uint8* buffer, int length, int mode );
 
-extern SNDDECLSPEC int Sound_BuildAudioCVT( Sound_AudioCVT *Data,
-   Uint16 src_format, Uint8 src_channels, int src_rate,
-   Uint16 dst_format, Uint8 dst_channels, int dst_rate, Uint32 bufsize );
-
 extern SNDDECLSPEC int Sound_AltBuildAudioCVT( Sound_AudioCVT *Data,
    SDL_AudioSpec src, SDL_AudioSpec dst );
 
--- a/decoders/mpglib/layer3.c	Sun Jan 12 22:06:38 2003 +0000
+++ b/decoders/mpglib/layer3.c	Fri Jan 31 01:53:12 2003 +0000
@@ -5,6 +5,7 @@
  * All rights reserved. See also 'README'
  */ 
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "SDL_sound.h"
--- a/decoders/mpglib/mpglib_sdlsound.h	Sun Jan 12 22:06:38 2003 +0000
+++ b/decoders/mpglib/mpglib_sdlsound.h	Fri Jan 31 01:53:12 2003 +0000
@@ -1,3 +1,10 @@
+
+#ifndef _INCLUDE_MPGLIB_SDLSOUND_H_
+#define _INCLUDE_MPGLIB_SDLSOUND_H_
+
+#ifdef _MSC_VER
+    #define snprintf _snprintf
+#endif
 
 struct buf {
 	unsigned char *pnt;
@@ -51,4 +58,6 @@
 }
 #endif
 
+#endif
 
+