-static gboolean
-__mmplayer_can_do_interrupt(mmplayer_t *player)
-{
- if (!player || !player->pipeline || !player->attrs) {
- LOGW("not initialized");
- goto FAILED;
- }
-
- if (player->audio_decoded_cb) {
- LOGW("not support in pcm extraction mode");
- goto FAILED;
- }
-
- /* check if seeking */
- if (player->seek_state != MMPLAYER_SEEK_NONE) {
- MMMessageParamType msg_param;
- memset(&msg_param, 0, sizeof(MMMessageParamType));
- msg_param.code = MM_ERROR_PLAYER_SEEK;
- player->seek_state = MMPLAYER_SEEK_NONE;
- MMPLAYER_POST_MSG(player, MM_MESSAGE_ERROR, &msg_param);
- goto FAILED;
- }
-
- /* check other thread */
- if (!MMPLAYER_CMD_TRYLOCK(player)) {
- LOGW("locked already, cmd state : %d", player->cmd);
-
- /* check application command */
- if (player->cmd == MMPLAYER_COMMAND_START || player->cmd == MMPLAYER_COMMAND_RESUME) {
- LOGW("playing.. should wait cmd lock then, will be interrupted");
-
- /* lock will be released at mrp_resource_release_cb() */
- MMPLAYER_CMD_LOCK(player);
- goto INTERRUPT;
- }
- LOGW("nothing to do");
- goto FAILED;
- } else {
- LOGW("can interrupt immediately");
- goto INTERRUPT;
- }
-
-FAILED: /* with CMD UNLOCKED */
- return FALSE;
-
-INTERRUPT: /* with CMD LOCKED, will do UNLOCK at __resource_release_cb() */
- return TRUE;
-}
-