return 1;
}
-static int compute_mood_score(const struct osl_row *aft_row, long *result)
+static int compute_mood_score(const struct osl_row *aft_row, struct mood *m,
+ long *result)
{
struct mood_item *item;
int match = 0;
long score_arg_sum = 0, score = 0;
- if (!current_mood)
+ if (!m)
return -E_NO_MOOD;
/* reject audio file if it matches any entry in the deny list */
- list_for_each_entry(item, ¤t_mood->deny_list, mood_item_node)
+ list_for_each_entry(item, &m->deny_list, mood_item_node)
if (add_item_score(aft_row, item, &score, &score_arg_sum) > 0)
return -E_NOT_ADMISSIBLE;
- list_for_each_entry(item, ¤t_mood->accept_list, mood_item_node)
+ list_for_each_entry(item, &m->accept_list, mood_item_node)
if (add_item_score(aft_row, item, &score, &score_arg_sum) > 0)
match = 1;
/* reject if there is no matching entry in the accept list */
- if (!match && !list_empty(¤t_mood->accept_list))
+ if (!match && !list_empty(&m->accept_list))
return -E_NOT_ADMISSIBLE;
- list_for_each_entry(item, ¤t_mood->score_list, mood_item_node)
+ list_for_each_entry(item, &m->score_list, mood_item_node)
add_item_score(aft_row, item, &score, &score_arg_sum);
if (score_arg_sum)
score /= score_arg_sum;
long score = 0;
score = 0;
- ret = compute_mood_score(aft_row, &score);
+ ret = compute_mood_score(aft_row, current_mood, &score);
if (ret < 0)
return (ret == -E_NOT_ADMISSIBLE)? 1 : ret;
if (statistics.num >= aa->size) {
if (ret < 0)
return ret;
was_admissible = ret;
- ret = compute_mood_score(aft_row, &score);
+ ret = compute_mood_score(aft_row, current_mood, &score);
is_admissible = (ret > 0);
if (!was_admissible && !is_admissible)
return 1;