break;
case MM_MESSAGE_STATE_INTERRUPTED: /* 0x04 */
if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT]) {
- handle->state = __convert_player_state(msg->state.current);
- if (handle->state == PLAYER_STATE_READY)
- handle->is_stopped = TRUE;
- ((player_interrupted_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT])(__convert_interrupted_code(msg->code), handle->user_data[MUSE_PLAYER_EVENT_TYPE_INTERRUPT]);
+ int code = 0;
+ if (msg->union_type == MM_MSG_UNION_STATE) {
+
+ handle->state = __convert_player_state(msg->state.current);
+ LOGD("update player state to %d", handle->state);
+
+ if (handle->state == PLAYER_STATE_READY)
+ handle->is_stopped = TRUE;
+ code = msg->state.code;
+ } else if (msg->union_type == MM_MSG_UNION_CODE) {
+ code = msg->code;
+ } else {
+ LOGE("invalid msg type %d", msg->union_type);
+ break;
+ }
+ ((player_interrupted_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_INTERRUPT])(__convert_interrupted_code(code), handle->user_data[MUSE_PLAYER_EVENT_TYPE_INTERRUPT]);
}
break;
case MM_MESSAGE_CONNECTION_TIMEOUT: /* 0x102 */