}
case AVRCP_STATUS:
if (value != player_setting.status) {
- btrc_play_status_t play_status = player_setting.status;
-
player_setting.status = (value == STATUS_ERROR) ? BTRC_PLAYSTATE_ERROR : value;
if (registered_notifications.play_status) {
- gboolean is_timer = FALSE;
-
response.play_status = player_setting.status;
ret = avrcp_api->register_notification_rsp(BTRC_EVT_PLAY_STATUS_CHANGED,
BTRC_NOTIFICATION_TYPE_CHANGED, &response);
if (ret != BT_STATUS_SUCCESS)
BT_ERR("Notif send failed: %s", status2string(ret));
-
- /* Check if old and new status value are changed from NOT PLAYING to PLAYING */
- switch (play_status) {
- case BTRC_PLAYSTATE_ERROR: /* Intentional fall-through */
- case BTRC_PLAYSTATE_STOPPED: /* Intentional fall-through */
- case BTRC_PLAYSTATE_PAUSED: /* Intentional fall-through */
- if (STATUS_PLAYING == value ||
- STATUS_REVERSE_SEEK == value ||
- STATUS_FORWARD_SEEK == value) {
- BT_INFO("Play status changed from stopped to playing");
- is_timer = TRUE;
- }
- break;
- default:
- is_timer = FALSE;
- }
-
- if (is_timer) {
- BT_DBG("Player is playing mode, start sending pos change notifications");
- remove_pos_timer();
- send_pos_timer = g_timeout_add(registered_notifications.interval * 1000,
- send_pos_timeout, NULL);
- }
}
}
break;