From a731e042cc512d1008415765ab8b4d8114f0399c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 1 Apr 2022 19:13:26 -0700 Subject: [PATCH] Remove the unused flags parameter from alBufferCallbackSOFT --- al/buffer.cpp | 4 +--- alc/inprogext.h | 4 ++-- examples/alffplay.cpp | 6 ++---- examples/alstreamcb.cpp | 5 ++--- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/al/buffer.cpp b/al/buffer.cpp index 7aa8edfd..13407103 100644 --- a/al/buffer.cpp +++ b/al/buffer.cpp @@ -1584,7 +1584,7 @@ END_API_FUNC AL_API void AL_APIENTRY alBufferCallbackSOFT(ALuint buffer, ALenum format, ALsizei freq, - ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr, ALbitfieldSOFT flags) + ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr) START_API_FUNC { ContextRef context{GetContextRef()}; @@ -1600,8 +1600,6 @@ START_API_FUNC context->setError(AL_INVALID_VALUE, "Invalid sample rate %d", freq); else if UNLIKELY(callback == nullptr) context->setError(AL_INVALID_VALUE, "NULL callback"); - else if UNLIKELY(flags != 0) - context->setError(AL_INVALID_VALUE, "Invalid callback flags 0x%x", flags); else { auto usrfmt = DecomposeUserFormat(format); diff --git a/alc/inprogext.h b/alc/inprogext.h index ddebc79a..046c2004 100644 --- a/alc/inprogext.h +++ b/alc/inprogext.h @@ -33,12 +33,12 @@ AL_API void AL_APIENTRY alFlushMappedBufferSOFT(ALuint buffer, ALsizei offset, A #define AL_BUFFER_CALLBACK_FUNCTION_SOFT 0x19A0 #define AL_BUFFER_CALLBACK_USER_PARAM_SOFT 0x19A1 typedef ALsizei (AL_APIENTRY*ALBUFFERCALLBACKTYPESOFT)(ALvoid *userptr, ALvoid *sampledata, ALsizei numbytes); -typedef void (AL_APIENTRY*LPALBUFFERCALLBACKSOFT)(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr, ALbitfieldSOFT flags); +typedef void (AL_APIENTRY*LPALBUFFERCALLBACKSOFT)(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr); typedef void (AL_APIENTRY*LPALGETBUFFERPTRSOFT)(ALuint buffer, ALenum param, ALvoid **value); typedef void (AL_APIENTRY*LPALGETBUFFER3PTRSOFT)(ALuint buffer, ALenum param, ALvoid **value1, ALvoid **value2, ALvoid **value3); typedef void (AL_APIENTRY*LPALGETBUFFERPTRVSOFT)(ALuint buffer, ALenum param, ALvoid **values); #ifdef AL_ALEXT_PROTOTYPES -AL_API void AL_APIENTRY alBufferCallbackSOFT(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr, ALbitfieldSOFT flags); +AL_API void AL_APIENTRY alBufferCallbackSOFT(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr); AL_API void AL_APIENTRY alGetBufferPtrSOFT(ALuint buffer, ALenum param, ALvoid **ptr); AL_API void AL_APIENTRY alGetBuffer3PtrSOFT(ALuint buffer, ALenum param, ALvoid **ptr0, ALvoid **ptr1, ALvoid **ptr2); AL_API void AL_APIENTRY alGetBufferPtrvSOFT(ALuint buffer, ALenum param, ALvoid **ptr); diff --git a/examples/alffplay.cpp b/examples/alffplay.cpp index c557362a..e191a323 100644 --- a/examples/alffplay.cpp +++ b/examples/alffplay.cpp @@ -78,11 +78,10 @@ extern "C" { #ifdef ALLOW_EXPERIMENTAL_EXTS #ifndef AL_SOFT_callback_buffer #define AL_SOFT_callback_buffer -typedef unsigned int ALbitfieldSOFT; #define AL_BUFFER_CALLBACK_FUNCTION_SOFT 0x19A0 #define AL_BUFFER_CALLBACK_USER_PARAM_SOFT 0x19A1 typedef ALsizei (AL_APIENTRY*ALBUFFERCALLBACKTYPESOFT)(ALvoid *userptr, ALvoid *sampledata, ALsizei numbytes); -typedef void (AL_APIENTRY*LPALBUFFERCALLBACKSOFT)(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr, ALbitfieldSOFT flags); +typedef void (AL_APIENTRY*LPALBUFFERCALLBACKSOFT)(ALuint buffer, ALenum format, ALsizei freq, ALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr); typedef void (AL_APIENTRY*LPALGETBUFFERPTRSOFT)(ALuint buffer, ALenum param, ALvoid **value); typedef void (AL_APIENTRY*LPALGETBUFFER3PTRSOFT)(ALuint buffer, ALenum param, ALvoid **value1, ALvoid **value2, ALvoid **value3); typedef void (AL_APIENTRY*LPALGETBUFFERPTRVSOFT)(ALuint buffer, ALenum param, ALvoid **values); @@ -1282,8 +1281,7 @@ int AudioState::handler() bool callback_ok{false}; if(alBufferCallbackSOFT) { - alBufferCallbackSOFT(mBuffers[0], mFormat, mCodecCtx->sample_rate, bufferCallbackC, this, - 0); + alBufferCallbackSOFT(mBuffers[0], mFormat, mCodecCtx->sample_rate, bufferCallbackC, this); alSourcei(mSource, AL_BUFFER, static_cast(mBuffers[0])); if(alGetError() != AL_NO_ERROR) { diff --git a/examples/alstreamcb.cpp b/examples/alstreamcb.cpp index 424ed635..d37fe118 100644 --- a/examples/alstreamcb.cpp +++ b/examples/alstreamcb.cpp @@ -47,11 +47,10 @@ #ifndef AL_SOFT_callback_buffer #define AL_SOFT_callback_buffer -typedef unsigned int ALbitfieldSOFT; #define AL_BUFFER_CALLBACK_FUNCTION_SOFT 0x19A0 #define AL_BUFFER_CALLBACK_USER_PARAM_SOFT 0x19A1 typedef ALsizei (AL_APIENTRY*LPALBUFFERCALLBACKTYPESOFT)(ALvoid *userptr, ALvoid *sampledata, ALsizei numsamples); -typedef void (AL_APIENTRY*LPALBUFFERCALLBACKSOFT)(ALuint buffer, ALenum format, ALsizei freq, LPALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr, ALbitfieldSOFT flags); +typedef void (AL_APIENTRY*LPALBUFFERCALLBACKSOFT)(ALuint buffer, ALenum format, ALsizei freq, LPALBUFFERCALLBACKTYPESOFT callback, ALvoid *userptr); typedef void (AL_APIENTRY*LPALGETBUFFERPTRSOFT)(ALuint buffer, ALenum param, ALvoid **value); typedef void (AL_APIENTRY*LPALGETBUFFER3PTRSOFT)(ALuint buffer, ALenum param, ALvoid **value1, ALvoid **value2, ALvoid **value3); typedef void (AL_APIENTRY*LPALGETBUFFERPTRVSOFT)(ALuint buffer, ALenum param, ALvoid **values); @@ -219,7 +218,7 @@ struct StreamPlayer { bool prepare() { - alBufferCallbackSOFT(mBuffer, mFormat, mSfInfo.samplerate, bufferCallbackC, this, 0); + alBufferCallbackSOFT(mBuffer, mFormat, mSfInfo.samplerate, bufferCallbackC, this); alSourcei(mSource, AL_BUFFER, static_cast(mBuffer)); if(ALenum err{alGetError()}) {