audio: Added a ThreadDeinit() method to match ThreadInit.
authorRyan C. Gordon
Mon, 13 Feb 2017 16:55:00 -0500
changeset 108823f210b3522a3
parent 10881 2a8921196432
child 10883 c6b2a9e91f91
audio: Added a ThreadDeinit() method to match ThreadInit.

Not used by any targets at the moment, but will be shortly!
src/audio/SDL_audio.c
src/audio/SDL_sysaudio.h
     1.1 --- a/src/audio/SDL_audio.c	Sat Feb 11 16:38:16 2017 -0800
     1.2 +++ b/src/audio/SDL_audio.c	Mon Feb 13 16:55:00 2017 -0500
     1.3 @@ -222,6 +222,11 @@
     1.4  }
     1.5  
     1.6  static void
     1.7 +SDL_AudioThreadDeinit_Default(_THIS)
     1.8 +{                               /* no-op. */
     1.9 +}
    1.10 +
    1.11 +static void
    1.12  SDL_AudioWaitDevice_Default(_THIS)
    1.13  {                               /* no-op. */
    1.14  }
    1.15 @@ -340,6 +345,7 @@
    1.16      FILL_STUB(DetectDevices);
    1.17      FILL_STUB(OpenDevice);
    1.18      FILL_STUB(ThreadInit);
    1.19 +    FILL_STUB(ThreadDeinit);
    1.20      FILL_STUB(WaitDevice);
    1.21      FILL_STUB(PlayDevice);
    1.22      FILL_STUB(GetPendingBytes);
    1.23 @@ -712,6 +718,8 @@
    1.24      /* Wait for the audio to drain. */
    1.25      SDL_Delay(((device->spec.samples * 1000) / device->spec.freq) * 2);
    1.26  
    1.27 +    current_audio.impl.ThreadDeinit(device);
    1.28 +
    1.29      return 0;
    1.30  }
    1.31  
    1.32 @@ -810,6 +818,8 @@
    1.33  
    1.34      current_audio.impl.FlushCapture(device);
    1.35  
    1.36 +    current_audio.impl.ThreadDeinit(device);
    1.37 +
    1.38      return 0;
    1.39  }
    1.40  
     2.1 --- a/src/audio/SDL_sysaudio.h	Sat Feb 11 16:38:16 2017 -0800
     2.2 +++ b/src/audio/SDL_sysaudio.h	Mon Feb 13 16:55:00 2017 -0500
     2.3 @@ -67,6 +67,7 @@
     2.4      void (*DetectDevices) (void);
     2.5      int (*OpenDevice) (_THIS, void *handle, const char *devname, int iscapture);
     2.6      void (*ThreadInit) (_THIS); /* Called by audio thread at start */
     2.7 +    void (*ThreadDeinit) (_THIS); /* Called by audio thread at start */
     2.8      void (*WaitDevice) (_THIS);
     2.9      void (*PlayDevice) (_THIS);
    2.10      int (*GetPendingBytes) (_THIS);