{
GList *dec_list = NULL, *tmp;
GList *ave_list = NULL;
+ GList *ave_free_list = NULL;
GstAVElement *ave, *best_ave;
g_return_val_if_fail (factory_list != NULL, NULL);
/* There's at least raw */
ave->n_comm_cf = 1;
- dec_list = g_list_prepend (dec_list, factory);
+ ave_list = g_list_prepend (ave_list, ave);
+
+ /* We need to free these later */
+ ave_free_list = g_list_prepend (ave_free_list, ave);
continue;
}
}
g_list_free (ave_list);
+ for (tmp = ave_free_list; tmp; tmp = tmp->next)
+ g_slice_free (GstAVElement, tmp->data);
+ g_list_free (ave_free_list);
+
dec_list = g_list_reverse (dec_list);
return dec_list;