break;
case SDS_ACTIVE:
case SDS_ACTIVE_MULTI:
- if (drec->last_state != SDS_HELD && drec->active_start) {
+ if (drec->active_start && drec->last_state != SDS_HELD) {
drec->active_stop = switch_micro_time_now();
} else if (!drec->active_start) {
drec->active_start = switch_micro_time_now();
drec->hold_start = switch_micro_time_now();
drec->hold_stop = 0;
default:
- if (drec->last_state != SDS_HELD) {
+ if (drec->active_start && drec->last_state != SDS_HELD) {
drec->active_stop = switch_micro_time_now();
}
break;