- ret = activate_mood_or_playlist(arg, &num_admissible);
- if (ret < 0) {
- ret2 = para_printf(&pb, "%s\nswitching back to %s\n",
- para_strerror(-ret), current_mop?
- current_mop : "dummy");
- ret = activate_mood_or_playlist(current_mop, &num_admissible);
- if (ret < 0) {
- if (ret2 >= 0)
- ret2 = para_printf(&pb, "failed, switching to dummy\n");
- activate_mood_or_playlist(NULL, &num_admissible);
- }
- } else
- ret2 = para_printf(&pb, "activated %s (%d admissible files)\n",
- current_mop? current_mop : "dummy mood",
- num_admissible);
+ ret = activate_mood_or_playlist(arg, &num_admissible, &errmsg);
+ if (ret >= 0)
+ goto out;
+ /* ignore subsequent errors (but log them) */
+ para_printf(&aca->pbout, "%s\n", errmsg);
+ free(errmsg);
+ para_printf(&aca->pbout, "could not activate %s\n", arg);
+ if (current_mop && strcmp(current_mop, arg) != 0) {
+ int ret2;
+ para_printf(&aca->pbout, "switching back to %s\n", current_mop);
+ ret2 = activate_mood_or_playlist(current_mop, &num_admissible,
+ &errmsg);
+ if (ret2 >= 0)
+ goto out;
+ para_printf(&aca->pbout, "%s\n", errmsg);
+ free(errmsg);
+ para_printf(&aca->pbout, "could not reactivate %s: %s\n",
+ current_mop, para_strerror(-ret2));
+ }
+ para_printf(&aca->pbout, "activating dummy mood\n");
+ activate_mood_or_playlist(NULL, &num_admissible, NULL);