Revision
16330
Author
gmaruzz
Date
2010-01-16 11:15:12 -0600 (Sat, 16 Jan 2010)

Log Message

skypiax: changed audio i/o tcp socket size and timing constant on linux, for better compatibility with virtual machines

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (16329 => 16330)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	2010-01-16 00:41:10 UTC (rev 16329)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	2010-01-16 17:15:12 UTC (rev 16330)
@@ -93,7 +93,11 @@
  * use:
  * sockbufsize=SAMPLES_PER_FRAME * 8;
  */
+#ifdef WIN32
 	sockbufsize=SAMPLES_PER_FRAME * 8 * 3;
+#else
+	sockbufsize=SAMPLES_PER_FRAME * 8;
+#endif //WIN32
 	size = sizeof(int);
 	setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&sockbufsize, size);
 
@@ -106,7 +110,11 @@
  * use:
  * sockbufsize=SAMPLES_PER_FRAME * 8;
  */
+#ifdef WIN32
 	sockbufsize=SAMPLES_PER_FRAME * 8 * 3;
+#else
+	sockbufsize=SAMPLES_PER_FRAME * 8;
+#endif //WIN32
 	size = sizeof(int);
 	setsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&sockbufsize, size);
 
@@ -1028,7 +1036,11 @@
 
 					//FIXME rt = select(fdselect + 1, NULL, &fs, NULL, &to);
 					while(tech_pvt->flag_audio_cli == 0){
-						skypiax_sleep(100); //1 millisec
+#ifdef WIN32
+						skypiax_sleep(100); //0.1 millisec
+#else
+						skypiax_sleep(1000); //1 millisec
+#endif //WIN32
 						//WARNINGA("write now is 0\n", SKYPIAX_P_LOG);
 						 }
 						//ERRORA("write is now 1\n", SKYPIAX_P_LOG);
@@ -1134,9 +1146,14 @@
 	unsigned int samples;
 
 	while(tech_pvt->flag_audio_srv == 0){
-		skypiax_sleep(100); //1 millisec
+#ifdef WIN32
+		skypiax_sleep(100); //0.1 millisec
+#else
+		skypiax_sleep(1000); //1 millisec
+#endif //WIN32
+
 		//WARNINGA("read now is 0\n", SKYPIAX_P_LOG);
-		}
+	}
 		//ERRORA("read is now 1\n", SKYPIAX_P_LOG);
 	//samples = skypiax_pipe_read(tech_pvt->audiopipe_srv[0], tech_pvt->read_frame.data, SAMPLES_PER_FRAME * sizeof(short));
 	samples = SAMPLES_PER_FRAME * sizeof(short);