diff options
author | prince <prince.dubey@samsung.com> | 2013-03-21 17:05:07 +0530 |
---|---|---|
committer | prince <prince.dubey@samsung.com> | 2013-03-21 17:05:07 +0530 |
commit | 95cecd56d395b99e7bf7febed6f7e10dcf623d22 (patch) | |
tree | 900907c840399ea3f547d5bd9516db20e06e8416 | |
parent | 1044f16dbc75fef17b326523ea2120b5c3179a9f (diff) | |
download | edje-multisense-plugin-95cecd56d395b99e7bf7febed6f7e10dcf623d22.tar.gz edje-multisense-plugin-95cecd56d395b99e7bf7febed6f7e10dcf623d22.tar.bz2 edje-multisense-plugin-95cecd56d395b99e7bf7febed6f7e10dcf623d22.zip |
[Multisense] Adding check for MM Sound API return value
Change-Id: If33f7136a1c70e3a1f4e9c51f4b6e1b118004aad
-rw-r--r-- | src/tizen_sound_player/tizen_sound_player.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/tizen_sound_player/tizen_sound_player.c b/src/tizen_sound_player/tizen_sound_player.c index d4bf12e..a1c59fe 100644 --- a/src/tizen_sound_player/tizen_sound_player.c +++ b/src/tizen_sound_player/tizen_sound_player.c @@ -60,8 +60,10 @@ remix_player_reset_device (RemixEnv *env, RemixBase *base) if (player_data->handle) { - mm_sound_pcm_play_stop(player_data->handle); - mm_sound_pcm_play_close(player_data->handle); + if (mm_sound_pcm_play_stop(player_data->handle) < 0) + remix_set_error (env, REMIX_ERROR_SYSTEM); + else + mm_sound_pcm_play_close(player_data->handle); player_data->handle = NULL; } player_data->old_buffer_size = player_data->buffer_size; @@ -188,8 +190,11 @@ remix_player_destroy (RemixEnv *env, RemixBase *base) if (player_data->handle) { - mm_sound_pcm_play_stop(player_data->handle); - mm_sound_pcm_play_close(player_data->handle); + if (mm_sound_pcm_play_stop(player_data->handle) < 0) + remix_set_error (env, REMIX_ERROR_SYSTEM); + else + mm_sound_pcm_play_close(player_data->handle); + player_data->handle = NULL; } if (player_data->timeout) ecore_timer_del(player_data->timeout); if (player_data->playbuffer) free(player_data->playbuffer); @@ -218,7 +223,7 @@ remix_player_ready (RemixEnv *env, RemixBase *base) static RemixBase * remix_player_prepare (RemixEnv *env, RemixBase *base) { - remix_player_reset_device (env, base); +// remix_player_reset_device (env, base); return base; } @@ -239,7 +244,8 @@ remix_player_playbuffer (RemixEnv *env, RemixPlayerData *player, RemixPCM *data, *(player->playbuffer + i) = (PLAYER_PCM) value; } - ret = mm_sound_pcm_play_write(player->handle, + if (player->handle) + ret = mm_sound_pcm_play_write(player->handle, player->playbuffer, length); if (ret < 0) @@ -337,8 +343,14 @@ _remix_mm_handle_close(void *data) if (!player_data) return ECORE_CALLBACK_CANCEL; if (!player_data->handle) return ECORE_CALLBACK_CANCEL; - mm_sound_pcm_play_stop(player_data->handle); - mm_sound_pcm_play_close(player_data->handle); + if (mm_sound_pcm_play_stop(player_data->handle) < 0) + { + player_data->handle = NULL; + player_data->timeout = NULL; + return ECORE_CALLBACK_CANCEL; + } + else + mm_sound_pcm_play_close(player_data->handle); player_data->handle = NULL; player_data->timeout = NULL; |