]> sjero.net Git - linphone/commitdiff
fix duplicated codecs and "Aide" menu
authorSimon Morlat <simon.morlat@linphone.org>
Mon, 4 Oct 2010 11:10:30 +0000 (13:10 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Mon, 4 Oct 2010 11:10:30 +0000 (13:10 +0200)
coreapi/linphonecore.c
gtk/main.ui

index 267fb575733846fd0cc207a15f65563cbeac4bff..447f1ab0bfd29c765690095d701c9971e4dd65d1 100644 (file)
@@ -706,6 +706,17 @@ static MSList *add_missing_codecs(SalStreamType mtype, MSList *l){
        return l;
 }
 
+static MSList *codec_append_if_new(MSList *l, PayloadType *pt){
+       MSList *elem;
+       for (elem=l;l!=NULL;l=elem->next){
+               PayloadType *ept=(PayloadType*)elem->data;
+               if (pt==ept)
+                       return l;
+       }
+       l=ms_list_append(l,pt);
+       return l;
+}
+
 static void codecs_config_read(LinphoneCore *lc)
 {
        int i;
@@ -716,7 +727,7 @@ static void codecs_config_read(LinphoneCore *lc)
                if (pt){
                        if (!ms_filter_codec_supported(pt->mime_type)){
                                ms_warning("Codec %s is not supported by mediastreamer2, removed.",pt->mime_type);
-                       }else audio_codecs=ms_list_append(audio_codecs,pt);
+                       }else audio_codecs=codec_append_if_new(audio_codecs,pt);
                }
        }
        audio_codecs=add_missing_codecs(SalAudio,audio_codecs);
@@ -724,7 +735,7 @@ static void codecs_config_read(LinphoneCore *lc)
                if (pt){
                        if (!ms_filter_codec_supported(pt->mime_type)){
                                ms_warning("Codec %s is not supported by mediastreamer2, removed.",pt->mime_type);
-                       }else video_codecs=ms_list_append(video_codecs,(void *)pt);
+                       }else video_codecs=codec_append_if_new(video_codecs,(void *)pt);
                }
        }
        video_codecs=add_missing_codecs(SalVideo,video_codecs);
index a396eb7377f73f7b108d02027697b188682fb1a3..a2c717df58e86ad65c275902c278959a0c0672ba 100644 (file)
             <child>
               <object class="GtkMenuItem" id="menuitem4">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">Aid_e</property>
+                <property name="label" translatable="yes">_Help</property>
                 <property name="use_underline">True</property>
                 <child type="submenu">
                   <object class="GtkMenu" id="menu3">