Revision
17104
Author
anthm
Date
2010-03-25 14:08:00 -0500 (Thu, 25 Mar 2010)

Log Message

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

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/applications/mod_fsv/mod_fsv.c (17103 => 17104)


--- freeswitch/trunk/src/mod/applications/mod_fsv/mod_fsv.c	2010-03-25 19:06:18 UTC (rev 17103)
+++ freeswitch/trunk/src/mod/applications/mod_fsv/mod_fsv.c	2010-03-25 19:08:00 UTC (rev 17104)
@@ -108,7 +108,7 @@
 	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 @@
 		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;
+			}
 		}
 	}