As I mentioned in #528 there is an issue when a drained stream reinits due to a device plug/unplug. The STR is:
- Create a playback or duplex stream and start it.
- Let the stream drain. Drain state callback will fire.
- Plug or unplug a device to create a reinit of the stream.
The strange behavior is that a drain state callback will be fired for a second time on step 3. This is because, on reinit, the stream is started again. However, the str->drain flag is set to true so the stream drains again and the callback is fired. The expected woulf be to end up with a stopped stream at that point.