]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
skypiax: better timin on windoz (thx anthm), let's see if it works on *nix
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Mon, 15 Feb 2010 20:16:00 +0000 (20:16 +0000)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Mon, 15 Feb 2010 20:16:00 +0000 (20:16 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16645 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_skypiax/mod_skypiax.c
src/mod/endpoints/mod_skypiax/skypiax_protocol.c

index f2a6481a76d8c44bd5b0e95855e5864cda7bc2c7..8b721557d29a24ea9df4e549e7cd2f850dc70df2 100644 (file)
@@ -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);
index 4a9c24943614015f8723a6fc4b90b6a8641331d2..4dc493ba2ac1f2e908e952c2ed69f86aa5d0e6fe 100644 (file)
@@ -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