+ if (snd_ctrl.reload_sounds || snd_ctrl.reload_music)
+ {
+ 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;
+
+ printf("B\n");
+
+ if (leveldir_current == NULL)
+ leveldir_current = checked_calloc(sizeof(TreeInfo));
+ printf("B.1\n");
+ if (ti == NULL)
+ ti = *ti_ptr = checked_calloc(sizeof(TreeInfo));
+ printf("B.2\n");
+ if (leveldir_current->fullpath != NULL)
+ free(leveldir_current->fullpath);
+ printf("B.3 ['%s']\n", ti->basepath);
+#if 0
+ if (ti->basepath != NULL)
+ free(ti->basepath);
+#endif
+ printf("B.4\n");
+ if (ti->fullpath != NULL)
+ free(ti->fullpath);
+ printf("B.5\n");
+
+ printf("C\n");
+
+ 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");
+
+ printf("D\n");
+
+ 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");
+
+ printf("E\n");
+
+ InitPlaylist();
+
+ close(audio.device_fd);
+
+ printf("X\n");
+
+ if (snd_ctrl.reload_sounds)
+ {
+ artwork.sounds_set_current = set_name;
+ audio.func_reload_sounds();
+ }
+ else
+ {
+ artwork.music_set_current = set_name;
+ audio.func_reload_music();
+ }
+
+ free(set_name);
+
+ continue;
+ }
+