X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=audiod.c;h=113f1132e96c92f5045c4acdc72211728230137b;hb=6663ff04ae902bdea92b35b3b8dbdccd459d9099;hp=7293285ef9687ee1c35fd46bfb735a73f6870ec0;hpb=30f67968151619955b2e998c5ce1d4183055fcfa;p=paraslash.git diff --git a/audiod.c b/audiod.c index 7293285e..113f1132 100644 --- a/audiod.c +++ b/audiod.c @@ -480,6 +480,23 @@ static void close_writers(struct slot_info *s) s->wns = NULL; } +static void notify_writers(int error) +{ + int i; + + FOR_EACH_SLOT(i) { + struct slot_info *s = slot + i; + struct audio_format_info *a; + int j; + + if (s->format < 0) + continue; + a = afi + s->format; + for (j = 0; j < a->num_writers; j++) + task_notify(s->wns[j].task, error); + } +} + static void close_filters(struct slot_info *s) { int i; @@ -1051,7 +1068,7 @@ static int signal_post_select(struct sched *s, void *context) case SIGINT: case SIGTERM: case SIGHUP: - PARA_NOTICE_LOG("received signal %d\n", signum); + PARA_WARNING_LOG("terminating on signal %d\n", signum); task_notify_all(s, E_AUDIOD_SIGNAL); return -E_AUDIOD_SIGNAL; } @@ -1218,8 +1235,9 @@ static void start_stop_decoders(void) struct slot_info *sl; close_unused_slots(); - if (audiod_status != AUDIOD_ON || - !(stat_task->vss_status & VSS_STATUS_FLAG_PLAYING)) + if (audiod_status != AUDIOD_ON) + return notify_writers(E_NOT_PLAYING); + if (!(stat_task->vss_status & VSS_STATUS_FLAG_PLAYING)) return notify_receivers(E_NOT_PLAYING); if (!must_start_decoder()) return;