# HG changeset patch # User Ryan C. Gordon # Date 1043977992 0 # Node ID 5b00e43ec23c26e42c42f727e4f122547f168787 # Parent 6d94441c854e4c7a33c823d1ec39933027d8aa26 Patches to make SDL_sound more Visual C happy. diff -r 6d94441c854e -r 5b00e43ec23c SDL_sound.c --- 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 #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); diff -r 6d94441c854e -r 5b00e43ec23c SDL_sound_internal.h --- 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; diff -r 6d94441c854e -r 5b00e43ec23c alt_audio_convert.c --- 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; diff -r 6d94441c854e -r 5b00e43ec23c alt_audio_convert.h --- 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 ); diff -r 6d94441c854e -r 5b00e43ec23c decoders/mpglib/layer3.c --- 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 #include #include "SDL_sound.h" diff -r 6d94441c854e -r 5b00e43ec23c decoders/mpglib/mpglib_sdlsound.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 +