Skip to content
Snippets Groups Projects
Commit 4ffb9589 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3290] Shield pointer in gnome gui when parsing codec list at startup

parent 5437adf0
No related branches found
No related tags found
No related merge requests found
...@@ -195,6 +195,8 @@ void sflphone_fill_account_list (void) { ...@@ -195,6 +195,8 @@ void sflphone_fill_account_list (void) {
int count; int count;
GQueue *codeclist; GQueue *codeclist;
DEBUG("SFLphone: Fill account list");
count = current_account_get_message_number (); count = current_account_get_message_number ();
account_list_clear (); account_list_clear ();
...@@ -1087,6 +1089,8 @@ void sflphone_fill_codec_list () { ...@@ -1087,6 +1089,8 @@ void sflphone_fill_codec_list () {
account_t *current = NULL; account_t *current = NULL;
gchar** codecs = NULL; gchar** codecs = NULL;
DEBUG("SFLphone: Fill codec list");
account_list_size = account_list_get_size (); account_list_size = account_list_get_size ();
for (i=0; i<account_list_size; i++) for (i=0; i<account_list_size; i++)
...@@ -1117,25 +1121,27 @@ void sflphone_fill_codec_list_per_account (account_t **account) { ...@@ -1117,25 +1121,27 @@ void sflphone_fill_codec_list_per_account (account_t **account) {
gboolean active = FALSE; gboolean active = FALSE;
order = (gchar**) dbus_get_active_codec_list ((*account)->accountID); order = (gchar**) dbus_get_active_codec_list ((*account)->accountID);
codeclist = (*account)->codecs; codeclist = (*account)->codecs;
// First clean the list // First clean the list
codec_list_clear (&codeclist); codec_list_clear (&codeclist);
if(!(*order)) if(!(*order))
ERROR("No codec list provided"); ERROR("SFLphone: No codec list provided");
for (pl=order; *order; order++) for (pl=order; *pl; pl++)
{ {
codec_t * cpy; codec_t * cpy = NULL;
// Each account will have a copy of the system-wide capabilities // Each account will have a copy of the system-wide capabilities
codec_create_new_from_caps (codec_list_get_by_payload ((gconstpointer) (size_t)atoi (*order), NULL), &cpy); codec_create_new_from_caps (codec_list_get_by_payload ((gconstpointer) (size_t)atoi (*pl), NULL), &cpy);
if (cpy) { if (cpy) {
cpy->is_active = TRUE; cpy->is_active = TRUE;
codec_list_add (cpy, &codeclist); codec_list_add (cpy, &codeclist);
} }
else else
ERROR ("Couldn't find codec \n"); ERROR ("SFLphone: Couldn't find codec");
} }
// Test here if we just added some active codec. // Test here if we just added some active codec.
......
...@@ -145,6 +145,11 @@ void codec_create_new_from_caps (codec_t *original, codec_t **copy) { ...@@ -145,6 +145,11 @@ void codec_create_new_from_caps (codec_t *original, codec_t **copy) {
codec_t *codec; codec_t *codec;
if(!original) {
*copy = NULL;
return;
}
codec = g_new0 (codec_t, 1); codec = g_new0 (codec_t, 1);
codec->_payload = original->_payload; codec->_payload = original->_payload;
codec->name = original->name; codec->name = original->name;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment