[xiph-commits] r8550 - icecast/trunk/libshout/examples

brendan at motherfish-iii.xiph.org brendan at motherfish-iii.xiph.org
Tue Dec 28 21:38:20 PST 2004


Author: brendan
Date: 2004-12-28 21:38:20 -0800 (Tue, 28 Dec 2004)
New Revision: 8550

Modified:
   icecast/trunk/libshout/examples/nonblocking.c
Log:
add unistd.h header for sleep()
shout_get_connected never returns BUSY (maybe it should?), so the loop was using the wrong condition.

Modified: icecast/trunk/libshout/examples/nonblocking.c
===================================================================
--- icecast/trunk/libshout/examples/nonblocking.c	2004-12-29 04:52:09 UTC (rev 8549)
+++ icecast/trunk/libshout/examples/nonblocking.c	2004-12-29 05:38:20 UTC (rev 8550)
@@ -6,6 +6,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 #include <shout/shout.h>
 
@@ -64,8 +65,10 @@
 	ret = shout_open(shout);
 	if (ret == SHOUTERR_SUCCESS)
 	  ret = SHOUTERR_CONNECTED;
+        else if (ret == SHOUTERR_BUSY)
+            ret = SHOUTERR_UNCONNECTED;
 
-	while (ret == SHOUTERR_BUSY) {
+	while (ret == SHOUTERR_UNCONNECTED) {
 	  printf("Connection pending. Sleeping...\n");
 	  sleep(1);
 	  ret = shout_get_connected(shout);



More information about the commits mailing list