]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - mood.c
afs: Update dummy mood assumptions to reflect the reality.
[paraslash.git] / mood.c
diff --git a/mood.c b/mood.c
index d6a8292340aba7f48fb7816f96d9e9c0f672f210..5268e77fe03c7e56d1b146935f683e30dea9a2f6 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -857,8 +857,7 @@ void close_current_mood(void)
  *
  * If there is already an open mood, it will be closed first.
  *
- * \return Positive on success, negative on errors. Loading the dummy mood
- * always succeeds.
+ * \return Positive on success, negative on errors.
  *
  * \sa struct \ref afs_info::last_played, \ref mp_eval_row().
  */
@@ -903,7 +902,7 @@ int change_current_mood(const char *mood_name, char **errmsg)
        if (ret < 0) {
                if (errmsg)
                        *errmsg = make_message("audio file loop failed");
-               return ret;
+               goto out;
        }
        for (i = 0; i < statistics.num; i++) {
                struct admissible_file_info *a = aa.array + i;
@@ -919,6 +918,8 @@ int change_current_mood(const char *mood_name, char **errmsg)
        ret = statistics.num;
 out:
        free(aa.array);
+       if (ret < 0)
+               close_current_mood();
        return ret;
 }