X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=mood.c;h=1e15ef0e081480381fcbc4fdad2179848f429c1f;hb=refs%2Fheads%2Fpu;hp=18c02f7fa2f0529175c4b84bfc73600354fa3211;hpb=ab4c39c7cd1c6d2b03cedf5d83521c746433367b;p=paraslash.git diff --git a/mood.c b/mood.c index 18c02f7f..1e15ef0e 100644 --- a/mood.c +++ b/mood.c @@ -541,12 +541,15 @@ static char *get_statistics(struct mood_instance *m, int64_t sse) "loaded mood %s (%u files)\n" "last_played mean/sigma: %d/%d days\n" "num_played mean/sigma: %" PRId64 "/%" PRIu64 "\n" + "correction factor ratio: %.2lf\n" , m->name? m->name : "(dummy)", n, mean_days, sigma_days, m->stats.num_played_sum / n, - int_sqrt(m->stats.num_played_qd / n) + int_sqrt(m->stats.num_played_qd / n), + 86400.0 * m->stats.last_played_correction / + m->stats.num_played_correction ); } @@ -663,9 +666,10 @@ int mood_load(const char *mood_name, struct mood_instance **result, char **msg) mood_unload(NULL); current_mood = aa.m; } + ret = 1; out: free(aa.array); - if (ret < 0) + if (ret <= 0) /* error, or no admissible files */ destroy_mood(aa.m); return ret; }