[xiph-commits] r10168 - in trunk/vorbis-tools: . ogg123

conrad at svn.xiph.org conrad at svn.xiph.org
Sun Oct 16 22:04:01 PDT 2005


Author: conrad
Date: 2005-10-16 22:03:57 -0700 (Sun, 16 Oct 2005)
New Revision: 10168

Modified:
   trunk/vorbis-tools/configure.ac
   trunk/vorbis-tools/ogg123/ogg123.c
   trunk/vorbis-tools/ogg123/status.c
   trunk/vorbis-tools/ogg123/status.h
Log:
ogg123: set stderr to nonblocking where possible. Closes ticket:297
"ogg123 stops playing music when it can't write to stderr".
Tested with screen on i386 Linux.


Modified: trunk/vorbis-tools/configure.ac
===================================================================
--- trunk/vorbis-tools/configure.ac	2005-10-17 00:29:05 UTC (rev 10167)
+++ trunk/vorbis-tools/configure.ac	2005-10-17 05:03:57 UTC (rev 10168)
@@ -223,12 +223,18 @@
 AC_SUBST(SPEEX_LIBS)
 
 dnl --------------------------------------------------
+dnl Check for headers
+dnl --------------------------------------------------
+
+AC_CHECK_HEADERS([fcntl.h unistd.h])
+
+dnl --------------------------------------------------
 dnl Check for library functions
 dnl --------------------------------------------------
 
 AC_FUNC_ALLOCA
 AM_ICONV
-AC_CHECK_FUNCS(atexit on_exit)
+AC_CHECK_FUNCS(atexit on_exit fcntl)
 AM_LANGINFO_CODESET
 
 dnl --------------------------------------------------

Modified: trunk/vorbis-tools/ogg123/ogg123.c
===================================================================
--- trunk/vorbis-tools/ogg123/ogg123.c	2005-10-17 00:29:05 UTC (rev 10167)
+++ trunk/vorbis-tools/ogg123/ogg123.c	2005-10-17 05:03:57 UTC (rev 10168)
@@ -351,7 +351,7 @@
   }
 
   /* Don't use status_message until after this point! */
-  status_set_verbosity(options.verbosity);
+  status_init(options.verbosity);
 
   print_audio_devices_info(options.devices);
 

Modified: trunk/vorbis-tools/ogg123/status.c
===================================================================
--- trunk/vorbis-tools/ogg123/status.c	2005-10-17 00:29:05 UTC (rev 10167)
+++ trunk/vorbis-tools/ogg123/status.c	2005-10-17 05:03:57 UTC (rev 10168)
@@ -15,10 +15,22 @@
 
  ********************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <pthread.h>
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
 #include "status.h"
 #include "i18n.h"
 
@@ -309,8 +321,12 @@
 }
 
 
-void status_set_verbosity (int verbosity)
+void status_init (int verbosity)
 {
+#if defined(HAVE_FCNTL) && defined(HAVE_UNISTD_H)
+  fcntl (STDERR_FILENO, F_SETFL, O_NONBLOCK);
+#endif
+
   max_verbosity = verbosity;
 }
 

Modified: trunk/vorbis-tools/ogg123/status.h
===================================================================
--- trunk/vorbis-tools/ogg123/status.h	2005-10-17 00:29:05 UTC (rev 10167)
+++ trunk/vorbis-tools/ogg123/status.h	2005-10-17 05:03:57 UTC (rev 10168)
@@ -59,7 +59,7 @@
 stat_format_t *stat_format_create ();
 void stat_format_cleanup (stat_format_t *stats);
 
-void status_set_verbosity (int verbosity);
+void status_init (int verbosity);
 void status_reset_output_lock ();
 void status_clear_line ();
 void status_print_statistics (stat_format_t *stats,



More information about the commits mailing list