}
#endif
if (!tech_pvt->write_buffer) {
- int32_t max_len = BYTES_PER_FRAME * 3;
+ int32_t max_len = BYTES_PER_FRAME * 4;
switch_buffer_create(skypopen_module_pool, &tech_pvt->write_buffer, max_len);
switch_assert(tech_pvt->write_buffer);
static enum hrtimer_restart my_hrtimer_callback_inq( struct hrtimer *timer_inq )
{
struct skypopen_dev *dev = container_of(timer_inq, struct skypopen_dev, timer_inq);
- ktime_t now;
if(unload)
return HRTIMER_NORESTART;
- now = ktime_get();
- hrtimer_forward(&dev->timer_inq, now, ktime_set(0, SKYPOPEN_SLEEP * 1000000));
+ hrtimer_forward(&dev->timer_inq, timer_inq->_softexpires, ktime_set(0, SKYPOPEN_SLEEP * 1000000));
wake_up_interruptible(&dev->inq);
return HRTIMER_RESTART;
static enum hrtimer_restart my_hrtimer_callback_outq( struct hrtimer *timer_outq )
{
struct skypopen_dev *dev = container_of(timer_outq, struct skypopen_dev, timer_outq);
- ktime_t now;
if(unload)
return HRTIMER_NORESTART;
- now = ktime_get();
- hrtimer_forward(&dev->timer_outq, now, ktime_set(0, SKYPOPEN_SLEEP * 1000000));
+ hrtimer_forward(&dev->timer_outq, timer_outq->_softexpires, ktime_set(0, SKYPOPEN_SLEEP * 1000000));
wake_up_interruptible(&dev->outq);
return HRTIMER_RESTART;
if (!strcasecmp(prop, "FAILUREREASON")) {
DEBUGA_SKYPE("Skype FAILED on skype_call %s. Let's wait for the FAILED message.\n", SKYPOPEN_P_LOG, id);
}
+#if 0
if (!strcasecmp(prop, "DURATION")) { /* each 20 seconds, we zero the buffers and sync the timers */
if (!((atoi(value) % 20))) {
if (tech_pvt->read_buffer) {
DEBUGA_SKYPE("Synching audio on skype_call: %s.\n", SKYPOPEN_P_LOG, id);
}
}
+#endif //0
if (!strcasecmp(prop, "DURATION") && (!strcasecmp(value, "1"))) {
if (strcasecmp(id, tech_pvt->skype_call_id)) {
skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
if (rt > 0) {
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
- len = recv(fd, (char *) srv_in, BYTES_PER_FRAME, 0);
+ len = recv(fd, (char *) srv_in, BYTES_PER_FRAME * 2, 0);
} else {
skypopen_sleep(10000);
continue;
}
switch_mutex_lock(tech_pvt->mutex_audio_cli);
if (tech_pvt->write_buffer && switch_buffer_inuse(tech_pvt->write_buffer)) {
- bytes_to_write = switch_buffer_read(tech_pvt->write_buffer, cli_out, BYTES_PER_FRAME);
+ bytes_to_write = switch_buffer_read(tech_pvt->write_buffer, cli_out, BYTES_PER_FRAME * 2);
}
switch_mutex_unlock(tech_pvt->mutex_audio_cli);