In case that audio stream contains no data (even first call to IAudioStreamProvider.ReadStream(...) returns false) the NativeAudioSource is stuck in streamWorkerQueue. Because of this, the source is never freed up and also the ReadStream method of IAudioStreamProvider is constantly called.
As a fix, I am setting strStopReq to EndOfStream because this is what actually happens. Then I also need to modify condition which is stopping the streaming. I tested this on sample project and also with my custom stream provider. It should handle correctly streams of any lengths (empty, shorter than initial buffers, shorter than one buffer, infinitely long).
In case that audio stream contains no data (even first call to
IAudioStreamProvider.ReadStream(...)
returns false) theNativeAudioSource
is stuck instreamWorkerQueue
. Because of this, the source is never freed up and also theReadStream
method ofIAudioStreamProvider
is constantly called.As a fix, I am setting strStopReq to EndOfStream because this is what actually happens. Then I also need to modify condition which is stopping the streaming. I tested this on sample project and also with my custom stream provider. It should handle correctly streams of any lengths (empty, shorter than initial buffers, shorter than one buffer, infinitely long).