]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
skypiax: shorter audio buffers, sync read and write audio timers each second
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Sun, 21 Feb 2010 11:01:05 +0000 (11:01 +0000)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Sun, 21 Feb 2010 11:01:05 +0000 (11:01 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16712 d0543943-73ff-0310-b7d9-9358b9ac24b2

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

index bfcb45a1c1bfca5e0256e3587797b8ed1e492990..e66abbded29eaf76ce370d8fcd3d57086053d30e 100644 (file)
@@ -902,7 +902,7 @@ size_t bytes_read;
 
 
        if (!tech_pvt->read_buffer) {
-               int32_t len = 640 * 8;
+               int32_t len = 640 * 2;
 
                switch_buffer_create(skypiax_module_pool, &tech_pvt->read_buffer, len);
                switch_assert(tech_pvt->read_buffer);
@@ -1048,7 +1048,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
 #endif
 
        if (!tech_pvt->write_buffer) {
-               int32_t len = 320 * 8;
+               int32_t len = 320 * 4;
 
                switch_buffer_create(skypiax_module_pool, &tech_pvt->write_buffer, len);
                switch_assert(tech_pvt->write_buffer);
index 2942cc5241df119cdb00417ec408dea33ca63daf..1ae79ebd4234a56a241580ad5ddaf7ddd3f54b79 100644 (file)
@@ -500,6 +500,10 @@ int skypiax_signaling_read(private_t * tech_pvt)
                                if (!strcasecmp(prop, "FAILUREREASON")) {
                                        DEBUGA_SKYPE("Skype FAILED on skype_call %s. Let's wait for the FAILED message.\n", SKYPIAX_P_LOG, id);
                                }
+                               if (!strcasecmp(prop, "DURATION")) { /* each second, we sync ithe timers */
+                                       switch_core_timer_sync(&tech_pvt->timer_read);
+                                       switch_core_timer_sync(&tech_pvt->timer_write);
+                               }
                                if (!strcasecmp(prop, "DURATION") && (!strcasecmp(value, "1"))) {
                                        if (strcasecmp(id, tech_pvt->skype_call_id)) {
                                                skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);