OGRECave / ogre-audiovideo

plugins for theora video playback and openAL audio
https://ogrecave.github.io/ogre-audiovideo/
BSD 3-Clause "New" or "Revised" License
14 stars 11 forks source link

Use ALC_ENUMERATE_ALL_EXT to get more detailed device descriptions #21

Closed sercero closed 3 years ago

sercero commented 3 years ago

There were some inconsistencies in the way that the device list was generated.

OgreOggSoundManager::init was calling OgreOggSoundManager::_enumDevices() but its result was not being used (Now it is used as the source of truth) The function OgreOggSoundManager::getDeviceList() had initialization code to test the devices, which is unexpected behaviour for a get*() function, now it only returns the list The previous version of OgreOggSoundManager::getDeviceList() was creating and destroying ALContext for each device to sort of "test" it, but in practice it makes more sense to just get the device list and fail later in the initialization if we are unable to create the context for that particular device.

With these changes it is now safe to call OgreOggSoundManager::getDeviceList(), I was having problems with it previously.

The code now resembles the way in which OpenAL Soft is initialized in the openal-info.c example.