From his original commit:
OPEN-279 Potential fix for the BUG-3214 stream stopping issue
Here is what the FMOD documentation says about the stream state FMOD_OPENSTATE_Ready and playing, but not possible to release at this time without stalling the main Since the FMOD Ex implementation (not sure about the old FMOD 3.75), streams have been released while the stream state is FMOD_OPENSTATE_PLAYING. Before release is called, the stream would only be paused, not stopped. The stream must be stopped for it to no longer be in playing state. Also, there usually needs to be just a little time between when a stream is stopped for it to exit playing state before releasing it. The viewer has been calling release almost instantly after just pausing the stream.
I think s quite possible that, even though releasing streams while they are in playing state t appear to be problematic most of the time, that some of the stream stopping issues such as BUG-3214 are a result of it. In the net streaming example program that comes with the FMOD API, when a stream is to be stopped, stop is called for the channel and then right before release, the program waits not only for the stream to exit playing state, but also for the stream to return to FMOD_OPENSTATE_READY before releasing. Due to the differences in how the viewer has been stopping and releasing streams compared to how FMOD does it in their example program, along with what they say in their documentation about the stream state FMOD_OPENSTATE_PLAYING, i have made the following changes to how streams are stopped and released by the viewer.
1.) Stop the stream channel instead of just pausing it before release so the stream can exit FMOD_OPENSTATE_PLAYING state and return (usually very quickly after stop is called) to FMOD_OPENSTATE_READY.
2.) Converted the dead streams list into a delayed release list. If a s state is not FMOD_OPENSTATE_READY when s checked right before release, push the stream to the delayed release list. Check for delayed release streams during each update like how was done before with the dead streams list and release streams that are in ready state.
3.) During viewer shutdown, call stop on the currently playing stream. After that, check if any streams are in the delayed release list, and, if so, release them when their stream state is ready state. If an unlikely edge case occurs where the streams in the delayed release list are not released in a timely fashion, force release them. The force release added in this change is actually pretty much the equivalent of how streams used to be stopped previously. The main difference, and advantage, is that regardless of which state the stream might be in during force release besides FMOD_OPENSTATE_READY, it won't be in FMOD_OPENSTATE_PLAYING when released.itstreamdoesnitthread.PLAYING -
Copy3rdPartyLibs needed to copy the now-corrected fmodexL libraries
and it had a bad library reference on Linux for release. In
llaudio land, the audio engine interfaces, even the fmodex
specializations, seem to want to be external-structure free
so use a forward declaration and pointer to FMOD_DSP_DESCRIPTION
and deal with it in the ctor/dtor.