diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index ad010e44d..e8c6cfb19 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -248,12 +248,6 @@ SDL_AudioPlayDevice_Default(_THIS) { /* no-op. */ } -static int -SDL_AudioGetPendingBytes_Default(_THIS) -{ - return 0; -} - static Uint8 * SDL_AudioGetDeviceBuf_Default(_THIS) { @@ -361,7 +355,6 @@ finish_audio_entry_points_init(void) FILL_STUB(BeginLoopIteration); FILL_STUB(WaitDevice); FILL_STUB(PlayDevice); - FILL_STUB(GetPendingBytes); FILL_STUB(GetDeviceBuf); FILL_STUB(CaptureFromDevice); FILL_STUB(FlushCapture); @@ -654,11 +647,9 @@ SDL_GetQueuedAudioSize(SDL_AudioDeviceID devid) } /* Nothing to do unless we're set up for queueing. */ - if (device->callbackspec.callback == SDL_BufferQueueDrainCallback) { - current_audio.impl.LockDevice(device); - retval = ((Uint32) SDL_CountDataQueue(device->buffer_queue)) + current_audio.impl.GetPendingBytes(device); - current_audio.impl.UnlockDevice(device); - } else if (device->callbackspec.callback == SDL_BufferQueueFillCallback) { + if (device->callbackspec.callback == SDL_BufferQueueDrainCallback || + device->callbackspec.callback == SDL_BufferQueueFillCallback) + { current_audio.impl.LockDevice(device); retval = (Uint32) SDL_CountDataQueue(device->buffer_queue); current_audio.impl.UnlockDevice(device); diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index 284b626c7..5a87a3b60 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -71,7 +71,6 @@ typedef struct SDL_AudioDriverImpl void (*BeginLoopIteration)(_THIS); /* Called by audio thread at top of loop */ void (*WaitDevice) (_THIS); void (*PlayDevice) (_THIS); - int (*GetPendingBytes) (_THIS); Uint8 *(*GetDeviceBuf) (_THIS); int (*CaptureFromDevice) (_THIS, void *buffer, int buflen); void (*FlushCapture) (_THIS); diff --git a/src/audio/wasapi/SDL_wasapi.c b/src/audio/wasapi/SDL_wasapi.c index 4011cb1ac..67cbccf30 100644 --- a/src/audio/wasapi/SDL_wasapi.c +++ b/src/audio/wasapi/SDL_wasapi.c @@ -161,21 +161,6 @@ WASAPI_DetectDevices(void) WASAPI_EnumerateEndpoints(); } -static int -WASAPI_GetPendingBytes(_THIS) -{ - UINT32 frames = 0; - - /* it's okay to fail here; we'll deal with failures in the audio thread. */ - /* FIXME: need a lock around checking this->hidden->client */ - if (this->hidden->client != NULL) { /* definitely activated? */ - if (FAILED(IAudioClient_GetCurrentPadding(this->hidden->client, &frames))) { - return 0; /* oh well. */ - } - } - return ((int) frames) * this->hidden->framesize; -} - static SDL_INLINE SDL_bool WasapiFailed(_THIS, const HRESULT err) { @@ -765,7 +750,6 @@ WASAPI_Init(SDL_AudioDriverImpl * impl) impl->OpenDevice = WASAPI_OpenDevice; impl->PlayDevice = WASAPI_PlayDevice; impl->WaitDevice = WASAPI_WaitDevice; - impl->GetPendingBytes = WASAPI_GetPendingBytes; impl->GetDeviceBuf = WASAPI_GetDeviceBuf; impl->CaptureFromDevice = WASAPI_CaptureFromDevice; impl->FlushCapture = WASAPI_FlushCapture;