return;
}
+static player_state_e __convert_player_state(MMPlayerStateType state)
+{
+ if (state == MM_PLAYER_STATE_NONE)
+ return PLAYER_STATE_NONE;
+ else
+ return state +1;
+}
+
static int __msg_callback(int message, void *param, void *user_data)
{
player_s *handle = (player_s *)user_data;
((player_buffering_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_BUFFERING])(msg->connection.buffering, handle->user_data[MUSE_PLAYER_EVENT_TYPE_BUFFERING]);
break;
case MM_MESSAGE_STATE_INTERRUPTED: /* 0x04 */
- if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT])
+ if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT]) {
+ if (msg->union_type == MM_MSG_UNION_STATE) {
+ LOGW("received mm state msg prev:%d, curr:%d", msg->state.previous, msg->state.current);
+ handle->state = __convert_player_state(msg->state.current);
+ LOGW("player state is changed to %d by resource conflict", handle->state);
+ }
((player_interrupted_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT])(handle->user_data[MUSE_PLAYER_EVENT_TYPE_INTERRUPT]);
+ }
break;
case MM_MESSAGE_CONNECTION_TIMEOUT: /* 0x102 */
LOGI("[%s] PLAYER_ERROR_CONNECTION_FAILED (0x%08x) : CONNECTION_TIMEOUT", __FUNCTION__, PLAYER_ERROR_CONNECTION_FAILED);