Skip to content

Instantly share code, notes, and snippets.

@wiedi

wiedi/sdl.diff Secret

Created December 11, 2016 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wiedi/15b71456667f7aa2a7f8815663723bb3 to your computer and use it in GitHub Desktop.
Save wiedi/15b71456667f7aa2a7f8815663723bb3 to your computer and use it in GitHub Desktop.
--- src/audio/sun/SDL_sunaudio.c.orig 2016-10-20 03:56:26.000000000 +0000
+++ src/audio/sun/SDL_sunaudio.c
@@ -193,6 +193,10 @@ SUNAUDIO_CloseDevice(_THIS)
static int
SUNAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
{
+#ifdef AUDIO_SETINFO
+ int enc;
+#endif
+ int desired_freq = 0;
const int flags = ((iscapture) ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT);
SDL_AudioFormat format = 0;
audio_info_t info;
@@ -220,10 +224,7 @@ SUNAUDIO_OpenDevice(_THIS, void *handle,
return SDL_SetError("Couldn't open %s: %s", devname, strerror(errno));
}
-#ifdef AUDIO_SETINFO
- int enc;
-#endif
- int desired_freq = this->spec.freq;
+ desired_freq = this->spec.freq;
/* Determine the audio parameters from the AudioSpec */
switch (SDL_AUDIO_BITSIZE(this->spec.format)) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment