{
mm_player_t* player = (mm_player_t*) user_data;
int result = MM_ERROR_NONE;
- gboolean lazy_pause = FALSE;
MMPlayerFocusChangedMsg msg = MM_PLAYER_FOCUS_CHANGED_BY_UNKNOWN;
LOGW("get focus notified");
LOGW("unknown focus state %d", focus_state);
DONE:
- if (!lazy_pause)
- player->sound_focus.by_asm_cb = FALSE;
+ player->sound_focus.by_asm_cb = FALSE;
player->sound_focus.cb_pending = FALSE;
EXIT:
mm_sound_device_type_e device_type;
int ret;
- MMMessageParamType msg = {0, };
LOGW("device_connected_cb is called, device_h[0x%x], is_connected[%d]\n", device_h, is_connected);
case MM_SOUND_DEVICE_TYPE_HDMI:
case MM_SOUND_DEVICE_TYPE_USB_AUDIO:
{
- ret = gst_element_set_state(player->pipeline->mainbin[MMPLAYER_M_PIPE].gst, GST_STATE_PAUSED);
- if (ret != GST_STATE_CHANGE_SUCCESS) {
+ int result = MM_ERROR_NONE;
+ LOGW("pause immediately");
+
+ player->sound_focus.by_asm_cb = TRUE;
+ player->sound_focus.focus_changed_msg = MM_PLAYER_FOCUS_CHANGED_BY_EARJACK_UNPLUG;
+
+ result = _mmplayer_pause((MMHandleType)player);
+ if (result != MM_ERROR_NONE) {
LOGE("focus_id [%d], watch_id [%d], connected_id [%d], change_state result[%d]",
player->sound_focus.focus_id, player->sound_focus.watch_id,
player->sound_focus.connected_id, ret);
}
- msg.union_type = MM_MSG_UNION_CODE;
- msg.code = MM_PLAYER_FOCUS_CHANGED_BY_EARJACK_UNPLUG;
- MMPLAYER_POST_MSG(player, MM_MESSAGE_STATE_INTERRUPTED, &msg);
+ player->sound_focus.by_asm_cb = FALSE;
}
break;