Bläddra i källkod

dummyaudio: SDL3ify style

Ryan C. Gordon 1 år sedan
förälder
incheckning
c3f5a5fc72
2 ändrade filer med 8 tillägg och 9 borttagningar
  1. 5 5
      src/audio/dummy/SDL_dummyaudio.c
  2. 3 4
      src/audio/dummy/SDL_dummyaudio.h

+ 5 - 5
src/audio/dummy/SDL_dummyaudio.c

@@ -20,12 +20,12 @@
 */
 #include "SDL_internal.h"
 
-/* Output audio to nowhere... */
+// Output audio to nowhere...
 
 #include "../SDL_audio_c.h"
 #include "SDL_dummyaudio.h"
 
-/* !!! FIXME: this should be an SDL hint, not an environment variable. */
+// !!! FIXME: this should be an SDL hint, not an environment variable.
 #define DUMMYENVR_IODELAY "SDL_DUMMYAUDIODELAY"
 
 static void DUMMYAUDIO_WaitDevice(SDL_AudioDevice *device)
@@ -49,9 +49,9 @@ static int DUMMYAUDIO_OpenDevice(SDL_AudioDevice *device)
         }
     }
 
-    device->hidden->io_delay = envr ? SDL_atoi(envr) : ((device->sample_frames * 1000) / device->spec.freq);
+    device->hidden->io_delay = (Uint32) (envr ? SDL_atoi(envr) : ((device->sample_frames * 1000) / device->spec.freq));
 
-    return 0; /* we're good; don't change reported device format. */
+    return 0; // we're good; don't change reported device format.
 }
 
 static void DUMMYAUDIO_CloseDevice(SDL_AudioDevice *device)
@@ -70,7 +70,7 @@ static Uint8 *DUMMYAUDIO_GetDeviceBuf(SDL_AudioDevice *device, int *buffer_size)
 
 static int DUMMYAUDIO_CaptureFromDevice(SDL_AudioDevice *device, void *buffer, int buflen)
 {
-    /* always return a full buffer of silence. */
+    // always return a full buffer of silence.
     SDL_memset(buffer, device->silence_value, buflen);
     return buflen;
 }

+ 3 - 4
src/audio/dummy/SDL_dummyaudio.h

@@ -27,9 +27,8 @@
 
 struct SDL_PrivateAudioData
 {
-    /* The file descriptor for the audio device */
-    Uint8 *mixbuf;
-    Uint32 io_delay;
+    Uint8 *mixbuf;   // The file descriptor for the audio device
+    Uint32 io_delay; // miliseconds to sleep in WaitDevice.
 };
 
-#endif /* SDL_dummyaudio_h_ */
+#endif // SDL_dummyaudio_h_