This fixes a well-formed warning, but does it break anything?
It's not clear off hand. Having this up for discussion.
(Matt McCutchen <[email protected]>: Cherry picked from commit
a565a27da8c5278846c06585cb6e218ff8f0f1b7 with a conflict resolution.
This commit fixes a crash on startup in MessageManager::Broadcast when I
build StepMania with -DCMAKE_BUILD_TYPE=Release and g++ 6.3.1 on Fedora
25. Apparently g++ is optimizing out the "this != NULL" on the grounds
that calling a method on a null pointer has undefined behavior, so the
"m_Logging" is a null dereference.)
The global offset is a correction for audio latency, which is measured
in wall-clock time, but TimingData elapsed time values represent offsets
into the sound file. To get the offset in the sound file that
corresponds to the wall-clock time of the global offset, we have to
multiply by the music rate.
On my Fedora 20 system, closedir apparently frees the dirent, and
reading it afterwards returns garbage data. This prevented my dance pad
from being detected.