goto _ACTIVATE_DUCKING_DONE;
}
- /* check operating now */
- if (sd->state == STREAM_DUCKING_STATE_DUCKING ||
- sd->state == STREAM_DUCKING_STATE_UNDUCKING) {
- pa_log_error("now ducking or unducking (state:%u)", sd->state);
+ /* validate state with command */
+ if ((enable && sd->state != STREAM_DUCKING_STATE_UNDUCKED) ||
+ (!enable && sd->state != STREAM_DUCKING_STATE_DUCKED)) {
+ pa_log_error("state validation failed - [%d,s:%u]", enable, sd->state);
ret_msg = RET_MSG_ERROR_INVALID_STATE;
goto _ACTIVATE_DUCKING_DONE;
}
memset(&sd->vol_key, 0, sizeof(sd->vol_key));
}
- pa_log_info("ducking stream count(%p,%d)", sd, sd->ducking_stream_count);
+ pa_log_info("ducking stream count[%p,%d]", sd, sd->ducking_stream_count);
_ACTIVATE_DUCKING_DONE:
pa_assert_se(dbus_message_append_args(reply, DBUS_TYPE_STRING, &stream_manager_dbus_ret_str[ret_msg], DBUS_TYPE_INVALID));
else
sd->state = STREAM_DUCKING_STATE_UNDUCKED;
- pa_log_info("send signal for ramp finished(but, no stream matched) - state(%u)", sd->state);
+ pa_log_info("send signal for ramp finished(but, no stream matched) - state[%u]", sd->state);
send_ducking_state_changed_signal(pa_dbus_connection_get(m->dbus_conn), sd->trigger_index, is_stream_ducked(sd));
}