ref: d6ae9c49f76e1617704eed3bbb1069292949e16c
parent: 61913c496aca4f67610d8da735c79cebed7d8662
author: Simon Howard <[email protected]>
date: Sun May 20 11:06:46 EDT 2007
Fix crash when converting audio down to a lower sample rate. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 883
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -101,7 +101,7 @@
wi_stuff.c wi_stuff.h \
w_checksum.c w_checksum.h \
w_wad.c w_wad.h \
-z_zone.c z_zone.h
+z_native.c z_zone.h
# source files needed for FEATURE_DEHACKED
--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -132,7 +132,8 @@
{
SDL_AudioCVT convertor;
- if (ConvertibleRatio(samplerate, mixer_freq)
+ if (samplerate <= mixer_freq
+ && ConvertibleRatio(samplerate, mixer_freq)
&& SDL_BuildAudioCVT(&convertor,
AUDIO_U8, 1, samplerate,
mixer_format, mixer_channels, mixer_freq))