/home/elsid/dev/openmw/apps/openmw/mwsound/openal_output.cpp:1492:5: warning: Call to virtual function during destruction [clang-analyzer-optin.cplusplus.VirtualCall]
deinit();
^
/home/elsid/dev/openmw/apps/openmw/mwsound/openal_output.cpp:1492:5: note: This destructor of an object of type '~OpenAL_Output' has not returned when the virtual method was called
/home/elsid/dev/openmw/apps/openmw/mwsound/openal_output.cpp:1492:5: note: Call to virtual function during destruction
Standard OpenAL does not spatialize non-mono sounds, although the game has some
stereo sounds meant to play in 3D. The desired behavior can be achieved with
the AL_SOFT_source_spatialize extension.
This should allow OpenMW to work better with git versions of openscenegraph. OSG dev version 3.5.5 added the setting of thread affinity for the main thread. The problem is that in the boost/standard threading libraries, the affinity of a thread is inherited by any further threads launched from that thread, leading to these threads always running on the same core as the main thread unless you tell them not to.
With OpenThreads, the default affinity of a thread is none, no matter what parent thread it was launched from.
So, when using custom threading with OSG 3.6+, we have these options:
1. explicitely tell OSG to *not* set the thread affinity
or 2. explicitely set the thread affinity of additional threads created (possible with boost, but not possible with std::thread)
or 3. use OpenThreads
or 4. accept the suboptimal performance of non-OSG threads (in OpenMW's case the sound streaming & video threads) running on the same core as the main thread
This patch opts for 3.)
Reference: http://forum.openscenegraph.org/viewtopic.php?t=16158
Instead of getting the loudness data for the whole file in advance, we now get it piece by piece as the sound is streamed.
The benefit is that we need to decode the audio just once instead of twice.
We no longer need to rewind() the stream when the first decoding is done, this should hopefully fix bug #3453 .