skypiax: let the audio threads die at each call end

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16642 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Giovanni Maruzzelli 2010-02-15 10:34:55 +00:00
parent 549e07f29e
commit c923813659
1 changed files with 59 additions and 57 deletions

View File

@ -933,13 +933,16 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
skypiax_sleep(2000);
DEBUGA_SKYPE("Skype incoming audio GONE\n", SKYPIAX_P_LOG);
skypiax_close_socket(fd);
break;
}
break;
}
}
DEBUGA_SKYPE("incoming audio server (I am it) EXITING\n", SKYPIAX_P_LOG);
skypiax_close_socket(s);
s = -1;
tech_pvt->tcp_srv_thread = NULL;
return NULL;
}
@ -1043,13 +1046,13 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
to.tv_usec = 120000; //120msec
to.tv_sec = 0;
#if defined(WIN32) && !defined(__CYGWIN__)
/* on win32 we cannot select from the apr "pipe", so we select on socket writability */
/* on win32 we cannot select from the apr "pipe", so we select on socket writability */
fdselect = fd;
FD_SET(fdselect, &fs);
//rt = select(fdselect + 1, NULL, &fs, NULL, &to);
#else
/* on *unix and cygwin we select from the real pipe */
/* on *unix and cygwin we select from the real pipe */
//XXX fdselect = tech_pvt->audiopipe_cli[0];
//XXX FD_SET(fdselect, &fs);
@ -1093,11 +1096,8 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
rt = 1;
if (rt > 0) {
int counter;
/* until we drained the pipe to empty */
//for (counter = 0; counter < 10; counter++) {
for (counter = 0; counter < 1; counter++) {
/* read from the pipe the audio frame we are supposed to send out */
//got = skypiax_pipe_read(tech_pvt->audiopipe_cli[0], cli_in, SAMPLES_PER_FRAME * sizeof(short));
@ -1155,7 +1155,6 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got, (int) (SAMPLES_PER_FRAME * sizeof(short)));
}
}
} else {
if (rt)
ERRORA("CLI rt=%d\n", SKYPIAX_P_LOG, rt);
@ -1176,13 +1175,16 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
}
DEBUGA_SKYPE("Skype outbound audio GONE\n", SKYPIAX_P_LOG);
skypiax_close_socket(fd);
break;
}
break;
}
}
DEBUGA_SKYPE("outbound audio server (I am it) EXITING\n", SKYPIAX_P_LOG);
skypiax_close_socket(s);
s = -1;
tech_pvt->tcp_cli_thread = NULL;
return NULL;
}