\param timer the timer to wait on
\return the newest sample count
*/
-SWITCH_DECLARE(int) switch_core_timer_next(switch_timer_t *timer);
+SWITCH_DECLARE(switch_status_t) switch_core_timer_next(switch_timer_t *timer);
/*!
\brief Step the timer one step
switch_size_t file_data_len = samples * 2;
/* Sync the conference to a single timing source */
- switch_core_timer_next(&timer);
+ if (switch_core_timer_next(&timer) != SWITCH_STATUS_SUCCESS) {
+ switch_set_flag(conference, CFLAG_DESTRUCT);
+ break;
+ }
switch_mutex_lock(conference->mutex);
ready = 0;
}
}
- switch_core_timer_next(&timer);
+ if (switch_core_timer_next(&timer) != SWITCH_STATUS_SUCCESS) {
+ break;
+ }
} /* Rinse ... Repeat */
{
switch_size_t olen = globals.read_codec.implementation->samples_per_frame;
- if (switch_core_timer_next(&tech_pvt->timer) < 0) {
+ if (switch_core_timer_next(&tech_pvt->timer) != SWITCH_STATUS_SUCCESS) {
switch_core_file_close(&tech_pvt->fh);
switch_core_codec_destroy(&tech_pvt->write_codec);
goto cng;
}
if (tto->timer) {
- if (switch_core_timer_next(tto->timer)< 0) {
+ if (switch_core_timer_next(tto->timer) != SWITCH_STATUS_SUCCESS) {
break;
}
}
-SWITCH_DECLARE(int) switch_core_timer_next(switch_timer_t *timer)
+SWITCH_DECLARE(switch_status_t) switch_core_timer_next(switch_timer_t *timer)
{
if (!timer->timer_interface) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Timer is not initilized!\n");
}
if (timer->timer_interface->timer_next(timer) == SWITCH_STATUS_SUCCESS) {
- return timer->samplecount;
+ return SWITCH_STATUS_SUCCESS;
} else {
- return -1;
+ return SWITCH_STATUS_GENERR;
}
}
if (timer_name) {
- if (switch_core_timer_next(&timer) < 0) {
+ if (switch_core_timer_next(&timer) != SWITCH_STATUS_SUCCESS) {
break;
}
} else { /* time off the channel (if you must) */
if (switch_test_flag(sh, SWITCH_SPEECH_FLAG_PAUSE)) {
if (timer) {
- if ((x = switch_core_timer_next(timer)) < 0) {
+ if (switch_core_timer_next(timer) != SWITCH_STATUS_SUCCESS) {
break;
}
} else {
}
if (timer) {
- if ((x = switch_core_timer_next(timer)) < 0) {
+ if (switch_core_timer_next(timer) != SWITCH_STATUS_SUCCESS) {
break;
}
} else { /* time off the channel (if you must) */