X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=audiod.c;h=33eac4b910f00936c599a71b7cad0c251ae5190f;hb=37ed4616f98abaec9da3fd8d47b6b00f45f29b37;hp=76f07e8c635e28ad5de2a513fb863e9397dbc785;hpb=074c45e88bca5e9d12d7905efb918843b5372e04;p=paraslash.git diff --git a/audiod.c b/audiod.c index 76f07e8c..33eac4b9 100644 --- a/audiod.c +++ b/audiod.c @@ -67,7 +67,7 @@ struct slot_info slot[MAX_STREAM_SLOTS]; /** The array of status items sent by para_server. */ -char *stat_item_values[NUM_STAT_ITEMS]; +char *stat_item_values[NUM_STAT_ITEMS] = {NULL}; /** * the current mode of operation of which can be changed by the on/off/cycle @@ -874,11 +874,6 @@ static void close_stat_pipe(void) stat_task->offset_seconds = 0; audiod_status_dump(); stat_task->playing = 0; - stat_item_values[SI_BASENAME] = make_message( - "%s: no connection to para_server\n", - status_item_list[SI_BASENAME]); - stat_client_write(stat_item_values[SI_BASENAME], - SI_BASENAME); } /** @@ -1035,6 +1030,12 @@ static void status_pre_select(struct sched *s, struct task *t) client_open(argc, argv, &st->ct); set_stat_task_restart_barrier(5); } + free(stat_item_values[SI_BASENAME]); + stat_item_values[SI_BASENAME] = make_message( + "%s: no connection to para_server\n", + status_item_list[SI_BASENAME]); + stat_client_write(stat_item_values[SI_BASENAME], + SI_BASENAME); st->last_status_read = *now; out: start_stop_decoders(s);