From 80a4d5bdbc481b51c3d70a0bcf667829c9c24b3c Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 4 Oct 2010 13:10:30 +0200 Subject: [PATCH] fix duplicated codecs and "Aide" menu --- coreapi/linphonecore.c | 15 +++++++++++++-- gtk/main.ui | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 267fb5757..447f1ab0b 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -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); diff --git a/gtk/main.ui b/gtk/main.ui index a396eb737..a2c717df5 100644 --- a/gtk/main.ui +++ b/gtk/main.ui @@ -176,7 +176,7 @@ True - Aid_e + _Help True