[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH 1/2] libmpg123 1.13.3



+ lbuild für mpg123 1.13.3, extrahiert wird aber nur die libmpg123 (das
  Programm kann mangels Interface wie SDL schlecht genutzt werden)

Signed-off-by: Max Reitz <max@xxxxxxxxxx>
---
 lbuilds/libmpg123/1.13.3/files/config.sub.patch  |   13 +
 lbuilds/libmpg123/1.13.3/files/id3.patch         |   28 +++
 lbuilds/libmpg123/1.13.3/files/makefile.patch    |  258 ++++++++++++++++++++
 lbuilds/libmpg123/1.13.3/files/readers.patch     |   38 +++
 lbuilds/libmpg123/1.13.3/files/stubify.patch     |  272 ++++++++++++++++++++++
 lbuilds/libmpg123/1.13.3/libmpg123-1.13.3.lbuild |   56 +++++
 6 files changed, 665 insertions(+), 0 deletions(-)
 create mode 100644 lbuilds/libmpg123/1.13.3/files/config.sub.patch
 create mode 100644 lbuilds/libmpg123/1.13.3/files/id3.patch
 create mode 100644 lbuilds/libmpg123/1.13.3/files/makefile.patch
 create mode 100644 lbuilds/libmpg123/1.13.3/files/readers.patch
 create mode 100644 lbuilds/libmpg123/1.13.3/files/stubify.patch
 create mode 100644 lbuilds/libmpg123/1.13.3/libmpg123-1.13.3.lbuild

