From fe7bdc93eb5c36e1685e5bdf05f8141d9a1dc6fb Mon Sep 17 00:00:00 2001 From: Chris Robinson <chris.kcat@gmail.com> Date: Mon, 1 Jan 2018 01:07:29 -0800 Subject: Check for AL_SOFT_direct_channels once when initializing --- examples/alffplay.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'examples/alffplay.cpp') diff --git a/examples/alffplay.cpp b/examples/alffplay.cpp index 55605792..e7df67ee 100644 --- a/examples/alffplay.cpp +++ b/examples/alffplay.cpp @@ -683,15 +683,7 @@ int AudioState::handler() alGenSources(1, &mSource); if(do_direct_out) - { - if(!alIsExtensionPresent("AL_SOFT_direct_channels")) - std::cerr<< "AL_SOFT_direct_channels not supported for direct output" <<std::endl; - else - { - alSourcei(mSource, AL_DIRECT_CHANNELS_SOFT, AL_TRUE); - std::cout<< "Direct out enabled" <<std::endl; - } - } + alSourcei(mSource, AL_DIRECT_CHANNELS_SOFT, AL_TRUE); while(alGetError() == AL_NO_ERROR && !mMovie.mQuit.load()) { @@ -1462,7 +1454,13 @@ int main(int argc, char *argv[]) if(fileidx < argc && strcmp(argv[fileidx], "-direct") == 0) { ++fileidx; - do_direct_out = true; + if(!alIsExtensionPresent("AL_SOFT_direct_channels")) + std::cerr<< "AL_SOFT_direct_channels not supported for direct output" <<std::endl; + else + { + std::cout<< "Found AL_SOFT_direct_channels" <<std::endl; + do_direct_out = true; + } } while(fileidx < argc && !movState) -- cgit v1.2.3