Commit bd82f21c authored by Conrad Parker's avatar Conrad Parker

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.

svn path=/trunk/vorbis-tools/; revision=10168
parent 72e8e8e2
......@@ -222,13 +222,19 @@ fi
AM_CONDITIONAL(HAVE_LIBSPEEX, test "x$have_libspeex" = "xyes")
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 --------------------------------------------------
......
......@@ -351,7 +351,7 @@ int main(int argc, char **argv)
}
/* Don't use status_message until after this point! */
status_set_verbosity(options.verbosity);
status_init(options.verbosity);
print_audio_devices_info(options.devices);
......
......@@ -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 stat_format_cleanup (stat_format_t *stats)
}
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;
}
......
......@@ -59,7 +59,7 @@ typedef struct {
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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment