if(mal_device__get_state(pDevice)==MAL_STATE_UNINITIALIZED)returnmal_post_error(pDevice,"mal_device_start() called for an uninitialized device.",MAL_DEVICE_NOT_INITIALIZED);
if(mal_device__get_state(pDevice)==MAL_STATE_UNINITIALIZED)returnmal_post_error(pDevice,"mal_device_start() called for an uninitialized device.",MAL_DEVICE_NOT_INITIALIZED);
mal_resultresult=MAL_ERROR;
mal_resultresult=MAL_ERROR;
mal_mutex_lock(pDevice->pContext,&pDevice->lock);
mal_mutex_lock(&pDevice->lock);
{
{
// Be a bit more descriptive if the device is already started or is already in the process of starting. This is likely
// Be a bit more descriptive if the device is already started or is already in the process of starting. This is likely
if(mal_device__get_state(pDevice)==MAL_STATE_UNINITIALIZED)returnmal_post_error(pDevice,"mal_device_stop() called for an uninitialized device.",MAL_DEVICE_NOT_INITIALIZED);
if(mal_device__get_state(pDevice)==MAL_STATE_UNINITIALIZED)returnmal_post_error(pDevice,"mal_device_stop() called for an uninitialized device.",MAL_DEVICE_NOT_INITIALIZED);
mal_resultresult=MAL_ERROR;
mal_resultresult=MAL_ERROR;
mal_mutex_lock(pDevice->pContext,&pDevice->lock);
mal_mutex_lock(&pDevice->lock);
{
{
// Be a bit more descriptive if the device is already stopped or is already in the process of stopping. This is likely
// Be a bit more descriptive if the device is already stopped or is already in the process of stopping. This is likely