提交 c0f0a6c3 authored 作者: Anthony Minessale's avatar Anthony Minessale

wait for video before recording in mod_fsv but have a 30 sec timeout

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@17104 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 8e09dab3
...@@ -108,7 +108,7 @@ SWITCH_STANDARD_APP(record_fsv_function) ...@@ -108,7 +108,7 @@ SWITCH_STANDARD_APP(record_fsv_function)
switch_mutex_t *mutex = NULL; switch_mutex_t *mutex = NULL;
switch_codec_t codec, *vid_codec; switch_codec_t codec, *vid_codec;
switch_codec_implementation_t read_impl = { 0 }; switch_codec_implementation_t read_impl = { 0 };
int count = 0; int count = 0, sanity = 30;
switch_core_session_get_read_impl(session, &read_impl); switch_core_session_get_read_impl(session, &read_impl);
switch_channel_answer(channel); switch_channel_answer(channel);
...@@ -122,6 +122,11 @@ SWITCH_STANDARD_APP(record_fsv_function) ...@@ -122,6 +122,11 @@ SWITCH_STANDARD_APP(record_fsv_function)
if (count == 0) { if (count == 0) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "%s waiting for video.\n", switch_channel_get_name(channel)); switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "%s waiting for video.\n", switch_channel_get_name(channel));
count = 100; count = 100;
if (!--sanity) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "%s timeout waiting for video.\n",
switch_channel_get_name(channel));
return;
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论