audio: Moved a variable into nested scope where it's actually used.

This commit is contained in:
Ryan C. Gordon
2026-02-11 14:54:14 -05:00
parent eaeca340f3
commit ac3afa1f38

View File

@@ -2464,11 +2464,9 @@ void SDL_DefaultAudioDeviceChanged(SDL_AudioDevice *new_default_device)
SDL_SetAudioPostmixCallback(logdev->instance_id, logdev->postmix, logdev->postmix_userdata);
SDL_PendingAudioDeviceEvent *p;
// Queue an event for each logical device we moved.
if (spec_changed) {
p = (SDL_PendingAudioDeviceEvent *)SDL_malloc(sizeof(SDL_PendingAudioDeviceEvent));
SDL_PendingAudioDeviceEvent *p = (SDL_PendingAudioDeviceEvent *)SDL_malloc(sizeof(SDL_PendingAudioDeviceEvent));
if (p) { // if this failed, no event for you, but you have deeper problems anyhow.
p->type = SDL_EVENT_AUDIO_DEVICE_FORMAT_CHANGED;
p->devid = logdev->instance_id;