/** Client data associated with the stat task. */
struct client_task *ct;
/** Do not restart client command until this time. */
/** Client data associated with the stat task. */
struct client_task *ct;
/** Do not restart client command until this time. */
continue;
btr_get_node_start(s->receiver_node->btrn, &rstime);
if (newest_slot >= 0 && tv_diff(&rstime, &newest_rstime, NULL) < 0)
continue;
btr_get_node_start(s->receiver_node->btrn, &rstime);
if (newest_slot >= 0 && tv_diff(&rstime, &newest_rstime, NULL) < 0)
static struct timeval last_status_dump;
struct timeval tmp, delay;
bool force = true;
static struct timeval last_status_dump;
struct timeval tmp, delay;
bool force = true;
- sprintf(ct->task.status, "command task");
+
+ ct->task = task_register(&(struct task_info) {
+ .name = "command",
+ .pre_select = command_pre_select,
+ .post_select = command_post_select,
+ .context = ct,
+ }, &sched);
int i, ret, cafn = stat_task->current_audio_format_num;
if (must_start_decoder())
int i, ret, cafn = stat_task->current_audio_format_num;
if (must_start_decoder())
- if (st->ct->task.error >= 0) {
- task_notify(&st->ct->task, E_AUDIOD_OFF);
+ if (task_status(st->ct->task) >= 0) {
+ task_notify(st->ct->task, E_AUDIOD_OFF);
goto out;
}
btr_merge(st->btrn, st->min_iqs);
sz = btr_next_buffer(st->btrn, &buf);
ret = for_each_stat_item(buf, sz, update_item);
if (ret < 0) {
goto out;
}
btr_merge(st->btrn, st->min_iqs);
sz = btr_next_buffer(st->btrn, &buf);
ret = for_each_stat_item(buf, sz, update_item);
if (ret < 0) {
static void init_status_task(struct status_task *st)
{
memset(st, 0, sizeof(struct status_task));
static void init_status_task(struct status_task *st)
{
memset(st, 0, sizeof(struct status_task));
st->sa_time_diff_sign = 1;
st->clock_diff_count = conf.clock_diff_count_arg;
st->current_audio_format_num = -1;
st->sa_time_diff_sign = 1;
st->clock_diff_count = conf.clock_diff_count_arg;
st->current_audio_format_num = -1;