Skip to content
Permalink
Browse files

Fixed bug #73

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 e6fc431efcf17d3b31e6c644d1b255f5e579701d
Showing with 10 additions and 2 deletions.
  1. +1 −1 configure.in
  2. +9 −1 wavestream.c
@@ -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!])
@@ -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);
}
}
}
}
@@ -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.