}
- if (read_impl.actual_samples_per_second) {
+ if (read_impl.actual_samples_per_second && fh->native_rate >= 1000) {
switch_channel_set_variable_printf(channel, "record_seconds", "%d", fh->samples_out / fh->native_rate);
- switch_channel_set_variable_printf(channel, "record_ms", "%d", fh->samples_out / (fh->native_rate/ 1000));
+ switch_channel_set_variable_printf(channel, "record_ms", "%d", fh->samples_out / (fh->native_rate / 1000));
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "done playing file %s\n", file);
switch_channel_set_variable_printf(channel, "playback_last_offset_pos", "%d", fh->offset_pos);
- if (read_impl.samples_per_second) {
+ if (read_impl.samples_per_second && fh->native_rate >= 1000) {
switch_channel_set_variable_printf(channel, "playback_seconds", "%d", fh->samples_in / fh->native_rate);
switch_channel_set_variable_printf(channel, "playback_ms", "%d", fh->samples_in / (fh->native_rate / 1000));
}
+
switch_channel_set_variable_printf(channel, "playback_samples", "%d", fh->samples_in);
if (switch_event_create(&event, SWITCH_EVENT_PLAYBACK_STOP) == SWITCH_STATUS_SUCCESS) {