X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audiod.c;h=6a4c9dbead6c61bbaaedfb484369749404dbe7b5;hp=e66373cc87ed475682655a9dac17baec92144496;hb=c41a04fb296e068ebfec78bba9678bf15daea896;hpb=5613d9bd0624fae15a1923a6590fa10761d93340 diff --git a/audiod.c b/audiod.c index e66373cc..6a4c9dbe 100644 --- a/audiod.c +++ b/audiod.c @@ -7,9 +7,7 @@ /** \file audiod.c the paraslash's audio daemon */ #include #include -#include #include -#include #include #include "para.h" @@ -33,6 +31,7 @@ #include "write.h" #include "write_common.h" #include "signal.h" +#include "version.h" /** define the array of error lists needed by para_audiod */ INIT_AUDIOD_ERRLISTS; @@ -430,22 +429,15 @@ static void kill_btrn(struct btr_node *btrn, struct task *t, int error) static void kill_all_decoders(int error) { - int i, j; + int i; FOR_EACH_SLOT(i) { - struct slot_info *s = &slot[i]; - struct audio_format_info *a; + struct slot_info *s = slot + i; if (s->format < 0) continue; - a = afi + s->format; - if (s->wns) - for (j = 0; j < a->num_writers; j++) - kill_btrn(s->wns[j].btrn, &s->wns[j].task, error); - if (s->fns) - for (j = 0; j < a->num_writers; j++) - kill_btrn(s->fns[j].btrn, &s->wns[j].task, error); - if (s->receiver_node) - kill_btrn(s->receiver_node->btrn, &s->receiver_node->task, + if (!s->receiver_node) + continue; + kill_btrn(s->receiver_node->btrn, &s->receiver_node->task, error); } } @@ -1083,17 +1075,17 @@ static void try_to_close_slot(int slot_num) if (s->format < 0) return; - if (s->receiver_node && s->receiver_node->task.error != -E_TASK_UNREGISTERED) + if (s->receiver_node && s->receiver_node->task.error >= 0) return; for (i = 0; i < a->num_filters; i++) - if (s->fns && s->fns[i].task.error != -E_TASK_UNREGISTERED) + if (s->fns && s->fns[i].task.error >= 0) return; if (a->num_writers > 0) { for (i = 0; i < a->num_writers; i++) - if (s->wns && s->wns[i].task.error != -E_TASK_UNREGISTERED) + if (s->wns && s->wns[i].task.error >= 0) return; } else { - if (s->wns && s->wns[0].task.error != -E_TASK_UNREGISTERED) + if (s->wns && s->wns[0].task.error >= 0) return; } PARA_INFO_LOG("closing slot %d\n", slot_num); @@ -1174,7 +1166,7 @@ static void status_post_select(__a_unused struct sched *s, struct task *t) kill_btrn(st->ct->btrn, &st->ct->task, -E_AUDIOD_OFF); goto out; } - if (st->ct->task.error != -E_TASK_UNREGISTERED) + if (st->ct->task.error >= 0) goto out; close_stat_pipe(); st->clock_diff_count = conf.clock_diff_count_arg; @@ -1185,7 +1177,7 @@ static void status_post_select(__a_unused struct sched *s, struct task *t) size_t sz; int ret; if (st->ct->task.error < 0) { - if (st->ct->task.error != -E_TASK_UNREGISTERED) + if (st->ct->task.error >= 0) goto out; close_stat_pipe(); goto out;