static bool resume_on_seek_done = false;
static bool pause_on_seek_done = false;
static int g_reserved_seek_pos = -1;
+bool reacquire_state;
static Seek_Done_Cb g_requesting_cb = NULL;
static void *g_requesting_cb_data = NULL;
struct appdata *ad = data;
MP_CHECK_FALSE(ad);
int res = true;
+ int error = -1;
if (ad->current_track_info) {
if (mp_setting_read_playing_status(ad->current_track_info->uri, "paused") != 1) {
mp_setting_write_playing_status(ad->current_track_info->uri, "paused");
mp_setting_set_player_state(MP_PLAY_STATE_NONE);
}
+ error = sound_manager_destroy_stream_information(ad->stream_info);
+ if (error != SOUND_MANAGER_ERROR_NONE) {
+ DEBUG_TRACE("unable to destroy stream. error code [%x]", error);
+ }
is_seeking = false;
g_reserved_seek_pos = -1;
g_reserved_cb = NULL;
if (error != SOUND_MANAGER_ERROR_NONE) {
ERROR_TRACE("failed to acquire focus [%x]", error);
}
+
+ sound_manager_get_focus_reacquisition(ad->stream_info, &reacquire_state);
+ if (reacquire_state == EINA_FALSE) {
+ sound_manager_set_focus_reacquisition(ad->stream_info, EINA_TRUE);
+ }
err = g_player_apis.start(_player);
PLAYER_LEAVE_LOG("start");
startfunc;
struct appdata *ad = data;
MP_CHECK_FALSE(ad);
- int err = -1;
+ int err = -1,error = -1;
mp_util_lock_cpu();
if (!mp_player_mgr_is_active()) {
}
}
+ error = sound_manager_acquire_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+ if (error != SOUND_MANAGER_ERROR_NONE) {
+ ERROR_TRACE("failed to acquire focus [%x]", error);
+ }
+
+ sound_manager_get_focus_reacquisition(ad->stream_info, &reacquire_state);
+ if (reacquire_state == EINA_FALSE) {
+ sound_manager_set_focus_reacquisition(ad->stream_info, EINA_TRUE);
+ }
if (mp_player_mgr_get_state() != PLAYER_STATE_IDLE) {
DEBUG_TRACE("player state is ready");
PLAYER_ENTER_LOG("start");
&state_for_recording);
if (state_for_playback == SOUND_STREAM_FOCUS_STATE_RELEASED) {
mp_player_mgr_pause(ad);
- sound_manager_release_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
+
+ if (reason_for_change != SOUND_STREAM_FOCUS_CHANGED_BY_ALARM &&
+ reason_for_change != SOUND_STREAM_FOCUS_CHANGED_BY_NOTIFICATION) {
+ sound_manager_get_focus_reacquisition(ad->stream_info, &reacquire_state);
+ if (reacquire_state == EINA_TRUE) {
+ sound_manager_set_focus_reacquisition(ad->stream_info, EINA_FALSE);
+ }
+ }
} else {
ret = mp_player_mgr_play(ad);
- sound_manager_acquire_focus(ad->stream_info, SOUND_STREAM_FOCUS_FOR_PLAYBACK, NULL);
}
}
{
struct appdata *ad = mp_util_get_appdata();
int ret = SOUND_MANAGER_ERROR_NONE;
+ if (!ad->stream_info) {
+ ret = sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, mp_player_focus_callback, ad, &ad->stream_info);
- PLAYER_ENTER_LOG("sound_manager_set_session_type");
- ret = sound_manager_create_stream_information(SOUND_STREAM_TYPE_MEDIA, mp_player_focus_callback, ad, &ad->stream_info);
- PLAYER_LEAVE_LOG("sound_manager_set_session_type");
-
-
- if (ret != SOUND_MANAGER_ERROR_NONE) {
- return FALSE;
+ if (ret != SOUND_MANAGER_ERROR_NONE) {
+ EVENT_TRACE("failed to create_stream_information %x", ret);
+ return FALSE;
+ }
}
-
return TRUE;
}