Skip to content

Commit bcfac0f

Browse files
committed
wasapi: Minor style tweaks.
1 parent 641deb9 commit bcfac0f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/audio/wasapi/SDL_wasapi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,8 +728,7 @@ static bool mgmtthrtask_PrepDevice(void *userdata)
728728

729729
newspec.freq = waveformat->nSamplesPerSec;
730730

731-
if (device->recording && device->hidden->isplayback)
732-
{
731+
if (device->recording && device->hidden->isplayback) {
733732
streamflags |= AUDCLNT_STREAMFLAGS_LOOPBACK;
734733
}
735734

src/core/windows/SDL_immdevice.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static SDL_AudioDevice *SDL_IMMDevice_Add(const bool recording, const char *devn
147147

148148
if (!device) {
149149
// handle is freed by SDL_IMMDevice_FreeDeviceHandle!
150-
SDL_IMMDevice_HandleData *handle = (SDL_IMMDevice_HandleData *)SDL_malloc(sizeof(SDL_IMMDevice_HandleData));
150+
SDL_IMMDevice_HandleData *handle = (SDL_IMMDevice_HandleData *)SDL_calloc(1, sizeof(*handle));
151151
if (!handle) {
152152
return NULL;
153153
}
@@ -156,7 +156,7 @@ static SDL_AudioDevice *SDL_IMMDevice_Add(const bool recording, const char *devn
156156
SDL_free(handle);
157157
return NULL;
158158
}
159-
SDL_memcpy(&handle->directsound_guid, dsoundguid, sizeof(GUID));
159+
SDL_copyp(&handle->directsound_guid, &dsoundguid);
160160

161161
SDL_AudioSpec spec;
162162
SDL_zero(spec);
@@ -168,7 +168,7 @@ static SDL_AudioDevice *SDL_IMMDevice_Add(const bool recording, const char *devn
168168

169169
if (!recording && supports_recording_playback_devices) {
170170
// handle is freed by SDL_IMMDevice_FreeDeviceHandle!
171-
SDL_IMMDevice_HandleData *recording_handle = (SDL_IMMDevice_HandleData *)SDL_malloc(sizeof(SDL_IMMDevice_HandleData));
171+
SDL_IMMDevice_HandleData *recording_handle = (SDL_IMMDevice_HandleData *)SDL_malloc(sizeof(*recording_handle));
172172
if (!recording_handle) {
173173
return NULL;
174174
}

0 commit comments

Comments
 (0)