X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audiod.c;h=93bc8da37c6e8cf16f550b9e88b8c6f2c0c5ef95;hp=8e117e9277e7480cb92bd3e33ff9fe5fbd925b0f;hb=02dd632ab2a6696aff7b6c6d108069704cfe871a;hpb=460bc598cfeabcdbf7f249061be5af82fd5a4ea9 diff --git a/audiod.c b/audiod.c index 8e117e92..93bc8da3 100644 --- a/audiod.c +++ b/audiod.c @@ -250,7 +250,7 @@ char *get_time_string(int slot_num) */ length = stat_task->length_seconds; tmp = &stat_task->server_stream_start; - if (s && s->wns) { /* writer active in this slot */ + if (s && s->wns && s->wns[0].btrn) { /* writer active in this slot */ btr_get_node_start(s->wns[0].btrn, &wstime); if (wstime.tv_sec != 0) { /* writer wrote something */ if (s->server_stream_start.tv_sec == 0) { @@ -267,7 +267,7 @@ char *get_time_string(int slot_num) tv_diff(tmp, &stat_task->sa_time_diff, &sss); else tv_add(tmp, &stat_task->sa_time_diff, &sss); - if (!s || !s->wns) { + if (!s || !s->wns || !s->wns[0].btrn) { struct timeval diff; tv_diff(now, &sss, &diff); seconds = diff.tv_sec + stat_task->offset_seconds; @@ -276,11 +276,14 @@ char *get_time_string(int slot_num) tv_diff(now, &wstime, &wtime); //PARA_CRIT_LOG("offset %d\n", s->offset_seconds); seconds = s->offset_seconds; - btr_get_node_start(s->receiver_node->btrn, &rstime); - ret = tv_diff(&rstime, &sss, &rskip); - if (ret > 0) { /* audiod was started in the middle of the stream */ - tv_add(&wtime, &rskip, &sum); - seconds += sum.tv_sec; + if (s->receiver_node->btrn) { + btr_get_node_start(s->receiver_node->btrn, &rstime); + ret = tv_diff(&rstime, &sss, &rskip); + if (ret > 0) { /* audiod was started in the middle of the stream */ + tv_add(&wtime, &rskip, &sum); + seconds += sum.tv_sec; + } else + seconds += wtime.tv_sec; } else seconds += wtime.tv_sec; out: @@ -924,10 +927,6 @@ static int parse_filter_args(void) { int i, j, ret, af_mask; - if (conf.no_default_filters_given) { - PARA_WARNING_LOG("--no_default_filters is deprecated\n"); - PARA_WARNING_LOG("It has no effect and will be removed soon\n"); - } for (i = 0; i < conf.filter_given; i++) { char *arg; ret = parse_stream_command(conf.filter_arg[i], &arg); @@ -1200,8 +1199,6 @@ static void status_post_select(struct sched *s, struct task *t) 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; @@ -1211,8 +1208,6 @@ static void status_post_select(struct sched *s, struct task *t) size_t sz; int ret; if (st->ct->task.error < 0) { - if (st->ct->task.error >= 0) - goto out; close_stat_pipe(); goto out; }