openbsd-ports/devel/sdl/patches/patch-src_audio_SDL_audio_c
pvalchev 4967057365 update to sdl-1.2.12. long due update, possible now since the macppc
X acceleration bug is now gone (thanks for ajacoutot for endless testing
of this issue), diff from brad
2007-09-22 01:12:38 +00:00

25 lines
1.1 KiB
Plaintext

$OpenBSD: patch-src_audio_SDL_audio_c,v 1.12 2007/09/22 01:12:38 pvalchev Exp $
--- src/audio/SDL_audio.c.orig Fri Jul 20 01:52:10 2007
+++ src/audio/SDL_audio.c Sat Sep 8 21:39:59 2007
@@ -518,8 +518,9 @@ int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpe
/* See if we need to do any conversion */
if ( obtained != NULL ) {
- SDL_memcpy(obtained, &audio->spec, sizeof(audio->spec));
- } else if ( desired->freq != audio->spec.freq ||
+ SDL_memcpy(obtained, desired, sizeof(audio->spec));
+ }
+ if ( desired->freq != audio->spec.freq ||
desired->format != audio->spec.format ||
desired->channels != audio->spec.channels ) {
/* Build an audio conversion block */
@@ -532,7 +533,7 @@ int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpe
return(-1);
}
if ( audio->convert.needed ) {
- audio->convert.len = (int) ( ((double) desired->size) /
+ audio->convert.len = (int) ( ((double) audio->spec.size) /
audio->convert.len_ratio );
audio->convert.buf =(Uint8 *)SDL_AllocAudioMem(
audio->convert.len*audio->convert.len_mult);