]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
wait for video before recording in mod_fsv but have a 30 sec timeout
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 25 Mar 2010 19:08:00 +0000 (19:08 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 25 Mar 2010 19:08:00 +0000 (19:08 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@17104 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_fsv/mod_fsv.c

index 29b26a19e54d4b089eaad7979d1a05ca16eee6af..200706c4e7c17b3905eda07373124b16d324df06 100644 (file)
@@ -108,7 +108,7 @@ SWITCH_STANDARD_APP(record_fsv_function)
        switch_mutex_t *mutex = NULL;
        switch_codec_t codec, *vid_codec;
        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_channel_answer(channel);
@@ -122,6 +122,11 @@ SWITCH_STANDARD_APP(record_fsv_function)
                if (count == 0) {
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "%s waiting for video.\n", switch_channel_get_name(channel));
                        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;
+                       }
                }
        }