提交 2a7b0227 authored 作者: Brian West's avatar Brian West

FS-6980 #resolve don't crash when using native recording on recordstop the redo

上级 72c3df5e
...@@ -1215,12 +1215,13 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s ...@@ -1215,12 +1215,13 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
switch_file_remove(rh->file, switch_core_session_get_pool(session)); switch_file_remove(rh->file, switch_core_session_get_pool(session));
} }
if (rh->fh) {
switch_channel_set_variable_printf(channel, "record_samples", "%d", rh->fh->samples_out);
if (read_impl.actual_samples_per_second) { if (read_impl.actual_samples_per_second) {
switch_channel_set_variable_printf(channel, "record_seconds", "%d", rh->fh->samples_out / read_impl.actual_samples_per_second); switch_channel_set_variable_printf(channel, "record_seconds", "%d", rh->fh->samples_out / read_impl.actual_samples_per_second);
switch_channel_set_variable_printf(channel, "record_ms", "%d", rh->fh->samples_out / (read_impl.actual_samples_per_second / 1000)); switch_channel_set_variable_printf(channel, "record_ms", "%d", rh->fh->samples_out / (read_impl.actual_samples_per_second / 1000));
} }
switch_channel_set_variable_printf(channel, "record_samples", "%d", rh->fh->samples_out); }
} }
if (switch_event_create(&event, SWITCH_EVENT_RECORD_STOP) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&event, SWITCH_EVENT_RECORD_STOP) == SWITCH_STATUS_SUCCESS) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论