From 05229ca079866640b2aa1ab312bf86eb4a7e571e Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 7 May 2015 11:52:38 +0200 Subject: [PATCH 01/10] Use videostream ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 05fba59cf..7898df428 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 05fba59cf8aa11914ad6130955c1a6d60d67eda5 +Subproject commit 7898df428a2c6a56901cb81e2ee760c0643efc44 From 3d8cd3e4567ec843959491605b0d2621d175b7fe Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Thu, 7 May 2015 14:53:19 +0200 Subject: [PATCH 02/10] Update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 7898df428..d5ba834e6 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 7898df428a2c6a56901cb81e2ee760c0643efc44 +Subproject commit d5ba834e68b9a182bce500cc1cbdcd582fa1c3ee From d6cdbe46c485417c4b7cff13b092289ae87f025f Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 11 May 2015 10:27:23 +0200 Subject: [PATCH 03/10] lpconfig.c: add lp_config_relative_file_exists and use it to avoid false-positive logs for .linphone.ecstate file --- coreapi/linphonecall.c | 5 +++-- coreapi/lpconfig.c | 20 +++++++++++++++++--- coreapi/lpconfig.h | 5 +++++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 4f2a571a9..94655e19c 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "mediastreamer2/mseventqueue.h" #include "mediastreamer2/mssndcard.h" -static const char EC_STATE_STORE[] = ".linphone.ecstate"; +static const char *EC_STATE_STORE = ".linphone.ecstate"; #define EC_STATE_MAX_LEN 1048576 // 1Mo static void linphone_call_stats_uninit(LinphoneCallStats *stats); @@ -1980,7 +1980,8 @@ void linphone_call_init_audio_stream(LinphoneCall *call){ audio_stream_set_echo_canceller_params(audiostream,len,delay,framesize); if (audiostream->ec) { char *statestr=ms_malloc0(EC_STATE_MAX_LEN); - if (lp_config_read_relative_file(lc->config, EC_STATE_STORE, statestr, EC_STATE_MAX_LEN) == 0) { + if (lp_config_relative_file_exists(lc->config, EC_STATE_STORE) + && lp_config_read_relative_file(lc->config, EC_STATE_STORE, statestr, EC_STATE_MAX_LEN) == 0) { ms_filter_call_method(audiostream->ec, MS_ECHO_CANCELLER_SET_STATE_STRING, statestr); } ms_free(statestr); diff --git a/coreapi/lpconfig.c b/coreapi/lpconfig.c index f6755863b..d45a199db 100644 --- a/coreapi/lpconfig.c +++ b/coreapi/lpconfig.c @@ -100,7 +100,7 @@ LpItem * lp_comment_new(const char *comment){ pos=strchr(item->value,'\r'); if (pos==NULL) pos=strchr(item->value,'\n'); - + if(pos) { *pos='\0'; /*replace the '\n' */ } @@ -362,7 +362,7 @@ LpConfig *lp_config_new_with_factory(const char *config_filename, const char *fa ms_message("Using (r/w) config information from %s", config_filename); lpconfig->filename=ortp_strdup(config_filename); lpconfig->tmpfilename=ortp_strdup_printf("%s.tmp",config_filename); - + #if !defined(WIN32) { struct stat fileStat; @@ -719,6 +719,20 @@ static char *_lp_config_dirname(char *path) { #endif } +bool_t lp_config_relative_file_exists(const LpConfig *lpconfig, const char *filename) { + if (lpconfig->filename == NULL) + return FALSE; + char *dir = _lp_config_dirname(lpconfig->filename); + char *filepath = ms_strdup_printf("%s/%s", dir, filename); + FILE *file = fopen(filepath, "r"); + ms_free(dir); + ms_free(filepath); + if (file) { + fclose(file); + } + return file != NULL; +} + void lp_config_write_relative_file(const LpConfig *lpconfig, const char *filename, const char *data) { if (lpconfig->filename == NULL) return; if(strlen(data) > 0) { @@ -760,7 +774,7 @@ int lp_config_read_relative_file(const LpConfig *lpconfig, const char *filename, ms_free(dir); ms_free(filepath); return 0; - + err: ms_free(dir); ms_free(filepath); diff --git a/coreapi/lpconfig.h b/coreapi/lpconfig.h index 65fd613f4..b03bfa57f 100644 --- a/coreapi/lpconfig.h +++ b/coreapi/lpconfig.h @@ -290,6 +290,11 @@ LINPHONE_PUBLIC void lp_config_write_relative_file(const LpConfig *lpconfig, con */ LINPHONE_PUBLIC int lp_config_read_relative_file(const LpConfig *lpconfig, const char *filename, char *data, size_t max_length); +/** + * @return TRUE if file exists relative to the to the current location +**/ +LINPHONE_PUBLIC bool_t lp_config_relative_file_exists(const LpConfig *lpconfig, const char *filename); + #ifdef __cplusplus } #endif From d5ca030abb3f2f053a1c6763d43bd0044ba19dcd Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 11 May 2015 11:11:06 +0200 Subject: [PATCH 04/10] Update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index df8fdb8f4..5b23e7669 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit df8fdb8f4d4284b294fe5c0890ba89e2943050f5 +Subproject commit 5b23e766981439ba00865d2f9df51c244a262864 From b0d930802ec17954e70710e1ae2092bd2c4e4c5c Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 11 May 2015 11:28:10 +0200 Subject: [PATCH 05/10] Update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 5b23e7669..49940c15f 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 5b23e766981439ba00865d2f9df51c244a262864 +Subproject commit 49940c15fba7c56ad16af3e5ebc3cfb32e2692b8 From 6ac2b798b6a558a68acddeeb429fe88149b8c5a2 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 11 May 2015 13:59:11 +0200 Subject: [PATCH 06/10] README.macos.md: update homebrew doc a bit --- README.macos.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.macos.md b/README.macos.md index 6f54e1444..89e3b3525 100644 --- a/README.macos.md +++ b/README.macos.md @@ -44,14 +44,14 @@ Install `GTK`. It is recommended to use the `quartz` backend for better integrat antlr3.2 gettext speex ffmpeg readline libvpx opus ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize brew link --force gettext + #readline is required from linphonec.c otherwise compilation will fail + brew link readline --force ##### Linphone UI (GTK version) - brew install cairo --without-x11 + brew install cairo --without-x11 brew install gtk+ --without-x11 - brew install gettext gtk-mac-integration libsoup hicolor-icon-theme - #readline is required from linphonec.c otherwise compilation will fail - brew link readline --force + brew install gtk-mac-integration libsoup hicolor-icon-theme ### Building Linphone From 4e974956cb4644282bb22584baa444f7af6030b7 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Mon, 11 May 2015 16:59:50 +0200 Subject: [PATCH 07/10] lpconfig.c: fix ISO C90 error --- coreapi/lpconfig.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/coreapi/lpconfig.c b/coreapi/lpconfig.c index d45a199db..d1be24dc7 100644 --- a/coreapi/lpconfig.c +++ b/coreapi/lpconfig.c @@ -720,17 +720,19 @@ static char *_lp_config_dirname(char *path) { } bool_t lp_config_relative_file_exists(const LpConfig *lpconfig, const char *filename) { - if (lpconfig->filename == NULL) + if (lpconfig->filename == NULL) { return FALSE; - char *dir = _lp_config_dirname(lpconfig->filename); - char *filepath = ms_strdup_printf("%s/%s", dir, filename); - FILE *file = fopen(filepath, "r"); - ms_free(dir); - ms_free(filepath); - if (file) { - fclose(file); + } else { + char *dir = _lp_config_dirname(lpconfig->filename); + char *filepath = ms_strdup_printf("%s/%s", dir, filename); + FILE *file = fopen(filepath, "r"); + ms_free(dir); + ms_free(filepath); + if (file) { + fclose(file); + } + return file != NULL; } - return file != NULL; } void lp_config_write_relative_file(const LpConfig *lpconfig, const char *filename, const char *data) { From 55823335236d9a0fc2d17ffdb353afb626151b56 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 12 May 2015 11:00:57 +0200 Subject: [PATCH 08/10] .gitignore: ignore build/macos/pkg-distribution.xml autogenerated file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index cb5a36dea..dd920d531 100644 --- a/.gitignore +++ b/.gitignore @@ -84,3 +84,4 @@ po/linphone.pot tester/linphone_log.gz.txt tools/auto_answer tools/lp-autoanswer +build/macos/pkg-distribution.xml From f1b42dc2995fa4f934c4313e94aca0bc63d58c7a Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 12 May 2015 13:54:02 +0200 Subject: [PATCH 09/10] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 49940c15f..80eeb75f1 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 49940c15fba7c56ad16af3e5ebc3cfb32e2692b8 +Subproject commit 80eeb75f12ecdcf20bc0e9c5fc90bf91842dcfe9 From a7bacc85d996cf9006729acf41aa7ae9b5237bbb Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 12 May 2015 14:47:55 +0200 Subject: [PATCH 10/10] bc_tester_utils.h: update macros --- mediastreamer2 | 2 +- tester/call_tester.c | 6 +++--- tester/common/bc_tester_utils.h | 31 +++++++++---------------------- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/mediastreamer2 b/mediastreamer2 index 80eeb75f1..ceb0f52e8 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 80eeb75f12ecdcf20bc0e9c5fc90bf91842dcfe9 +Subproject commit ceb0f52e88084ceafbb43087c6742a04f4543f88 diff --git a/tester/call_tester.c b/tester/call_tester.c index 8c8640ec3..58b396704 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -2363,9 +2363,9 @@ static void call_with_file_player(void) { { double similar; const int threshold = 90; - BC_ASSERT_EQUAL_INT(ms_audio_diff(hellopath,recordpath,&similar,audio_cmp_min_overlap,NULL,NULL), 0); - BC_ASSERT_GREATER_INT(100*similar, threshold); - BC_ASSERT_LOWER_INT(100*similar, 100); + BC_ASSERT_EQUAL_WITH_TYPE(ms_audio_diff(hellopath,recordpath,&similar,audio_cmp_min_overlap,NULL,NULL), 0, int, "%d"); + BC_ASSERT_GREATER_WITH_TYPE(100*similar, threshold, int, "%d"); + BC_ASSERT_LOWER_WITH_TYPE(100*similar, 100, int, "%d"); if (threshold < 100*similar && 100*similar < 100) { remove(recordpath); } diff --git a/tester/common/bc_tester_utils.h b/tester/common/bc_tester_utils.h index 68f573bed..6bd17b03c 100644 --- a/tester/common/bc_tester_utils.h +++ b/tester/common/bc_tester_utils.h @@ -124,37 +124,24 @@ char * bc_tester_res(const char *name); #define BC_ASSERT_LOWER(actual, expected) CU_assertImplementation(((actual) <= (expected)), __LINE__, ("CU_ASSERT_LOWER(" #actual "," #expected ")"), __FILE__, "", CU_FALSE) /*Add some custom defines with logs in case of fail*/ -#define BC_ASSERT_EQUAL_INT(actual, expected) { \ - int cactual = (actual), cexpected = (expected); \ +#define BC_ASSERT_EQUAL_WITH_TYPE(actual, expected, type, type_format) { \ + type cactual = (actual), cexpected = (expected); \ if (! BC_ASSERT_EQUAL(cactual, cexpected)) { \ - bc_tester_printf(bc_printf_verbosity_error, "%s:%d - Expected " #actual " = " #expected " but was %d != %d\n", __FILE__, __LINE__, cactual, cexpected); \ + bc_tester_printf(bc_printf_verbosity_error, "%s:%d - Expected " #actual " = " #expected " but was " type_format " != " type_format "\n", __FILE__, __LINE__, cactual, cexpected); \ } \ } -#define BC_ASSERT_GREATER_INT(actual, expected) { \ - int cactual = (actual), cexpected = (expected); \ +#define BC_ASSERT_GREATER_WITH_TYPE(actual, expected, type, type_format) { \ + type cactual = (actual), cexpected = (expected); \ if (! BC_ASSERT_GREATER(cactual, cexpected)) { \ - bc_tester_printf(bc_printf_verbosity_error, "%s:%d - Expected " #actual " >= " #expected " but was %d < %d\n", __FILE__, __LINE__, cactual, cexpected); \ + bc_tester_printf(bc_printf_verbosity_error, "%s:%d - Expected " #actual " >= " #expected " but was " type_format " < " type_format "\n", __FILE__, __LINE__, cactual, cexpected); \ } \ } -#define BC_ASSERT_LOWER_INT(actual, expected) { \ - int cactual = (actual), cexpected = (expected); \ +#define BC_ASSERT_LOWER_WITH_TYPE(actual, expected, type, type_format) { \ + type cactual = (actual), cexpected = (expected); \ if (! BC_ASSERT_LOWER(cactual, cexpected)) { \ - bc_tester_printf(bc_printf_verbosity_error, "%s:%d - Expected " #actual " <= " #expected " but was %d > %d\n", __FILE__, __LINE__, cactual, cexpected); \ + bc_tester_printf(bc_printf_verbosity_error, "%s:%d - Expected " #actual " <= " #expected " but was " type_format " > " type_format "\n", __FILE__, __LINE__, cactual, cexpected); \ } \ } -#define BC_ASSERT_GREATER_UINT64_T(actual, expected) { \ - uint64_t cactual = (actual), cexpected = (expected); \ - if (! BC_ASSERT_GREATER(cactual, cexpected)) { \ - bc_tester_printf(bc_printf_verbosity_error, "%s:%d - Expected " #actual " >= " #expected " but was %lu < %lu\n", __FILE__, __LINE__, (long unsigned)cactual, (long unsigned)cexpected); \ - } \ -} -#define BC_ASSERT_LOWER_UINT64_T(actual, expected) { \ - uint64_t cactual = (actual), cexpected = (expected); \ - if (! BC_ASSERT_LOWER(cactual, cexpected)) { \ - bc_tester_printf(bc_printf_verbosity_error, "%s:%d - Expected " #actual " <= " #expected " but was %lu > %lu\n", __FILE__, __LINE__, (long unsigned)cactual, (long unsigned)cexpected); \ - } \ -} - #ifdef __cplusplus }