return (tv_diff(now, &a->restart_barrier, NULL) > 0)? 0 : 1;
}
-static void start_current_receiver(struct timeval *now)
+static void open_current_receiver(struct timeval *now)
{
int i;
if (audiod_status != AUDIOD_ON)
kill_all_decoders();
else if (playing)
- start_current_receiver(&s->now);
+ open_current_receiver(&s->now);
check_timeouts();
FOR_EACH_SLOT(i) {
struct receiver_node *rn;
return ret;
}
-static int init_stream_io(void)
+static int init_writers(void)
{
- int i, ret, receiver_num, nf, nw;
+ int i, ret, nw;
char *cmd;
struct audio_format_info *a;
nw, writer_names[writer_num]);
a->num_writers++;
}
+ ret = 1;
+out:
+ return ret;
+}
+
+static int init_receivers(void)
+{
+ int i, ret, receiver_num;
+ char *cmd = NULL;
+ struct audio_format_info *a;
+
for (i = 0; receivers[i].name; i++) {
PARA_INFO_LOG("initializing %s receiver\n", receivers[i].name);
receivers[i].init(&receivers[i]);
return -E_RECV_SYNTAX;
a->receiver = &receivers[receiver_num];
}
+ ret = 1;
+out:
free(cmd);
- /* filters */
+ return ret;
+}
+static int init_filters(void)
+{
+ int i, ret, nf;
+
filter_init(filters);
nf = PARA_MAX(2, conf.filter_given) + 1;
PARA_INFO_LOG("allocating space for %d filters\n", nf);
return ret;
}
+static int init_stream_io(void)
+{
+ int ret;
+
+ ret = init_writers();
+ if (ret < 0)
+ return ret;
+ ret = init_receivers();
+ if (ret < 0)
+ return ret;
+ ret = init_filters();
+ if (ret < 0)
+ return ret;
+ return 1;
+}
+
static int dump_commands(int fd)
{
char *buf = para_strdup(""), *tmp = NULL;