}
} else {
- if (switch_core_session_read_frame(session, &read_frame, -1, 0) != SWITCH_STATUS_SUCCESS) {
+ switch_status_t status;
+ status = switch_core_session_read_frame(session, &read_frame, -1, 0);
+
+ if (!SWITCH_READ_ACCEPTABLE(status)) {
break;
}
}
if ((write_frame.datalen = (uint32_t)switch_buffer_read(tto->audio_buffer, fdata, write_frame.codec->implementation->bytes_per_frame)) <= 0) {
- if (loops > 0) {
+ if (loops) {
switch_buffer_t *tmp;
/* Switcharoo*/
tto->loop_buffer = tmp;
loops--;
/* try again */
- if ((write_frame.datalen = (uint32_t)switch_buffer_read(tto->audio_buffer, fdata, write_frame.codec->implementation->bytes_per_frame)) <= 0) {
+ if ((write_frame.datalen =
+ (uint32_t)switch_buffer_read(tto->audio_buffer, fdata, write_frame.codec->implementation->bytes_per_frame)) <= 0) {
break;
}
} else {
- continue;
+ break;
}
}