Skip to content

Commit

Permalink
Fixed bug #73
Browse files Browse the repository at this point in the history
Date: Tue, 15 Apr 2003 23:36:17 +0300
From: King Of The Bongo
Subject: [SDL] SDL_mixer patch

Hi, this is modified version of wavestream.c

When you call Mix_VolumeMusic (volume) and play PCM wav stream it does
not apply and the wav file plays with the old values.
  • Loading branch information
slouken committed May 9, 2006
1 parent 0228924 commit e6fc431
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configure.in
Expand Up @@ -99,7 +99,7 @@ $srcdir/mixer.c \
$srcdir/music.c"

dnl Check for SDL
SDL_VERSION=1.2.4
SDL_VERSION=1.2.10
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
Expand Down
10 changes: 9 additions & 1 deletion wavestream.c
Expand Up @@ -195,10 +195,17 @@ void WAVStream_PlaySome(Uint8 *stream, int len)
SDL_ConvertAudio(&music->cvt);
SDL_MixAudio(stream, music->cvt.buf, music->cvt.len_cvt, wavestream_volume);
} else {
Uint8 *data;
if ( (music->stop - pos) < len ) {
len = (music->stop - pos);
}
fread(stream, len, 1, music->wavefp);
data = SDL_stack_alloc(Uint8, len);
if (data)
{
fread(data, len, 1, music->wavefp);
SDL_MixAudio(stream, data, len, wavestream_volume);
SDL_stack_free(data);
}
}
}
}
Expand Down Expand Up @@ -535,3 +542,4 @@ static FILE *LoadAIFFStream (const char *file, SDL_AudioSpec *spec,
}
return(wavefp);
}

0 comments on commit e6fc431

Please sign in to comment.