switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "done playing file\n");
if (read_impl.samples_per_second) {
- switch_channel_set_variable_printf(channel, "playback_seconds", "%d", fh->samples_out / read_impl.samples_per_second);
- switch_channel_set_variable_printf(channel, "playback_ms", "%d", fh->samples_out / (read_impl.samples_per_second / 1000));
+ switch_channel_set_variable_printf(channel, "playback_seconds", "%d", fh->samples_in / read_impl.samples_per_second);
+ switch_channel_set_variable_printf(channel, "playback_ms", "%d", fh->samples_in / (read_impl.samples_per_second / 1000));
}
- switch_channel_set_variable_printf(channel, "playback_samples", "%d", fh->samples_out);
+ switch_channel_set_variable_printf(channel, "playback_samples", "%d", fh->samples_in);
switch_core_session_io_write_lock(session);
switch_channel_set_private(channel, "__fh", NULL);