pkgsrc/devel/SDL2/patches/patch-src_audio_netbsd_SDL__netbsdaudio.c
adam 7051c89f38 SDL2: update to 2.0.6
Changes 2.0.6:

General:
* Added cross-platform Vulkan graphics support in SDL_vulkan.h
        SDL_Vulkan_LoadLibrary()
        SDL_Vulkan_GetVkGetInstanceProcAddr()
        SDL_Vulkan_GetInstanceExtensions()
        SDL_Vulkan_CreateSurface()
        SDL_Vulkan_GetDrawableSize()
        SDL_Vulkan_UnloadLibrary()
  This is all the platform-specific code you need to bring up Vulkan on all SDL platforms. You can look at an example in test/testvulkan.c
* Added SDL_ComposeCustomBlendMode() to create custom blend modes for 2D rendering
* Added SDL_HasNEON() which returns whether the CPU has NEON instruction support
* Added support for many game controllers, including the Nintendo Switch Pro Controller
* Added support for inverted axes and separate axis directions in game controller mappings
* Added functions to return information about a joystick before it's opened:
        SDL_JoystickGetDeviceVendor()
        SDL_JoystickGetDeviceProduct()
        SDL_JoystickGetDeviceProductVersion()
        SDL_JoystickGetDeviceType()
        SDL_JoystickGetDeviceInstanceID()
* Added functions to return information about an open joystick:
        SDL_JoystickGetVendor()
        SDL_JoystickGetProduct()
        SDL_JoystickGetProductVersion()
        SDL_JoystickGetType()
        SDL_JoystickGetAxisInitialState()
* Added functions to return information about an open game controller:
        SDL_GameControllerGetVendor()
        SDL_GameControllerGetProduct()
        SDL_GameControllerGetProductVersion()
* Added SDL_GameControllerNumMappings() and SDL_GameControllerMappingForIndex() to be able to enumerate the built-in game controller mappings
* Added SDL_LoadFile() and SDL_LoadFile_RW() to load a file into memory
* Added SDL_DuplicateSurface() to make a copy of a surface
* Added an experimental JACK audio driver
* Implemented non-power-of-two audio resampling, optionally using libsamplerate to perform the resampling
* Added the hint SDL_HINT_AUDIO_RESAMPLING_MODE to control the quality of resampling
* Added the hint SDL_HINT_RENDER_LOGICAL_SIZE_MODE to control the scaling policy for SDL_RenderSetLogicalSize():
        "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen (the default)
        "1" or "overscan"  - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen
* Added the hints SDL_HINT_MOUSE_NORMAL_SPEED_SCALE and SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE to scale the mouse speed when being read from raw mouse input
* Added the hint SDL_HINT_TOUCH_MOUSE_EVENTS to control whether SDL will synthesize mouse events from touch events
2017-09-26 13:10:56 +00:00

56 lines
2.1 KiB
C

$NetBSD: patch-src_audio_netbsd_SDL__netbsdaudio.c,v 1.1 2017/09/26 13:10:56 adam Exp $
Remove delay as there is already an inherent delay in writing audio.
https://bugzilla.libsdl.org/show_bug.cgi?id=3177
audio_prinfo needs 'struct' on NetBSD.
Use correct prinfo.
Inform upper layer of blocksize
--- src/audio/netbsd/SDL_netbsdaudio.c.orig 2017-09-26 12:34:35.000000000 +0000
+++ src/audio/netbsd/SDL_netbsdaudio.c
@@ -63,14 +63,14 @@ NETBSDAUDIO_Status(_THIS)
#ifdef DEBUG_AUDIO
/* *INDENT-OFF* */
audio_info_t info;
- const audio_prinfo *prinfo;
+ const struct audio_prinfo *prinfo;
if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) {
fprintf(stderr, "AUDIO_GETINFO failed.\n");
return;
}
- prinfo = this->iscapture ? &info.play : &info.record;
+ prinfo = this->iscapture ? &info.record : &info.play;
fprintf(stderr, "\n"
"[%s info]\n"
@@ -184,10 +184,6 @@ NETBSDAUDIO_PlayDevice(_THIS)
fprintf(stderr, "Wrote %d bytes of audio data\n", written);
#endif
- if (p < this->hidden->mixlen
- || ((written < 0) && ((errno == 0) || (errno == EAGAIN)))) {
- SDL_Delay(1); /* Let a little CPU time go by */
- }
} while (p < this->hidden->mixlen);
/* If timer synchronization is enabled, set the next write frame */
@@ -274,7 +270,7 @@ NETBSDAUDIO_OpenDevice(_THIS, void *hand
const int flags = iscapture ? OPEN_FLAGS_INPUT : OPEN_FLAGS_OUTPUT;
SDL_AudioFormat format = 0;
audio_info_t info;
- audio_prinfo *prinfo = iscapture ? &info.play : &info.record;
+ struct audio_prinfo *prinfo = iscapture ? &info.record : &info.play;
/* We don't care what the devname is...we'll try to open anything. */
/* ...but default to first name in the list... */
@@ -366,6 +362,7 @@ NETBSDAUDIO_OpenDevice(_THIS, void *hand
(void) ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info);
(void) ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info);
this->spec.freq = prinfo->sample_rate;
+ this->spec.size = info.blocksize;
if (!iscapture) {
/* Allocate mixing buffer */