diff --git a/lbuilds/libmpg123/1.13.3/files/config.sub.patch b/lbuilds/libmpg123/1.13.3/files/config.sub.patch
new file mode 100644
index 0000000..46bf2e7
--- /dev/null
+++ b/lbuilds/libmpg123/1.13.3/files/config.sub.patch
@@ -0,0 +1,13 @@
+Index: src/mpg123-1.13.3/build/config.sub
+===================================================================
+--- src.orig/mpg123-1.13.3/build/config.sub	2011-04-03 09:52:42.000000000 +0200
++++ src/mpg123-1.13.3/build/config.sub	2011-05-06 23:49:19.000000000 +0200
+@@ -1264,7 +1264,7 @@
+ 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ 	      | -kopensolaris* \
+ 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+-	      | -aos* | -aros* \
++	      | -aos* | -aros* | -tyndur* \
+ 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff --git a/lbuilds/libmpg123/1.13.3/files/id3.patch b/lbuilds/libmpg123/1.13.3/files/id3.patch
new file mode 100644
index 0000000..a3c85bd
--- /dev/null
+++ b/lbuilds/libmpg123/1.13.3/files/id3.patch
@@ -0,0 +1,28 @@
+Index: src/mpg123-1.13.3/src/libmpg123/id3.c
+===================================================================
+--- src.orig/mpg123-1.13.3/src/libmpg123/id3.c	2011-04-03 09:50:14.000000000 +0200
++++ src/mpg123-1.13.3/src/libmpg123/id3.c	2011-05-07 00:56:57.000000000 +0200
+@@ -382,7 +382,7 @@
+ 			store_id3_text(&localcom.text, text-1, realsize+1-(text-realdata), NOQUIET, 0);
+ 			if(localcom.text.fill > 0)
+ 			{
+-				fr->rva.gain[rva_mode] = (float) atof(localcom.text.p);
++				fr->rva.gain[rva_mode] = (float) strtod(localcom.text.p, NULL);
+ 				if(VERBOSE3) fprintf(stderr, "Note: RVA value %fdB\n", fr->rva.gain[rva_mode]);
+ 				fr->rva.peak[rva_mode] = 0;
+ 				fr->rva.level[rva_mode] = rva_level;
+@@ -465,12 +465,12 @@
+ 			{
+ 				if(is_peak)
+ 				{
+-					fr->rva.peak[rva_mode] = (float) atof(localex.text.p);
++					fr->rva.peak[rva_mode] = (float) strtod(localex.text.p, NULL);
+ 					if(VERBOSE3) fprintf(stderr, "Note: RVA peak %f\n", fr->rva.peak[rva_mode]);
+ 				}
+ 				else
+ 				{
+-					fr->rva.gain[rva_mode] = (float) atof(localex.text.p);
++					fr->rva.gain[rva_mode] = (float) strtod(localex.text.p, NULL);
+ 					if(VERBOSE3) fprintf(stderr, "Note: RVA gain %fdB\n", fr->rva.gain[rva_mode]);
+ 				}
+ 				fr->rva.level[rva_mode] = rva_level;
diff --git a/lbuilds/libmpg123/1.13.3/files/makefile.patch b/lbuilds/libmpg123/1.13.3/files/makefile.patch
new file mode 100644
index 0000000..53c993d
--- /dev/null
+++ b/lbuilds/libmpg123/1.13.3/files/makefile.patch
@@ -0,0 +1,258 @@
+Index: src/mpg123-1.13.3/src/libmpg123/Makefile.am
+===================================================================
+--- src.orig/mpg123-1.13.3/src/libmpg123/Makefile.am	2011-04-03 09:50:15.000000000 +0200
++++ src/mpg123-1.13.3/src/libmpg123/Makefile.am	2011-05-07 02:59:11.000000000 +0200
+@@ -21,12 +21,14 @@
+ 
+ # The library can have different names, depending on largefile setup.
+ # Libtool macros think they're smart. Because of that mpg123.la does not work, it must be libmpg123.la .
+-lib_LTLIBRARIES = libmpg123.la
++lib_LTLIBRARIES = libmpg123.a
+ nodist_include_HEADERS = mpg123.h
+ 
+ libmpg123_la_LDFLAGS = -no-undefined -version-info @LIBMPG123_VERSION@ -export-symbols-regex '^mpg123_'
+ libmpg123_la_LIBADD = @DECODER_LOBJ@ @LFS_LOBJ@
++libmpg123_a_LIBADD = @DECODER_OBJ@ @LFS_OBJ@
+ libmpg123_la_DEPENDENCIES = @DECODER_LOBJ@ @LFS_LOBJ@
++libmpg123_a_DEPENDENCIES = @DECODER_OBJ@ @LFS_OBJ@
+ 
+ libmpg123_la_SOURCES = \
+ 	intsym.h \
+@@ -66,6 +68,8 @@
+ 	index.h \
+ 	index.c
+ 
++libmpg123_a_SOURCES = $(libmpg123_la_SOURCES)
++
+ EXTRA_libmpg123_la_SOURCES = \
+ 	lfs_alias.c \
+ 	lfs_wrap.c \
+@@ -137,3 +141,5 @@
+ 	l12_integer_tables.h \
+ 	l3_integer_tables.h
+ 
++EXTRA_libmpg123_a_SOURCES = $(EXTRA_libmpg123_la_SOURCES)
++
+Index: src/mpg123-1.13.3/src/libmpg123/Makefile.in
+===================================================================
+--- src.orig/mpg123-1.13.3/src/libmpg123/Makefile.in	2011-04-17 11:23:11.000000000 +0200
++++ src/mpg123-1.13.3/src/libmpg123/Makefile.in	2011-05-07 02:59:02.000000000 +0200
+@@ -76,7 +76,11 @@
+ am_libmpg123_la_OBJECTS = compat.lo parse.lo frame.lo format.lo \
+ 	dct64.lo equalizer.lo id3.lo optimize.lo readers.lo tabinit.lo \
+ 	libmpg123.lo index.lo
++am_libmpg123_a_OBJECTS = compat.o parse.o frame.o format.o \
++	dct64.o equalizer.o id3.o optimize.o readers.o tabinit.o \
++	libmpg123.o index.o
+ libmpg123_la_OBJECTS = $(am_libmpg123_la_OBJECTS)
++libmpg123_a_OBJECTS = $(am_libmpg123_a_OBJECTS)
+ libmpg123_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ 	$(libmpg123_la_LDFLAGS) $(LDFLAGS) -o $@
+@@ -318,11 +322,13 @@
+ 
+ # The library can have different names, depending on largefile setup.
+ # Libtool macros think they're smart. Because of that mpg123.la does not work, it must be libmpg123.la .
+-lib_LTLIBRARIES = libmpg123.la
++lib_LTLIBRARIES = libmpg123.a
+ nodist_include_HEADERS = mpg123.h
+ libmpg123_la_LDFLAGS = -no-undefined -version-info @LIBMPG123_VERSION@ -export-symbols-regex '^mpg123_'
+ libmpg123_la_LIBADD = @DECODER_LOBJ@ @LFS_LOBJ@
++libmpg123_a_LIBADD = @DECODER_OBJ@ @LFS_OBJ@
+ libmpg123_la_DEPENDENCIES = @DECODER_LOBJ@ @LFS_LOBJ@
++libmpg123_a_DEPENDENCIES = @DECODER_OBJ@ @LFS_OBJ@
+ libmpg123_la_SOURCES = \
+ 	intsym.h \
+ 	compat.c \
+@@ -360,6 +366,7 @@
+ 	getcpuflags.h \
+ 	index.h \
+ 	index.c
++libmpg123_a_SOURCES = $(libmpg123_la_SOURCES)
+ 
+ EXTRA_libmpg123_la_SOURCES = \
+ 	lfs_alias.c \
+@@ -431,6 +438,7 @@
+ 	getcpuflags.S \
+ 	l12_integer_tables.h \
+ 	l3_integer_tables.h
++EXTRA_libgmp123_a_SOURCES = $(EXTRA_libmpg123_la_SOURCES)
+ 
+ all: all-am
+ 
+@@ -501,6 +509,8 @@
+ 	done
+ libmpg123.la: $(libmpg123_la_OBJECTS) $(libmpg123_la_DEPENDENCIES) 
+ 	$(libmpg123_la_LINK) -rpath $(libdir) $(libmpg123_la_OBJECTS) $(libmpg123_la_LIBADD) $(LIBS)
++libmpg123.a: $(libmpg123_a_OBJECTS) $(libmpg123_a_DEPENDENCIES)
++	ar rcs $@ $(libmpg123_a_OBJECTS) $(libmpg123_a_LIBADD)
+ testcpu$(EXEEXT): $(testcpu_OBJECTS) $(testcpu_DEPENDENCIES) 
+ 	@rm -f testcpu$(EXEEXT)
+ 	$(LINK) $(testcpu_OBJECTS) $(testcpu_LDADD) $(LIBS)
+Index: src/mpg123-1.13.3/src/Makefile.am
+===================================================================
+--- src.orig/mpg123-1.13.3/src/Makefile.am	2011-04-03 09:50:15.000000000 +0200
++++ src/mpg123-1.13.3/src/Makefile.am	2011-05-07 02:57:08.000000000 +0200
+@@ -5,12 +5,12 @@
+ ## initially written by Nicholas J. Humfrey
+ 
+ AM_CPPFLAGS = -DPKGLIBDIR="\"$(pkglibdir)\""
+-mpg123_LDADD = $(LIBLTDL) libmpg123/libmpg123.la @MODULE_OBJ@ @OUTPUT_OBJ@ @OUTPUT_LIBS@
++mpg123_LDADD = $(LIBLTDL) libmpg123/libmpg123.a @MODULE_OBJ@ @OUTPUT_OBJ@ @OUTPUT_LIBS@
+ mpg123_LDFLAGS = @EXEC_LT_LDFLAGS@ @OUTPUT_LDFLAGS@
+ # Just mpg123_INCLUDES has no effect on build! Trying that before reverting to AM_CPPFLAGS.
+ INCLUDES = $(LTDLINCL) -I$(top_builddir)/src/libmpg123 -I$(top_srcdir)/src/libmpg123
+ # libltdl is not mentioned here... it's not that trivial
+-mpg123_DEPENDENCIES = @OUTPUT_OBJ@ @MODULE_OBJ@ libmpg123/libmpg123.la
++mpg123_DEPENDENCIES = @OUTPUT_OBJ@ @MODULE_OBJ@ libmpg123/libmpg123.a
+ 
+ SUBDIRS = output libmpg123
+ EXTRA_DIST = legacy_module.c module.c sfifo.c sfifo.h
+@@ -142,7 +142,7 @@
+ 
+ # Would have to mention _all_ source files... Dammit, that's what the libmpg123/Makefile.am does!
+ # But again, the a make $something here needs that stupid rule... WHY???
+-libmpg123/libmpg123.la: config.h libmpg123/mpg123.h
++libmpg123/libmpg123.a: config.h libmpg123/mpg123.h
+ 	cd libmpg123 && $(MAKE)
+ 
+ tests_seek_accuracy_SOURCES = \
+@@ -150,16 +150,16 @@
+ libmpg123/compat.h \
+ libmpg123/compat.c
+ 
+-tests_seek_accuracy_DEPENDENCIES = libmpg123/libmpg123.la
+-tests_seek_accuracy_LDADD = libmpg123/libmpg123.la
++tests_seek_accuracy_DEPENDENCIES = libmpg123/libmpg123.a
++tests_seek_accuracy_LDADD = libmpg123/libmpg123.a
+ 
+ tests_seek_whence_SOURCES = \
+ tests/seek_whence.c \
+ libmpg123/compat.h \
+ libmpg123/compat.c
+ 
+-tests_seek_whence_DEPENDENCIES = libmpg123/libmpg123.la
+-tests_seek_whence_LDADD = libmpg123/libmpg123.la
++tests_seek_whence_DEPENDENCIES = libmpg123/libmpg123.a
++tests_seek_whence_LDADD = libmpg123/libmpg123.a
+ 
+ tests_noise_SOURCES = \
+ tests/noise.c \
+@@ -174,13 +174,13 @@
+ libmpg123/compat.h \
+ libmpg123/compat.c
+ 
+-tests_text_DEPENDENCIES = libmpg123/libmpg123.la
+-tests_text_LDADD = libmpg123/libmpg123.la
++tests_text_DEPENDENCIES = libmpg123/libmpg123.a
++tests_text_LDADD = libmpg123/libmpg123.a
+ 
+ tests_plain_id3_SOURCES = \
+ tests/plain_id3.c \
+ libmpg123/compat.h \
+ libmpg123/compat.c
+ 
+-tests_plain_id3_DEPENDENCIES = libmpg123/libmpg123.la
+-tests_plain_id3_LDADD = libmpg123/libmpg123.la
++tests_plain_id3_DEPENDENCIES = libmpg123/libmpg123.a
++tests_plain_id3_LDADD = libmpg123/libmpg123.a
+Index: src/mpg123-1.13.3/src/Makefile.in
+===================================================================
+--- src.orig/mpg123-1.13.3/src/Makefile.in	2011-04-17 11:23:11.000000000 +0200
++++ src/mpg123-1.13.3/src/Makefile.in	2011-05-07 02:57:08.000000000 +0200
+@@ -351,12 +351,12 @@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ AM_CPPFLAGS = -DPKGLIBDIR="\"$(pkglibdir)\""
+-mpg123_LDADD = $(LIBLTDL) libmpg123/libmpg123.la @MODULE_OBJ@ @OUTPUT_OBJ@ @OUTPUT_LIBS@
++mpg123_LDADD = $(LIBLTDL) libmpg123/libmpg123.a @MODULE_OBJ@ @OUTPUT_OBJ@ @OUTPUT_LIBS@
+ mpg123_LDFLAGS = @EXEC_LT_LDFLAGS@ @OUTPUT_LDFLAGS@
+ # Just mpg123_INCLUDES has no effect on build! Trying that before reverting to AM_CPPFLAGS.
+ INCLUDES = $(LTDLINCL) -I$(top_builddir)/src/libmpg123 -I$(top_srcdir)/src/libmpg123
+ # libltdl is not mentioned here... it's not that trivial
+-mpg123_DEPENDENCIES = @OUTPUT_OBJ@ @MODULE_OBJ@ libmpg123/libmpg123.la
++mpg123_DEPENDENCIES = @OUTPUT_OBJ@ @MODULE_OBJ@ libmpg123/libmpg123.a
+ SUBDIRS = output libmpg123
+ EXTRA_DIST = legacy_module.c module.c sfifo.c sfifo.h
+ CLEANFILES = *.a
+@@ -372,15 +372,15 @@
+ libmpg123/compat.h \
+ libmpg123/compat.c
+ 
+-tests_seek_accuracy_DEPENDENCIES = libmpg123/libmpg123.la
+-tests_seek_accuracy_LDADD = libmpg123/libmpg123.la
++tests_seek_accuracy_DEPENDENCIES = libmpg123/libmpg123.a
++tests_seek_accuracy_LDADD = libmpg123/libmpg123.a
+ tests_seek_whence_SOURCES = \
+ tests/seek_whence.c \
+ libmpg123/compat.h \
+ libmpg123/compat.c
+ 
+-tests_seek_whence_DEPENDENCIES = libmpg123/libmpg123.la
+-tests_seek_whence_LDADD = libmpg123/libmpg123.la
++tests_seek_whence_DEPENDENCIES = libmpg123/libmpg123.a
++tests_seek_whence_LDADD = libmpg123/libmpg123.a
+ tests_noise_SOURCES = \
+ tests/noise.c \
+ libmpg123/compat.h \
+@@ -394,15 +394,15 @@
+ libmpg123/compat.h \
+ libmpg123/compat.c
+ 
+-tests_text_DEPENDENCIES = libmpg123/libmpg123.la
+-tests_text_LDADD = libmpg123/libmpg123.la
++tests_text_DEPENDENCIES = libmpg123/libmpg123.a
++tests_text_LDADD = libmpg123/libmpg123.a
+ tests_plain_id3_SOURCES = \
+ tests/plain_id3.c \
+ libmpg123/compat.h \
+ libmpg123/compat.c
+ 
+-tests_plain_id3_DEPENDENCIES = libmpg123/libmpg123.la
+-tests_plain_id3_LDADD = libmpg123/libmpg123.la
++tests_plain_id3_DEPENDENCIES = libmpg123/libmpg123.a
++tests_plain_id3_LDADD = libmpg123/libmpg123.a
+ all: config.h
+ 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+ 
+@@ -1072,7 +1072,7 @@
+ 
+ # Would have to mention _all_ source files... Dammit, that's what the libmpg123/Makefile.am does!
+ # But again, the a make $something here needs that stupid rule... WHY???
+-libmpg123/libmpg123.la: config.h libmpg123/mpg123.h
++libmpg123/libmpg123.a: config.h libmpg123/mpg123.h
+ 	cd libmpg123 && $(MAKE)
+ 
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+Index: src/mpg123-1.13.3/configure
+===================================================================
+--- src.orig/mpg123-1.13.3/configure	2011-04-17 11:23:10.000000000 +0200
++++ src/mpg123-1.13.3/configure	2011-05-07 02:57:08.000000000 +0200
+@@ -737,6 +737,7 @@
+ INCLUDE_STDLIB_H
+ INCLUDE_STDIO_H
+ LFS_LOBJ
++LFS_OBJ
+ EXEC_LT_LDFLAGS
+ LT_LDFLAGS
+ MODULE_OBJ
+@@ -14433,9 +14434,11 @@
+ 
+ if test "x$ac_cv_sys_file_offset_bits" = x || echo "$ac_cv_sys_file_offset_bits" | $GREP  '[^0-9]' > /dev/null; then
+ 		LFS_LOBJ=
++		LFS_OBJ=
+ else
+ 	# Add dual-mode wrapper code.
+ 	LFS_LOBJ=lfs_wrap.lo
++	LFS_OBJ=lfs_wrap.o
+ fi
+ 
+ # Using the lower level macros instead of AC_TYPE_* for compatibility with not freshest autoconf.
+@@ -14734,6 +14737,7 @@
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+   LFS_LOBJ="$LFS_LOBJ lfs_alias.lo"
++  LFS_OBJ="$LFS_OBJ lfs_alias.o"
+ else
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ $as_echo "no" >&6; }
diff --git a/lbuilds/libmpg123/1.13.3/files/readers.patch b/lbuilds/libmpg123/1.13.3/files/readers.patch
new file mode 100644
index 0000000..0845a76
--- /dev/null
+++ b/lbuilds/libmpg123/1.13.3/files/readers.patch
@@ -0,0 +1,38 @@
+Index: src/mpg123-1.13.3/src/libmpg123/readers.c
+===================================================================
+--- src.orig/mpg123-1.13.3/src/libmpg123/readers.c	2011-04-03 09:50:15.000000000 +0200
++++ src/mpg123-1.13.3/src/libmpg123/readers.c	2011-05-07 00:54:57.000000000 +0200
+@@ -70,22 +70,7 @@
+    This is needed for Shoutcast servers that have forgotten about us while connection was temporarily down. */
+ static ssize_t timeout_read(mpg123_handle *fr, void *buf, size_t count)
+ {
+-	struct timeval tv;
+-	ssize_t ret = 0;
+-	fd_set fds;
+-	tv.tv_sec = fr->rdat.timeout_sec;
+-	tv.tv_usec = 0;
+-	FD_ZERO(&fds);
+-	FD_SET(fr->rdat.filept, &fds);
+-	ret = select(fr->rdat.filept+1, &fds, NULL, NULL, &tv);
+-	/* This works only with "my" read function. Not user-replaced. */
+-	if(ret > 0) ret = read(fr->rdat.filept, buf, count);
+-	else
+-	{
+-		ret=-1; /* no activity is the error */
+-		if(NOQUIET) error("stream timed out");
+-	}
+-	return ret;
++    read(fr->rdat.filept, buf, count);
+ }
+ #endif
+ 
+@@ -926,9 +911,6 @@
+ 			error("Timeout reading does not work with user-provided read function. Implement it yourself!");
+ 			return -1;
+ 		}
+-		flags = fcntl(fr->rdat.filept, F_GETFL);
+-		flags |= O_NONBLOCK;
+-		fcntl(fr->rdat.filept, F_SETFL, flags);
+ 		fr->rdat.fdread = timeout_read;
+ 		fr->rdat.timeout_sec = fr->p.timeout;
+ 		fr->rdat.flags |= READER_NONBLOCK;
diff --git a/lbuilds/libmpg123/1.13.3/files/stubify.patch b/lbuilds/libmpg123/1.13.3/files/stubify.patch
new file mode 100644
index 0000000..dad08ae
--- /dev/null
+++ b/lbuilds/libmpg123/1.13.3/files/stubify.patch
@@ -0,0 +1,272 @@
+Index: src/mpg123-1.13.3/src/common.c
+===================================================================
+--- src.orig/mpg123-1.13.3/src/common.c	2011-04-03 09:50:15.000000000 +0200
++++ src/mpg123-1.13.3/src/common.c	2011-05-07 02:44:12.000000000 +0200
+@@ -202,23 +202,6 @@
+ 	off_t rno, no;
+ 	double basevol, realvol;
+ 	char *icy;
+-#ifndef WIN32
+-#ifndef GENERIC
+-/* Only generate new stat line when stderr is ready... don't overfill... */
+-	{
+-		struct timeval t;
+-		fd_set serr;
+-		int n,errfd = fileno(stderr);
+-
+-		t.tv_sec=t.tv_usec=0;
+-
+-		FD_ZERO(&serr);
+-		FD_SET(errfd,&serr);
+-		n = select(errfd+1,NULL,&serr,NULL,&t);
+-		if(n <= 0) return;
+-	}
+-#endif
+-#endif
+ 	if(    MPG123_OK == mpg123_position(fr, offset, buffsize, &no, &rno, &tim1, &tim2)
+ 	    && MPG123_OK == mpg123_getvolume(fr, &basevol, &realvol, NULL) )
+ 	{
+Index: src/mpg123-1.13.3/src/control_generic.c
+===================================================================
+--- src.orig/mpg123-1.13.3/src/control_generic.c	2011-04-03 09:50:15.000000000 +0200
++++ src/mpg123-1.13.3/src/control_generic.c	2011-05-07 02:44:12.000000000 +0200
+@@ -239,8 +239,6 @@
+ 
+ int control_generic (mpg123_handle *fr)
+ {
+-	struct timeval tv;
+-	fd_set fds;
+ 	int n;
+ 
+ 	/* ThOr */
+@@ -285,14 +283,8 @@
+ 
+ 	while (alive)
+ 	{
+-		tv.tv_sec = 0;
+-		tv.tv_usec = 0;
+-		FD_ZERO(&fds);
+-		FD_SET(control_file, &fds);
+ 		/* play frame if no command needs to be processed */
+ 		if (mode == MODE_PLAYING) {
+-			n = select(32, &fds, NULL, NULL, &tv);
+-			if (n == 0) {
+ 				if (!play_frame())
+ 				{
+ 					/* When the track ended, user may want to keep it open (to seek back),
+@@ -326,15 +318,6 @@
+ 						generic_sendmsg("I ICY-META: %s", meta != NULL ? meta : "<nil>");
+ 					}
+ 				}
+-			}
+-		}
+-		else {
+-			/* wait for command */
+-			while (1) {
+-				n = select(32, &fds, NULL, NULL, NULL);
+-				if (n > 0)
+-					break;
+-			}
+ 		}
+ 
+ 		/*  on error */
+@@ -362,7 +345,7 @@
+ 				{
+ 					debug("fifo ended... reopening");
+ 					close(control_file);
+-					control_file = open(param.fifo,O_RDONLY|O_NONBLOCK);
++					control_file = open(param.fifo,O_RDONLY);
+ 					if(control_file < 0){ error1("open of fifo failed... %s", strerror(errno)); break; }
+ 					continue;
+ 				}
+@@ -646,7 +629,7 @@
+ 					if(!strcasecmp(cmd, "V") || !strcasecmp(cmd, "VOLUME"))
+ 					{
+ 						double v;
+-						mpg123_volume(fr, atof(arg)/100);
++						mpg123_volume(fr, strtod(arg, NULL)/100);
+ 						mpg123_getvolume(fr, &v, NULL, NULL); /* Necessary? */
+ 						generic_sendmsg("V %f%%", v * 100);
+ 						continue;
+Index: src/mpg123-1.13.3/src/resolver.c
+===================================================================
+--- src.orig/mpg123-1.13.3/src/resolver.c	2011-04-17 10:26:24.000000000 +0200
++++ src/mpg123-1.13.3/src/resolver.c	2011-05-07 02:44:12.000000000 +0200
+@@ -140,16 +140,10 @@
+ #if !defined (WANT_WIN32_SOCKETS)
+ static void nonblock(int sock)
+ {
+-	int flags = fcntl(sock, F_GETFL);
+-	flags |= O_NONBLOCK;
+-	fcntl(sock, F_SETFL, flags);
+ }
+ 
+ static void block(int sock)
+ {
+-	int flags = fcntl(sock, F_GETFL);
+-	flags &= ~O_NONBLOCK;
+-	fcntl(sock, F_SETFL, flags);
+ }
+ 
+ /* If we want a timeout, connect non-blocking and wait for that long... */
+@@ -168,42 +162,10 @@
+ 		}
+ 		else if(errno == EINPROGRESS)
+ 		{
+-			struct timeval tv;
+-			fd_set fds;
+-			tv.tv_sec = param.timeout;
+-			tv.tv_usec = 0;
+-
+ 			debug("in progress, waiting...");
+ 
+-			FD_ZERO(&fds);
+-			FD_SET(sockfd, &fds);
+-			err = select(sockfd+1, NULL, &fds, NULL, &tv);
+-			if(err > 0)
+-			{
+-				socklen_t len = sizeof(err);
+-				if(   (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &err, &len) == 0)
+-				   && (err == 0) )
+-				{
+-					debug("non-blocking connect has been successful");
+-					block(sockfd);
+-					return 0;
+-				}
+-				else
+-				{
+-					error1("connection error: %s", strerror(err));
++					error1("connection error: %s", "Sockets sind doof");
+ 					return -1;
+-				}
+-			}
+-			else if(err == 0)
+-			{
+-				error("connection timed out");
+-				return -1;
+-			}
+-			else
+-			{
+-				error1("error from select(): %s", strerror(errno));
+-				return -1;
+-			}
+ 		}
+ 		else
+ 		{
+@@ -255,7 +217,6 @@
+ 		server.sin_addr.s_addr = myaddr.s_addr;
+ 	}
+ 	else  /* Just use the IP. */
+-	if((server.sin_addr.s_addr = inet_addr(host->p)) == INADDR_NONE)
+ 	return -1;
+ 
+ 	server.sin_port = htons(atoi(port->p));
+Index: src/mpg123-1.13.3/src/term.c
+===================================================================
+--- src.orig/mpg123-1.13.3/src/term.c	2011-04-03 09:50:15.000000000 +0200
++++ src/mpg123-1.13.3/src/term.c	2011-05-07 02:44:12.000000000 +0200
+@@ -24,7 +24,6 @@
+ extern audio_output_t *ao;
+ 
+ static int term_enable = 0;
+-static struct termios old_tio;
+ int seeking = FALSE;
+ 
+ /* Hm, next step would be some system in this, plus configurability...
+@@ -57,30 +56,8 @@
+ 	,{ MPG123_PITCH_ZERO_KEY, 0, "reset pitch to zero" }
+ };
+ 
+-void term_sigcont(int sig);
+-
+-/* This must call only functions safe inside a signal handler. */
+-int term_setup(struct termios *pattern)
+-{
+-  struct termios tio = *pattern;
+-
+-  signal(SIGCONT, term_sigcont);
+-
+-  tio.c_lflag &= ~(ICANON|ECHO); 
+-  tio.c_cc[VMIN] = 1;
+-  tio.c_cc[VTIME] = 0;
+-  return tcsetattr(0,TCSANOW,&tio);
+-}
+-
+ void term_sigcont(int sig)
+ {
+-  term_enable = 0;
+-
+-  if (term_setup(&old_tio) < 0) {
+-    fprintf(stderr,"Can't set terminal attributes\n");
+-    return;
+-  }
+-
+   term_enable = 1;
+ }
+ 
+@@ -89,17 +66,6 @@
+ {
+   debug("term_init");
+ 
+-  term_enable = 0;
+-
+-  if(tcgetattr(0,&old_tio) < 0) {
+-    fprintf(stderr,"Can't get terminal attributes\n");
+-    return;
+-  }
+-  if(term_setup(&old_tio) < 0) {
+-    fprintf(stderr,"Can't set terminal attributes\n");
+-    return;
+-  }
+-
+   term_enable = 1;
+ }
+ 
+@@ -215,17 +181,8 @@
+   /* long offset = 0; */
+   
+   while(n > 0) {
+-    fd_set r;
+-    struct timeval t;
+     char val;
+ 
+-    t.tv_sec=0;
+-    t.tv_usec=(do_delay) ? 10*1000 : 0;
+-    
+-    FD_ZERO(&r);
+-    FD_SET(0,&r);
+-    n = select(1,&r,NULL,NULL,&t);
+-    if(n > 0 && FD_ISSET(0,&r)) {
+       if(read(0,&val,1) <= 0)
+         break;
+ 
+@@ -423,7 +380,6 @@
+ 	  ;
+       }
+     }
+-  }
+ }
+ 
+ void term_restore(void)
+@@ -431,8 +387,6 @@
+   
+   if(!term_enable)
+     return;
+-
+-  tcsetattr(0,TCSAFLUSH,&old_tio);
+ }
+ 
+ #endif
+Index: src/mpg123-1.13.3/src/getlopt.c
+===================================================================
+--- src.orig/mpg123-1.13.3/src/getlopt.c	2011-04-03 09:50:15.000000000 +0200
++++ src/mpg123-1.13.3/src/getlopt.c	2011-05-07 02:44:12.000000000 +0200
+@@ -82,7 +82,7 @@
+ 			else if(opt->flags & GLO_INT)
+ 				*((int *) opt->var) = atoi(loptarg);
+ 			else if(opt->flags & GLO_DOUBLE)
+-				*((double *) opt->var) = atof(loptarg);
++				*((double *) opt->var) = strtod(loptarg, NULL);
+ 			else prog_error();
+ 		}
+ 		else
diff --git a/lbuilds/libmpg123/1.13.3/libmpg123-1.13.3.lbuild b/lbuilds/libmpg123/1.13.3/libmpg123-1.13.3.lbuild
new file mode 100644
index 0000000..0cafce2
--- /dev/null
+++ b/lbuilds/libmpg123/1.13.3/libmpg123-1.13.3.lbuild
@@ -0,0 +1,56 @@
+include toolchain
+include lutils
+
+DESCRIPTION="libmpg123"
+HOMEPAGE="http://lowlevel.brainsware.org/wiki/index.php/LOST/Pakete/libmpg123";
+SRC_URI="http://sourceforge.net/projects/mpg123/files/mpg123/1.13.3/mpg123-1.13.3.tar.bz2/download";
+PS="lib"
+
+LICENSE="unknown"
+
+BUILD_DEPEND=""
+RUN_DEPEND=""
+
+MY_S="${S}/${P}"
+
+src_unpack() {
+    cp ../../../distfiles/download ../../../distfiles/${P}.tar.bz2
+    lunpack ${P}.tar.bz2
+
+    ln -s ${F} patches
+    [ -f ${F}/series ] && ln -s ${F}/series series
+    for i in ${F}/*.patch; do
+        [ -L series ] || echo `basename $i` >> series
+        (which quilt > /dev/null 2>&1) || (patch -p1 < $i) || die "Fehler beim Anwenden von $i"
+    done
+    (which quilt > /dev/null 2>&1) && quilt push -a || die "Fehler beim Anwenden der Patches"
+}
+
+src_configure() {
+	cd "${S}/mpg123-1.13.3"
+	./configure \
+                CC=`tc-cc` \
+                --build=`tc-build` \
+                --target=`tc-host` \
+                --host=`tc-host` \
+                --prefix="${R}" \
+                --without-pic \
+                --disable-shared \
+                --enable-static \
+                --with-audio=dummy \
+                --with-module-suffix=.a \
+                || die "configure failed"
+}
+
+src_compile() {
+	cd "${S}/mpg123-1.13.3"
+	lmake || die "make failed"
+	cd ..
+}
+
+src_install() {
+	cd "${S}/mpg123-1.13.3"
+        install -d "${D}${R}/1.13.3/lib" "${D}${R}/1.13.3/include"
+	cp src/libmpg123/libmpg123.a "${D}${R}/1.13.3/lib" || die "install failed"
+	cp src/libmpg123/mpg123.h "${D}${R}/1.13.3/include" || die "install failed"
+}
-- 
1.7.5