if (globals.debug) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "[OGG/OPUS Decoder]: EOF reached [%d]\n", ret);
}
- context->eof = SWITCH_TRUE;
+ context->eof = TRUE;
break;
} else /* (ret > 0)*/ {
/*The number of samples read per channel on success*/
}
}
switch_mutex_unlock(context->audio_mutex);
- context->eof = SWITCH_FALSE; // for next page
+ context->eof = FALSE; // for next page
return SWITCH_STATUS_SUCCESS;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "[OGG/OPUS File] Channels: %i\n", head->channel_count);
if (head->input_sample_rate) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "[OGG/OPUS File] Original sampling rate: %lu Hz\n", (unsigned long)head->input_sample_rate);
+ handle->samplerate = context->samplerate = head->input_sample_rate;
}
}
if (op_seekable(context->of)) {
if (!handle->handler) {
if (switch_opusfile_decode(context, data, bytes, handle->real_channels) == SWITCH_STATUS_FALSE) {
- context->eof = SWITCH_TRUE;
+ context->eof = 1;
}
}
switch_mutex_lock(context->audio_mutex);
rb = switch_buffer_read(context->audio_buffer, data, bytes);
switch_mutex_unlock(context->audio_mutex);
- if (!rb || (context->eof)) {
+ if (!rb && (context->eof)) {
return SWITCH_STATUS_FALSE;
}
if (rb) {