Commit 147b143d authored by Simon Morlat's avatar Simon Morlat

update ms2, factorize code, clean logs

parent 88217dca
......@@ -1075,7 +1075,10 @@ static bool_t get_codec(LinphoneCore *lc, SalStreamType type, int index, Payload
pt=find_payload(type==SalAudio ? lc->default_audio_codecs : lc->default_video_codecs,mime,rate,channels,fmtp);
if (!pt){
MSList **default_list=(type==SalAudio) ? &lc->default_audio_codecs : &lc->default_video_codecs;
ms_warning("Codec %s/%i read from conf is not in the default list.",mime,rate);
if (type==SalAudio)
ms_warning("Codec %s/%i/%i read from conf is not in the default list.",mime,rate,channels);
else
ms_warning("Codec %s/%i read from conf is not in the default list.",mime,rate);
pt=payload_type_new();
pt->type=(type==SalAudio) ? PAYLOAD_AUDIO_PACKETIZED : PAYLOAD_VIDEO;
pt->mime_type=ortp_strdup(mime);
......
......@@ -60,32 +60,9 @@ static void linphone_remote_provisioning_apply(LinphoneCore *lc, const char *xml
, error_msg);
}
static char *load_file_content(const char *path){
FILE *f=fopen(path,"rb");
size_t bufsize=2048;
size_t step=bufsize;
size_t pos=0;
size_t count;
char *buffer=ms_malloc(bufsize+1);
if (!f) {
ms_error("load_file_content(): could not open [%s]",path);
return NULL;
}
while((count=fread(buffer+pos, 1, step, f))>0){
pos+=count;
if (pos+step>=bufsize){
bufsize*=2;
buffer=ms_realloc(buffer, bufsize+1);
}
}
buffer[pos]='\0';
fclose(f);
return buffer;
}
int linphone_remote_provisioning_load_file( LinphoneCore* lc, const char* file_path){
int status = -1;
char* provisioning=load_file_content(file_path);
char* provisioning=ms_load_path_content(file_path, NULL);
if (provisioning){
linphone_remote_provisioning_apply(lc, provisioning);
......
mediastreamer2 @ 4e8d9732
Subproject commit a8664070e8ad92688f287727f6ec9bc7ed0d9c45
Subproject commit 4e8d9732b07a796b2059c2417259323fd9148d0e
/*
belle-sip - SIP (RFC3261) library.
Copyright (C) 2010 Belledonne Communications SARL
Linphone
Copyright (C) 2014 Belledonne Communications SARL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment