diff options
author | Chris Robinson <[email protected]> | 2018-01-01 01:07:29 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-01 01:07:29 -0800 |
commit | fe7bdc93eb5c36e1685e5bdf05f8141d9a1dc6fb (patch) | |
tree | d4aef7a925982254dfa580121eb1845d4782a123 | |
parent | d8894353340746ae82d85423f8c9dbed53f967e4 (diff) |
Check for AL_SOFT_direct_channels once when initializing
-rw-r--r-- | examples/alffplay.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
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) |