/* Update metadata on server via fork. * Note that the very first metadata update after connection is delayed, * because if we try to update our new info to the server and the server has * not yet accepted us as a source, the information is lost. */ void ices_metadata_update(int delay) { pid_t child; if (delay) ices_log_debug("Delaying metadata update..."); if ((child = fork()) == 0) { metadata_update(delay ? INITDELAY : 0); _exit(0); } if (child == -1) ices_log_debug("Metadata update failed: fork"); }
/* Update metadata on server via fork. * It also does the job of cleaning up the song title to something the * world likes. * Note that the very first metadata update is delayed, because if we * try to update our new info to the server and the server has not yet * accepted us as a source, the information is lost. */ void ices_metadata_update (input_stream_t* source) { static int delay = INITDELAY; pid_t child; if (delay) ices_log_debug ("Initially delaying metadata update..."); if ((child = fork()) == 0) { metadata_update (source, delay); _exit (0); } if (child == -1) ices_log_debug ("Metadata update failed: fork"); delay = 0; }