Commit 16066bea authored by Simon Morlat's avatar Simon Morlat
Browse files

remove useless code

parent e708ccad
......@@ -588,7 +588,6 @@ static void sound_config_read(LinphoneCore *lc)
linphone_core_set_ringback(lc,tmpbuf);
linphone_core_set_play_file(lc,lp_config_get_string(lc->config,"sound","hold_music",PACKAGE_SOUND_DIR "/" HOLD_MUSIC));
check_sound_device(lc);
lc->sound_conf.latency=0;
#ifndef __ios
tmp=TRUE;
......
......@@ -54,132 +54,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define pclose _pclose
#endif
#if !defined(WIN32)
static char lock_name[80];
static char lock_set=0;
/* put a lock file in /tmp. this is called when linphone runs as a daemon*/
int set_lock_file()
{
FILE *lockfile;
snprintf(lock_name,80,"/tmp/linphone.%i",getuid());
lockfile=fopen(lock_name,"w");
if (lockfile==NULL)
{
printf("Failed to create lock file.\n");
return(-1);
}
fprintf(lockfile,"%i",getpid());
fclose(lockfile);
lock_set=1;
return(0);
}
/* looks if there is a lock file. If presents return its content (the pid of the already running linphone), if not found, returns -1*/
int get_lock_file()
{
int pid;
FILE *lockfile;
snprintf(lock_name,80,"/tmp/linphone.%i",getuid());
lockfile=fopen(lock_name,"r");
if (lockfile==NULL)
return(-1);
if (fscanf(lockfile,"%i",&pid)!=1){
ms_warning("Could not read pid in lock file.");
fclose(lockfile);
return -1;
}
fclose(lockfile);
return pid;
}
/* remove the lock file if it was set*/
int remove_lock_file()
{
int err=0;
if (lock_set)
{
err=unlink(lock_name);
lock_set=0;
}
return(err);
}
#endif
char *int2str(int number)
{
char *numstr=ms_malloc(10);
snprintf(numstr,10,"%i",number);
return numstr;
}
void check_sound_device(LinphoneCore *lc)
{
#ifdef _linux
int fd=0;
int len;
int a;
char *file=NULL;
char *i810_audio=NULL;
char *snd_pcm_oss=NULL;
char *snd_mixer_oss=NULL;
char *snd_pcm=NULL;
fd=open("/proc/modules",O_RDONLY);
if (fd>0){
/* read the entire /proc/modules file and check if sound conf seems correct */
/*a=fstat(fd,&statbuf);
if (a<0) ms_warning("Can't stat /proc/modules:%s.",strerror(errno));
len=statbuf.st_size;
if (len==0) ms_warning("/proc/modules has zero size!");
*/
/***** fstat does not work on /proc/modules for unknown reason *****/
len=6000;
file=ms_malloc(len+1);
a=read(fd,file,len);
if (a<len) file=ms_realloc(file,a+1);
file[a]='\0';
i810_audio=strstr(file,"i810_audio");
if (i810_audio!=NULL){
/* I'm sorry i put this warning in comments because
* i don't use yet the right driver !! */
/* lc->vtable.display_warning(lc,_("You are currently using the i810_audio driver.\nThis driver is buggy and so does not work with Linphone.\nWe suggest that you replace it by its equivalent ALSA driver,\neither with packages from your distribution, or by downloading\nALSA drivers at http://www.alsa-project.org."));*/
goto end;
}
snd_pcm=strstr(file,"snd-pcm");
if (snd_pcm!=NULL){
snd_pcm_oss=strstr(file,"snd-pcm-oss");
snd_mixer_oss=strstr(file,"snd-mixer-oss");
if (snd_pcm_oss==NULL){
lc->vtable.display_warning(lc,_("Your computer appears to be using ALSA sound drivers.\nThis is the best choice. However the pcm oss emulation module\nis missing and linphone needs it. Please execute\n'modprobe snd-pcm-oss' as root to load it."));
}
if (snd_mixer_oss==NULL){
lc->vtable.display_warning(lc,_("Your computer appears to be using ALSA sound drivers.\nThis is the best choice. However the mixer oss emulation module\nis missing and linphone needs it. Please execute\n 'modprobe snd-mixer-oss' as root to load it."));
}
}
}else {
ms_warning("Could not open /proc/modules.");
}
/* now check general volume. Some user forget to rise it and then complain that linphone is
not working */
/* but some other users complain that linphone should not change levels...
if (lc->sound_conf.sndcard!=NULL){
a=snd_card_get_level(lc->sound_conf.sndcard,SND_CARD_LEVEL_GENERAL);
if (a<50){
ms_warning("General level is quite low (%i). Linphone rises it up for you.",a);
snd_card_set_level(lc->sound_conf.sndcard,SND_CARD_LEVEL_GENERAL,80);
}
}
*/
end:
if (file!=NULL) ms_free(file);
if (fd>0) close(fd);
#endif
}
#define UDP_HDR_SZ 8
#define RTP_HDR_SZ 12
......
......@@ -263,10 +263,7 @@ LinphoneFriend *linphone_find_friend_by_out_subscribe(MSList *l, SalOp *op);
MSList *linphone_find_friend_by_address(MSList *fl, const LinphoneAddress *addr, LinphoneFriend **lf);
int parse_hostname_to_addr(const char *server, struct sockaddr_storage *ss, socklen_t *socklen, int default_port);
int set_lock_file();
int get_lock_file();
int remove_lock_file();
void check_sound_device(LinphoneCore *lc);
void linphone_core_get_local_ip(LinphoneCore *lc, int af, char *result);
bool_t host_has_ipv6_network();
bool_t lp_spawn_command_line_sync(const char *command, char **result,int *command_ret);
......
mediastreamer2 @ 311ff6a9
Subproject commit 268095f87635f257bb2b8817cdb57870e9db91db
Subproject commit 311ff6a9400967684a6de2c840e5c6f4d0d132c4
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