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); skypiax_sleep(2000);
DEBUGA_SKYPE("Skype incoming audio GONE\n", SKYPIAX_P_LOG); DEBUGA_SKYPE("Skype incoming audio GONE\n", SKYPIAX_P_LOG);
skypiax_close_socket(fd); skypiax_close_socket(fd);
break;
} }
break;
} }
} }
DEBUGA_SKYPE("incoming audio server (I am it) EXITING\n", SKYPIAX_P_LOG); DEBUGA_SKYPE("incoming audio server (I am it) EXITING\n", SKYPIAX_P_LOG);
skypiax_close_socket(s); skypiax_close_socket(s);
s = -1; s = -1;
tech_pvt->tcp_srv_thread = NULL;
return NULL; return NULL;
} }
@ -1093,11 +1096,8 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
rt = 1; rt = 1;
if (rt > 0) { if (rt > 0) {
int counter;
/* until we drained the pipe to empty */ /* 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 */ /* 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)); //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))); WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got, (int) (SAMPLES_PER_FRAME * sizeof(short)));
} }
}
} else { } else {
if (rt) if (rt)
ERRORA("CLI rt=%d\n", SKYPIAX_P_LOG, 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); DEBUGA_SKYPE("Skype outbound audio GONE\n", SKYPIAX_P_LOG);
skypiax_close_socket(fd); skypiax_close_socket(fd);
break;
} }
break;
} }
} }
DEBUGA_SKYPE("outbound audio server (I am it) EXITING\n", SKYPIAX_P_LOG); DEBUGA_SKYPE("outbound audio server (I am it) EXITING\n", SKYPIAX_P_LOG);
skypiax_close_socket(s); skypiax_close_socket(s);
s = -1; s = -1;
tech_pvt->tcp_cli_thread = NULL;
return NULL; return NULL;
} }