This was broken in SoftAE, hence I describe what ActiveAE does:

Drain() is called on the stream. After drains returns (all samples of the stream were passed to the mixer stage) there is still some water level in the audio engine. dvdplayer destructs the stream and creates a new one. During this time ActiveAE continues playing. When the new stream is created it checks if the sink is still compatible. If not, the sink is drained a new one is opened. 

On Flush ActiveAE checks how many streams are playing. In case it's only one, it also flushes buffers in the engine.