X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audiod_command.c;h=07b2c81c2a528d04a92b6210bd3a5b48625823d3;hp=118c22a00351504f5a81040cae0045ce74641be9;hb=63abcd1b2f6de6ce53d82962f5a2100c5a57e5d3;hpb=32a078f2f75bcd26cccd17418c901c3b2c85b1cc diff --git a/audiod_command.c b/audiod_command.c index 118c22a0..07b2c81c 100644 --- a/audiod_command.c +++ b/audiod_command.c @@ -486,8 +486,10 @@ out: /** * Send the current audiod status to all connected stat clients. + * + * \param force Whether to write unchanged items. */ -void audiod_status_dump(void) +void audiod_status_dump(bool force) { int slot_num = get_play_time_slot_num(); char *old, *new; @@ -495,7 +497,7 @@ void audiod_status_dump(void) old = stat_item_values[SI_PLAY_TIME]; new = get_time_string(slot_num); if (new) { - if (!old || strcmp(old, new)) { + if (force || !old || strcmp(old, new)) { free(old); stat_item_values[SI_PLAY_TIME] = new; stat_client_write_item(SI_PLAY_TIME); @@ -505,7 +507,7 @@ void audiod_status_dump(void) new = get_server_uptime_str(now); old = stat_item_values[SI_AUDIOD_UPTIME]; - if (!old || strcmp(old, new)) { + if (force || !old || strcmp(old, new)) { free(old); stat_item_values[SI_AUDIOD_UPTIME] = new; stat_client_write_item(SI_AUDIOD_UPTIME); @@ -514,7 +516,7 @@ void audiod_status_dump(void) old = stat_item_values[SI_AUDIOD_STATUS]; new = audiod_status_string(); - if (!old || strcmp(old, new)) { + if (force || !old || strcmp(old, new)) { free(old); stat_item_values[SI_AUDIOD_STATUS] = new; stat_client_write_item(SI_AUDIOD_STATUS); @@ -523,7 +525,7 @@ void audiod_status_dump(void) old = stat_item_values[SI_DECODER_FLAGS]; new = decoder_flags(); - if (!old || strcmp(old, new)) { + if (force || !old || strcmp(old, new)) { free(old); stat_item_values[SI_DECODER_FLAGS] = new; stat_client_write_item(SI_DECODER_FLAGS);