skypiax: better timin on windoz (thx anthm), let's see if it works on *nix
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16645 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
ea5db72a26
commit
6b3c0d6d23
|
@ -987,6 +987,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
|||
switch_mutex_unlock(globals.mutex);
|
||||
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
|
||||
}
|
||||
switch_channel_set_variable(channel, "send_silence_when_idle", "true");
|
||||
if (skypiax_tech_init(tech_pvt, *new_session) != SWITCH_STATUS_SUCCESS) {
|
||||
ERRORA("Doh! no tech_init?\n", SKYPIAX_P_LOG);
|
||||
switch_core_session_destroy(new_session);
|
||||
|
@ -1808,6 +1809,7 @@ int new_inbound_channel(private_t * tech_pvt)
|
|||
switch_core_session_destroy(&session);
|
||||
return 0;
|
||||
}
|
||||
switch_channel_set_variable(channel, "send_silence_when_idle", "true");
|
||||
if (skypiax_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS) {
|
||||
ERRORA("Doh! no tech_init?\n", SKYPIAX_P_LOG);
|
||||
switch_core_session_destroy(&session);
|
||||
|
|
|
@ -1061,20 +1061,21 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
|
|||
fdselect = fd;
|
||||
FD_SET(fdselect, &fs);
|
||||
|
||||
//FIXME rt = select(fdselect + 1, NULL, &fs, NULL, &to);
|
||||
//rt = select(fdselect + 1, NULL, &fs, NULL, &to);
|
||||
waitin=0;
|
||||
big_waited=0;
|
||||
while (tech_pvt->flag_audio_cli == 0) {
|
||||
#ifdef WIN32
|
||||
skypiax_sleep(100); //0.1 millisec
|
||||
skypiax_sleep(1000); //0.1 millisec
|
||||
#else
|
||||
skypiax_sleep(1000); //1 millisec
|
||||
#endif //WIN32
|
||||
waitin++;
|
||||
#if 0
|
||||
if(big_waited == 1 && waitin==lil_waitin && tech_pvt->flag_audio_cli == 0){
|
||||
memset(cli_out, 255, SAMPLES_PER_FRAME * sizeof(short));
|
||||
send(fd, (char *) cli_out, SAMPLES_PER_FRAME * sizeof(short), 0);
|
||||
//WARNINGA("write buffer filled at %d\n", SKYPIAX_P_LOG, waitin);
|
||||
WARNINGA("write buffer filled at %d\n", SKYPIAX_P_LOG, waitin);
|
||||
waitin=0;
|
||||
continue;
|
||||
}
|
||||
|
@ -1082,17 +1083,16 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
|
|||
memset(cli_out, 255, SAMPLES_PER_FRAME * sizeof(short));
|
||||
send(fd, (char *) cli_out, SAMPLES_PER_FRAME * sizeof(short), 0);
|
||||
send(fd, (char *) cli_out, SAMPLES_PER_FRAME * sizeof(short), 0);
|
||||
//DEBUGA_SKYPE("write buffer filled at %d\n", SKYPIAX_P_LOG, waitin);
|
||||
NOTICA("write buffer filled at %d\n", SKYPIAX_P_LOG, waitin);
|
||||
waitin=0;
|
||||
big_waited=1;
|
||||
continue;
|
||||
}
|
||||
|
||||
#endif //0
|
||||
}
|
||||
if(waitin > 21){
|
||||
//DEBUGA_SKYPE("waitin is now %d\n", SKYPIAX_P_LOG, waitin);
|
||||
NOTICA("waitin is now %d\n", SKYPIAX_P_LOG, waitin);
|
||||
}
|
||||
|
||||
rt = 1;
|
||||
|
||||
if (rt > 0) {
|
||||
|
@ -1196,7 +1196,7 @@ int skypiax_audio_read(private_t * tech_pvt)
|
|||
waitin=0;
|
||||
while (tech_pvt->flag_audio_srv == 0) {
|
||||
#ifdef WIN32
|
||||
skypiax_sleep(100); //0.1 millisec
|
||||
skypiax_sleep(1000); //0.1 millisec
|
||||
#else
|
||||
skypiax_sleep(1000); //1 millisec
|
||||
#endif //WIN32
|
||||
|
|
Loading…
Reference in New Issue