Updated: May 06, 2022

Stop playing


#include <mm/renderer.h>
int mmr_stop(mmr_context_t *ctxt)


A context handle




Stop playing. A no-op if the context is already stopped.

When playback gets stopped, there's no longer any set playback position. You can seek to a known position using mmr_seek() before restarting playback. If you don't, playback restarts at the default position. For playlist inputs, this is the beginning of the first track. For track or autolist inputs that are streams, the default position could be “right now” if the stream is live (in fact, this may be the only possible starting position) or the beginning if it's prerecorded (not live).

The behavior of playback resuming at the default position unless it's explicitly set also applies when playback stops because the end of media is reached or a serious error occurs.

When playback is explicitly stopped using mmr_stop(), mm-renderer generates a STATE event. When the end of media is reached, an ERROR event is generated and the error code contained in the event information is set to MMR_ERROR_NONE. When an error causes playback to stop, the error code is set to something else.


Zero on success, -1 on failure (use mmr_error_info())