Skip to content

Commit

Permalink
audio: Added a ThreadDeinit() method to match ThreadInit.
Browse files Browse the repository at this point in the history
Not used by any targets at the moment, but will be shortly!
  • Loading branch information
icculus committed Feb 13, 2017
1 parent 886736a commit 175f1e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/audio/SDL_audio.c
Expand Up @@ -221,6 +221,11 @@ SDL_AudioThreadInit_Default(_THIS)
{ /* no-op. */
}

static void
SDL_AudioThreadDeinit_Default(_THIS)
{ /* no-op. */
}

static void
SDL_AudioWaitDevice_Default(_THIS)
{ /* no-op. */
Expand Down Expand Up @@ -340,6 +345,7 @@ finish_audio_entry_points_init(void)
FILL_STUB(DetectDevices);
FILL_STUB(OpenDevice);
FILL_STUB(ThreadInit);
FILL_STUB(ThreadDeinit);
FILL_STUB(WaitDevice);
FILL_STUB(PlayDevice);
FILL_STUB(GetPendingBytes);
Expand Down Expand Up @@ -712,6 +718,8 @@ SDL_RunAudio(void *devicep)
/* Wait for the audio to drain. */
SDL_Delay(((device->spec.samples * 1000) / device->spec.freq) * 2);

current_audio.impl.ThreadDeinit(device);

return 0;
}

Expand Down Expand Up @@ -810,6 +818,8 @@ SDL_CaptureAudio(void *devicep)

current_audio.impl.FlushCapture(device);

current_audio.impl.ThreadDeinit(device);

return 0;
}

Expand Down
1 change: 1 addition & 0 deletions src/audio/SDL_sysaudio.h
Expand Up @@ -67,6 +67,7 @@ typedef struct SDL_AudioDriverImpl
void (*DetectDevices) (void);
int (*OpenDevice) (_THIS, void *handle, const char *devname, int iscapture);
void (*ThreadInit) (_THIS); /* Called by audio thread at start */
void (*ThreadDeinit) (_THIS); /* Called by audio thread at start */
void (*WaitDevice) (_THIS);
void (*PlayDevice) (_THIS);
int (*GetPendingBytes) (_THIS);
Expand Down

0 comments on commit 175f1e8

Please sign in to comment.