Stopping the playback
If the application wishes to stop playback, it can simply stop sending data and let the subchannel underrun as described above, but there are better ways.
If you want your application to stop as soon as possible, call one of the drop functions to discard any buffered data:
- snd_pcm_plugin_drop() if you're using the plugins
- snd_pcm_channel_drop() if you aren't
If you want to play out all data in the buffers before stopping, call one of:
- snd_pcm_plugin_drain() if you're using the plugins
- snd_pcm_channel_drain() if you aren't
The drain functions block until all buffered data is played out and the stream is stopped.
Page updated:
