PARA_NOTICE_LOG("closing %s receiver in slot %d\n",
audio_formats[s->format], slot_num);
a->receiver->close(s->receiver_node);
- btr_free_node(s->receiver_node->btrn);
+ btr_remove_node(&s->receiver_node->btrn);
free(s->receiver_node);
s->receiver_node = NULL;
tv_add(now, &(struct timeval)EMBRACE(0, 200 * 1000),
w = writers + wn->writer_num;
PARA_INFO_LOG("closing %s\n", writer_names[wn->writer_num]);
w->close(wn);
- btr_free_node(wn->btrn);
+ btr_remove_node(&wn->btrn);
}
static void close_writers(struct slot_info *s)
f = filters + fn->filter_num;
if (f->close)
f->close(fn);
- btr_free_node(fn->btrn);
+ btr_remove_node(&fn->btrn);
}
free(s->fns);
s->fns = NULL;
* task. Note that the scheduler checks t->error also _before_ each pre/post
* select call, so the victim will never be scheduled again.
*/
-static void kill_btrn(struct btr_node *btrn, struct task *t, int error)
+static void kill_btrn(struct btr_node **btrnp, struct task *t, int error)
{
if (t->error < 0)
return;
t->error = error;
- btr_remove_node(btrn);
+ btr_remove_node(btrnp);
}
static void kill_all_decoders(int error)
continue;
if (!s->receiver_node)
continue;
- kill_btrn(s->receiver_node->btrn, &s->receiver_node->task,
+ kill_btrn(&s->receiver_node->btrn, &s->receiver_node->task,
error);
}
}
EMBRACE(.name = r->name, .context = rn));
ret = r->open(rn);
if (ret < 0) {
- btr_free_node(rn->btrn);
+ btr_remove_node(&rn->btrn);
free(rn);
return ret;
}
if (!st->ct)
goto out;
if (st->ct->task.error >= 0) {
- kill_btrn(st->ct->btrn, &st->ct->task, -E_AUDIOD_OFF);
+ kill_btrn(&st->ct->btrn, &st->ct->task, -E_AUDIOD_OFF);
goto out;
}
- if (st->ct->task.error >= 0)
- goto out;
close_stat_pipe();
st->clock_diff_count = conf.clock_diff_count_arg;
goto out;
size_t sz;
int ret;
if (st->ct->task.error < 0) {
- if (st->ct->task.error >= 0)
- goto out;
close_stat_pipe();
goto out;
}
struct timeval diff;
tv_diff(now, &st->last_status_read, &diff);
if (diff.tv_sec > 61)
- kill_btrn(st->ct->btrn, &st->ct->task,
+ kill_btrn(&st->ct->btrn, &st->ct->task,
-E_STATUS_TIMEOUT);
goto out;
}
sz = btr_next_buffer(st->btrn, &buf);
ret = for_each_stat_item(buf, sz, update_item);
if (ret < 0) {
- kill_btrn(st->ct->btrn, &st->ct->task, ret);
+ kill_btrn(&st->ct->btrn, &st->ct->task, ret);
goto out;
}
if (sz != ret) {