diff --git a/apu/apu.cpp b/apu/apu.cpp index a3b8f08a..5d6b6522 100644 --- a/apu/apu.cpp +++ b/apu/apu.cpp @@ -120,10 +120,6 @@ int S9xGetSampleCount(void) return spc::resampler->avail(); } -void S9xFinalizeSamples(void) -{ -} - void S9xLandSamples(void) { if (spc::callback != NULL) diff --git a/apu/apu.h b/apu/apu.h index f2c7a386..acdf8c1a 100644 --- a/apu/apu.h +++ b/apu/apu.h @@ -24,7 +24,6 @@ void S9xAPUExecute (void); void S9xAPUEndScanline (void); void S9xAPUSetReferenceTime (int32); void S9xAPUTimingSetSpeedup (int); -void S9xAPUAllowTimeOverflow (bool); void S9xAPULoadState (uint8 *); void S9xAPULoadBlarggState(uint8 *oldblock); void S9xAPUSaveState (uint8 *); @@ -39,7 +38,6 @@ int S9xGetSampleCount (void); void S9xSetSoundControl (uint8); void S9xSetSoundMute (bool8); void S9xLandSamples (void); -void S9xFinalizeSamples (void); void S9xClearSamples (void); bool8 S9xMixSamples (uint8 *, int); void S9xSetSamplesAvailableCallback (apu_callback, void *); diff --git a/gtk/src/gtk_sound_driver_alsa.cpp b/gtk/src/gtk_sound_driver_alsa.cpp index 558ff21a..7fa50967 100644 --- a/gtk/src/gtk_sound_driver_alsa.cpp +++ b/gtk/src/gtk_sound_driver_alsa.cpp @@ -176,7 +176,6 @@ void S9xAlsaSoundDriver::samples_available() output_buffer_size); } - S9xFinalizeSamples(); int snes_frames_available = S9xGetSampleCount() >> 1; if (Settings.DynamicRateControl && !Settings.SoundSync) diff --git a/gtk/src/gtk_sound_driver_oss.cpp b/gtk/src/gtk_sound_driver_oss.cpp index 68a0a851..3eb09533 100644 --- a/gtk/src/gtk_sound_driver_oss.cpp +++ b/gtk/src/gtk_sound_driver_oss.cpp @@ -164,8 +164,6 @@ void S9xOSSSoundDriver::samples_available() S9xUpdateDynamicRate(info.bytes, output_buffer_size); } - S9xFinalizeSamples(); - samples_to_write = S9xGetSampleCount(); if (Settings.DynamicRateControl && !Settings.SoundSync) diff --git a/gtk/src/gtk_sound_driver_portaudio.cpp b/gtk/src/gtk_sound_driver_portaudio.cpp index 9d5c6579..07bb263d 100644 --- a/gtk/src/gtk_sound_driver_portaudio.cpp +++ b/gtk/src/gtk_sound_driver_portaudio.cpp @@ -187,7 +187,6 @@ void S9xPortAudioSoundDriver::samples_available() S9xUpdateDynamicRate(frames_to_bytes(frames), output_buffer_size); } - S9xFinalizeSamples(); int snes_frames_available = S9xGetSampleCount() >> 1; if (Settings.DynamicRateControl && !Settings.SoundSync) diff --git a/gtk/src/gtk_sound_driver_pulse.cpp b/gtk/src/gtk_sound_driver_pulse.cpp index 87342216..925f6b0e 100644 --- a/gtk/src/gtk_sound_driver_pulse.cpp +++ b/gtk/src/gtk_sound_driver_pulse.cpp @@ -224,8 +224,6 @@ void S9xPulseSoundDriver::samples_available() S9xUpdateDynamicRate(bytes, buffer_size); } - S9xFinalizeSamples(); - samples = S9xGetSampleCount(); if (Settings.DynamicRateControl && !Settings.SoundSync) diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index 749fdf23..462bd9dd 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -612,7 +612,6 @@ static void S9xAudioCallback(void*) // This is called every time 128 to 132 samples are generated, which happens about 8 times per frame. A buffer size of 256 samples is enough here. static int16_t audio_buf[BUFFER_SIZE]; - S9xFinalizeSamples(); size_t avail = S9xGetSampleCount(); while (avail >= BUFFER_SIZE) { diff --git a/win32/CXAudio2.cpp b/win32/CXAudio2.cpp index 48bc24ca..dea82021 100644 --- a/win32/CXAudio2.cpp +++ b/win32/CXAudio2.cpp @@ -288,8 +288,6 @@ void CXAudio2::ProcessSound() S9xUpdateDynamicRate(freeBytes, sum_bufferSize); } - S9xFinalizeSamples(); - UINT32 availableSamples; availableSamples = S9xGetSampleCount(); diff --git a/win32/IS9xSoundOutput.h b/win32/IS9xSoundOutput.h index d108a5fa..528bd09d 100644 --- a/win32/IS9xSoundOutput.h +++ b/win32/IS9xSoundOutput.h @@ -29,9 +29,10 @@ public: // SetVolume should set a new volume level (between 0.0 and 1.0) virtual void SetVolume(double volume) = 0; - // ProcessSound should call S9xFinalizeSamples and queue new available samples into the - // Host sound system. If the sound system is callback based, ProcessSound should do a syncronized - // S9xFinalizeSamples and return. + // ProcessSound should queue new available samples into the Host sound + // system. If the sound system is callback based, ProcessSound should move + // all samples into a buffer that the callback can read, using a critical + // section while accessing that buffer for thread-safety. virtual void ProcessSound()=0; // GetDeviceList should return a list of device strings that can be displayed in a dropdown