If opening the writer node group fails, no task is being registered to the
scheduler although a task structure is allocated. This makes audiod think
everything is fine until the output buffer of the receiver or a filter is
filled up which may take several seconds.
Fix this flaw by setting the error field of the wng to -E_TASK_UNREGISTERED.
This causes audiod to close the receiver node and the filter chain and to
clear the affected slot.
s->wng->writer_nodes[i].writer = a->writers[i];
}
ret = wng_open(s->wng);
- if (ret < 0) {
- PARA_ERROR_LOG("%s\n", para_strerror(-ret));
+ if (ret < 0)
return;
- }
s->wstime = *now;
s->server_stream_start = stat_task->server_stream_start.tv_sec?
stat_task->server_stream_start : *now;
struct writer_node *wn = &g->writer_nodes[--i];
wn->writer->close(wn);
}
+ free(g->writer_nodes);
g->num_writers = 0;
+ g->task.error = -E_TASK_UNREGISTERED;
return ret;
}