openbsd-ports/devel/sdl/patches/patch-src_audio_SDL_audio_c

25 lines
1.1 KiB
Plaintext
Raw Normal View History

$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
2007-08-14 11:51:07 -04:00
/* See if we need to do any conversion */
if ( obtained != NULL ) {
- SDL_memcpy(obtained, &audio->spec, sizeof(audio->spec));
2007-08-14 11:51:07 -04:00
- } else if ( desired->freq != audio->spec.freq ||
+ SDL_memcpy(obtained, desired, sizeof(audio->spec));
2007-08-14 11:51:07 -04:00
+ }
+ 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
2007-08-14 11:51:07 -04:00
return(-1);
}
if ( audio->convert.needed ) {
- audio->convert.len = (int) ( ((double) desired->size) /
2007-08-14 11:51:07 -04:00
+ audio->convert.len = (int) ( ((double) audio->spec.size) /
audio->convert.len_ratio );
2007-08-14 11:51:07 -04:00
audio->convert.buf =(Uint8 *)SDL_AllocAudioMem(
audio->convert.len*audio->convert.len_mult);