+ char *set_name = checked_malloc(snd_ctrl.data_len);
+ TreeInfo **ti_ptr =
+ (snd_ctrl.reload_sounds ? &artwork.snd_current : &artwork.mus_current);
+ TreeInfo *ti = *ti_ptr;
+ unsigned long str_size1, str_size2, str_size3;
+
+ if (leveldir_current == NULL)
+ leveldir_current = checked_calloc(sizeof(TreeInfo));
+ if (ti == NULL)
+ ti = *ti_ptr = checked_calloc(sizeof(TreeInfo));
+ if (leveldir_current->fullpath != NULL)
+ free(leveldir_current->fullpath);
+ if (ti->basepath != NULL)
+ free(ti->basepath);
+ if (ti->fullpath != NULL)
+ free(ti->fullpath);
+
+ if (read(audio.soundserver_pipe[0], set_name,
+ snd_ctrl.data_len) != snd_ctrl.data_len ||
+ read(audio.soundserver_pipe[0], leveldir_current,
+ sizeof(TreeInfo)) != sizeof(TreeInfo) ||
+ read(audio.soundserver_pipe[0], ti,
+ sizeof(TreeInfo)) != sizeof(TreeInfo) ||
+ read(audio.soundserver_pipe[0], &str_size1,
+ sizeof(unsigned long)) != sizeof(unsigned long) ||
+ read(audio.soundserver_pipe[0], &str_size2,
+ sizeof(unsigned long)) != sizeof(unsigned long) ||
+ read(audio.soundserver_pipe[0], &str_size3,
+ sizeof(unsigned long)) != sizeof(unsigned long))
+ Error(ERR_EXIT_SOUND_SERVER, "broken pipe -- no sounds");
+
+ leveldir_current->fullpath = checked_calloc(str_size1);
+ ti->basepath = checked_calloc(str_size2);
+ ti->fullpath = checked_calloc(str_size3);
+
+ if (read(audio.soundserver_pipe[0], leveldir_current->fullpath,
+ str_size1) != str_size1 ||
+ read(audio.soundserver_pipe[0], ti->basepath,
+ str_size2) != str_size2 ||
+ read(audio.soundserver_pipe[0], ti->fullpath,
+ str_size3) != str_size3)
+ Error(ERR_EXIT_SOUND_SERVER, "broken pipe -- no sounds");
+
+ InitPlaylist();