Skip to content

Commit

Permalink
Patched to compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 26, 2002
1 parent 58c6020 commit 52186c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions alt_audio_convert.c
Expand Up @@ -346,9 +346,12 @@ static int convertStereoToMonoU8Bit( AdapterC Data, int length )
static int convertMonoToStereo16Bit( AdapterC Data, int length )
{
int i;
Uint16* buffer;
Uint16* dst;

length >>=1;
Uint16* buffer = (Uint16*)Data.buffer - 1;
Uint16* dst = (Uint16*)Data.buffer + 2*length - 2;
buffer = (Uint16*)Data.buffer - 1;
dst = (Uint16*)Data.buffer + 2*length - 2;
for( i = length + 1; --i; dst-=2 )
dst[0] = dst[1] = buffer[i];
return 4*length;
Expand Down Expand Up @@ -502,8 +505,8 @@ static int doubleRateMono( AdapterC Data, int length )
static int doubleRateStereo( AdapterC Data, int length )
{
Sint16* r;
fprintf( stderr, "\n Buffer: %8x length: %8x\n", Data.buffer, length );
RateConverterBuffer rcb;
fprintf( stderr, "\n Buffer: %8x length: %8x\n", Data.buffer, length );
initRateConverterBuffer( &rcb, &Data, length, Half );
doRateConversion( &rcb, doubleRate2 );
nextRateConverterBuffer( &rcb );
Expand Down Expand Up @@ -547,8 +550,8 @@ static int increaseRateMono( AdapterC Data, int length )
static int increaseRateStereo( AdapterC Data, int length )
{
Sint16* r;
fprintf( stderr, "\n Buffer: %8x length: %8x\n", Data.buffer, length );
RateConverterBuffer rcb;
fprintf( stderr, "\n Buffer: %8x length: %8x\n", Data.buffer, length );
initRateConverterBuffer( &rcb, &Data, length, Data.filter->ratio );
doRateConversion( &rcb, increaseRate2 );
nextRateConverterBuffer( &rcb );
Expand Down Expand Up @@ -1009,7 +1012,7 @@ static void show_AudioCVT( Sound_AudioCVT *Data )

int Sound_BuildAudioCVT(Sound_AudioCVT *Data,
Uint16 src_format, Uint8 src_channels, int src_rate,
Uint16 dst_format, Uint8 dst_channels, int dst_rate )
Uint16 dst_format, Uint8 dst_channels, int dst_rate, Uint32 bufsize)
{
SDL_AudioSpec src, dst;
int ret;
Expand Down
2 changes: 1 addition & 1 deletion alt_audio_convert.h
Expand Up @@ -83,7 +83,7 @@ extern SNDDECLSPEC int Sound_AltConvertAudio( Sound_AudioCVT *Data,

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 );
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 );
Expand Down

0 comments on commit 52186c2

Please sign in to comment.