update Aqualung to 0.9beta10 from maintainer (+ developer) Jeremy Evans,

all patches (including sndio support) went upstream.
This commit is contained in:
sthen 2009-02-09 22:13:39 +00:00
parent f229c13b9f
commit 26245fd34b
7 changed files with 38 additions and 395 deletions

View File

@ -1,9 +1,8 @@
# $OpenBSD: Makefile,v 1.10 2009/01/28 23:50:47 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.11 2009/02/09 22:13:39 sthen Exp $
COMMENT= advanced music player
DISTNAME= aqualung-0.9beta9.1
PKGNAME= ${DISTNAME}p7
DISTNAME= aqualung-0.9beta10
CATEGORIES= audio
HOMEPAGE= http://aqualung.factorial.hu/
@ -22,6 +21,7 @@ MODULES= devel/gettext
LIB_DEPENDS= gtk-x11-2.0,gdk-x11-2.0,gdk_pixbuf-2.0::x11/gtk+2 \
xml2::textproc/libxml \
lua::lang/lua \
mac::audio/mac \
mad::audio/libmad \
mpcdec::audio/libmpcdec \
@ -57,12 +57,14 @@ CONFIGURE_ARGS= --with-flac \
--with-lame \
--with-lavc \
--with-loop \
--with-lua \
--with-mac \
--with-mpc \
--with-mpeg \
--with-ogg \
--with-podcast \
--with-sndfile \
--with-sndio \
--with-src \
--with-systray \
--with-vorbisenc \

View File

@ -1,5 +1,5 @@
MD5 (aqualung-0.9beta9.1.tar.gz) = IhvPqlQo1Vb2/g+7oGkSfQ==
RMD160 (aqualung-0.9beta9.1.tar.gz) = bVC06wws6ABIwKtIgIj0hYM6u9E=
SHA1 (aqualung-0.9beta9.1.tar.gz) = ErB2ef2GAXqGPSUsFdBpH4G71ng=
SHA256 (aqualung-0.9beta9.1.tar.gz) = sVoikHd3nhHGPJhmbCkx4XeMcgrWWa+uHfctY/tIvRc=
SIZE (aqualung-0.9beta9.1.tar.gz) = 1071744
MD5 (aqualung-0.9beta10.tar.gz) = Kc4Ht0Un5uRPDEx3ishfQA==
RMD160 (aqualung-0.9beta10.tar.gz) = j4po+W1mMgdZrYPnCk9QA56lPMg=
SHA1 (aqualung-0.9beta10.tar.gz) = dMmt0Thet1S4FvJYEBhjHQ2tWvI=
SHA256 (aqualung-0.9beta10.tar.gz) = RkVo/xuHx6PcbvfRU6GOVsqOC/1aFz+UKgD05Z4JfWc=
SIZE (aqualung-0.9beta10.tar.gz) = 1400075

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-configure,v 1.1 2009/01/28 00:20:57 sthen Exp $
--- configure.orig Fri Jan 9 14:50:01 2009
+++ configure Fri Jan 9 14:50:03 2009
@@ -9111,7 +9111,7 @@ AQUALUNG_DATADIR="-DAQUALUNG_DATADIR=\\\"$datadir/aqua
CFLAGS="$CFLAGS $BUILD_CFLAGS -Wall $PLATFORM_CFLAGS $AQUALUNG_SKINDIR $AQUALUNG_LOCALEDIR $AQUALUNG_DATADIR -D_GNU_SOURCE"
CXXFLAGS="$CFLAGS"
CPPFLAGS="$gtk_CFLAGS $glib_CFLAGS $xml_CFLAGS $alsa_CFLAGS $jack_CFLAGS $cdda_CFLAGS"
-LIBS="decoder/libdecoder.a encoder/libencoder.a $gtk_LIBS $glib_LIBS $xml_LIBS $jack_LIBS $lrdf_LIBS $src_LIBS $alsa_LIBS $oss_LIBS $sndfile_LIBS $flac_LIBS $ogg_LIBS $wavpack_LIBS $speex_LIBS $mad_LIBS $mod_LIBS $mpc_LIBS $mac_LIBS $lavc_LIBS $vorbisenc_LIBS $lame_LIBS $cdda_LIBS $cddb_LIBS $ifp_LIBS $PLATFORM_LIBS $z_LIBS $bz2_LIBS"
+LIBS="decoder/libdecoder.a encoder/libencoder.a $gtk_LIBS $glib_LIBS $xml_LIBS $jack_LIBS $lrdf_LIBS $src_LIBS $alsa_LIBS $oss_LIBS $sndfile_LIBS $flac_LIBS $ogg_LIBS $wavpack_LIBS $speex_LIBS $mad_LIBS $mod_LIBS $mpc_LIBS $mac_LIBS $lavc_LIBS $vorbisenc_LIBS $lame_LIBS $cdda_LIBS $cddb_LIBS $ifp_LIBS $PLATFORM_LIBS $z_LIBS $bz2_LIBS -lsndio"
ac_config_files="$ac_config_files Makefile doc/Makefile skin/Makefile skin/dark/Makefile skin/default/Makefile skin/metal/Makefile skin/ocean/Makefile skin/plain/Makefile skin/woody/Makefile skin/no_skin/Makefile src/Makefile src/decoder/Makefile src/encoder/Makefile src/img/Makefile src/po/Makefile"

View File

@ -1,335 +0,0 @@
$OpenBSD: patch-src_core_c,v 1.1 2009/01/28 00:20:57 sthen Exp $
--- src/core.c.orig Tue Jan 1 04:11:42 2008
+++ src/core.c Fri Jan 9 14:46:42 2009
@@ -45,6 +45,8 @@
#include <samplerate.h>
#endif /* HAVE_SRC */
+#include <sndio.h>
+
#ifdef HAVE_OSS
#include <sys/ioctl.h>
#include <sys/types.h>
@@ -637,6 +639,154 @@ disk_thread(void * arg) {
+/* SNDIO output thread */
+void *
+sndio_thread(void * arg) {
+
+ u_int32_t i;
+ thread_info_t * info = (thread_info_t *)arg;
+ u_int32_t driver_offset = 0;
+ int bufsize = 1024;
+ int n_avail;
+ size_t bytes_written;
+ char recv_cmd;
+
+ short * sndio_short_buf;
+
+ struct sio_hdl * sndio_hdl;
+ struct timespec req_time;
+ struct timespec rem_time;
+ req_time.tv_sec = 0;
+ req_time.tv_nsec = 100000000;
+
+ sndio_hdl = info->sndio_hdl;
+ if ((info->sndio_short_buf = malloc(2*bufsize * sizeof(short))) == NULL) {
+ fprintf(stderr, "sndio_thread: malloc error\n");
+ exit(1);
+ }
+ sndio_short_buf = info->sndio_short_buf;
+
+ if ((l_buf = malloc(bufsize * sizeof(float))) == NULL) {
+ fprintf(stderr, "sndio_thread: malloc error\n");
+ exit(1);
+ }
+ if ((r_buf = malloc(bufsize * sizeof(float))) == NULL) {
+ fprintf(stderr, "sndio_thread: malloc error\n");
+ exit(1);
+ }
+#ifdef HAVE_LADSPA
+ ladspa_buflen = bufsize;
+#endif /* HAVE_LADSPA */
+
+
+ while (1) {
+ sndio_wake:
+ while (rb_read_space(rb_disk2out)) {
+ rb_read(rb_disk2out, &recv_cmd, 1);
+ switch (recv_cmd) {
+ case CMD_FLUSH:
+ while ((n_avail = rb_read_space(rb)) > 0) {
+ if (n_avail > 2*bufsize * sizeof(short))
+ n_avail = 2*bufsize * sizeof(short);
+ rb_read(rb, (char *)sndio_short_buf,
+ 2*bufsize * sizeof(short));
+ }
+ rb_write(rb_out2disk, (char *)&driver_offset, sizeof(u_int32_t));
+ goto sndio_wake;
+ break;
+ case CMD_FINISH:
+ goto sndio_finish;
+ break;
+ default:
+ fprintf(stderr, "sndio_thread: recv'd unknown command %d\n", recv_cmd);
+ break;
+ }
+ }
+
+ if ((n_avail = rb_read_space(rb) / (2*sample_size)) == 0) {
+ nanosleep(&req_time, &rem_time);
+ goto sndio_wake;
+ }
+
+ if (n_avail > bufsize)
+ n_avail = bufsize;
+
+ for (i = 0; i < n_avail; i++) {
+ rb_read(rb, (char *)&(l_buf[i]), sample_size);
+ rb_read(rb, (char *)&(r_buf[i]), sample_size);
+ }
+
+#ifdef HAVE_LADSPA
+ if (options.ladspa_is_postfader) {
+ for (i = 0; i < n_avail; i++) {
+ l_buf[i] *= left_gain;
+ r_buf[i] *= right_gain;
+ }
+ }
+#else
+ for (i = 0; i < n_avail; i++) {
+ l_buf[i] *= left_gain;
+ r_buf[i] *= right_gain;
+ }
+#endif /* HAVE_LADSPA */
+
+ if (n_avail < bufsize) {
+ for (i = n_avail; i < bufsize; i++) {
+ l_buf[i] = 0.0f;
+ r_buf[i] = 0.0f;
+ }
+ }
+
+ /* plugin processing */
+#ifdef HAVE_LADSPA
+ plugin_lock = 1;
+ for (i = 0; i < n_plugins; i++) {
+ if (plugin_vect[i]->is_bypassed)
+ continue;
+
+ if (plugin_vect[i]->handle) {
+ plugin_vect[i]->descriptor->run(plugin_vect[i]->handle, ladspa_buflen);
+ }
+ if (plugin_vect[i]->handle2) {
+ plugin_vect[i]->descriptor->run(plugin_vect[i]->handle2, ladspa_buflen);
+ }
+ }
+ plugin_lock = 0;
+
+ if (!options.ladspa_is_postfader) {
+ for (i = 0; i < bufsize; i++) {
+ l_buf[i] *= left_gain;
+ r_buf[i] *= right_gain;
+ }
+ }
+#endif /* HAVE_LADSPA */
+
+ for (i = 0; i < bufsize; i++) {
+ if (l_buf[i] > 1.0)
+ l_buf[i] = 1.0;
+ else if (l_buf[i] < -1.0)
+ l_buf[i] = -1.0;
+
+ if (r_buf[i] > 1.0)
+ r_buf[i] = 1.0;
+ else if (r_buf[i] < -1.0)
+ r_buf[i] = -1.0;
+
+ sndio_short_buf[2*i] = floorf(32767.0 * l_buf[i]);
+ sndio_short_buf[2*i+1] = floorf(32767.0 * r_buf[i]);
+ }
+
+ /* write data to audio device */
+ bytes_written = sio_write(sndio_hdl, sndio_short_buf, 2*n_avail * sizeof(short));
+ if (bytes_written != 2*n_avail * sizeof(short))
+ fprintf(stderr, "sndio_thread: Error writing to audio device\n");
+ }
+ sndio_finish:
+ return 0;
+}
+
+
+
/* OSS output thread */
#ifdef HAVE_OSS
void *
@@ -1149,6 +1299,84 @@ set_thread_priority(pthread_t thread, char * name, int
}
#endif /* _WIN32 */
+/* return values:
+ * 0 : success
+ * -1 : device busy
+ * -N : unable to start with given params
+ */
+int
+sndio_init(thread_info_t * info, int verbose, int realtime, int priority) {
+
+ struct sio_hdl * sndio_hdl;
+ struct sio_par sndio_par;
+
+ if (info->out_SR > MAX_SAMPLERATE) {
+ if (verbose) {
+ fprintf(stderr, "\nThe sample rate you set (%ld Hz) is higher than MAX_SAMPLERATE.\n",
+ info->out_SR);
+ fprintf(stderr, "This is an arbitrary limit, which you may safely enlarge "
+ "if you really need to.\n");
+ fprintf(stderr, "Currently MAX_SAMPLERATE = %d Hz.\n", MAX_SAMPLERATE);
+ }
+ return -2;
+ }
+
+ sndio_hdl = sio_open(NULL, SIO_PLAY, 0);
+ if (sndio_hdl == NULL) {
+ if (verbose) {
+ fprintf(stderr, "sio_open failed\n");
+ }
+ return -1;
+ }
+
+ sio_initpar(&sndio_par);
+ sndio_par.bits = 16;
+ sndio_par.pchan = 2;
+ sndio_par.rate = info->out_SR;
+ sndio_par.sig = 1;
+ sndio_par.le = 1;
+ sndio_par.appbufsz = sndio_par.rate/4;
+
+ if(sio_setpar(sndio_hdl, &sndio_par) == 0) {
+ if (verbose) {
+ fprintf(stderr, "sio_setpar failed\n");
+ }
+ sio_close(sndio_hdl);
+ return -3;
+ }
+ if(sio_getpar(sndio_hdl, &sndio_par) == 0) {
+ if (verbose) {
+ fprintf(stderr, "sio_getpar failed\n");
+ }
+ sio_close(sndio_hdl);
+ return -4;
+ }
+ if((sndio_par.bits != 16) || (sndio_par.pchan != 2) || \
+ (sndio_par.rate != info->out_SR) || (sndio_par.sig != 1) || \
+ (sndio_par.le != 1)) {
+ if (verbose) {
+ fprintf(stderr, "can't set sndio parameters\n");
+ }
+ sio_close(sndio_hdl);
+ return -5;
+ }
+ if(sio_start(sndio_hdl) == 0) {
+ if (verbose) {
+ fprintf(stderr, "sio_start failed\n");
+ }
+ sio_close(sndio_hdl);
+ return -3;
+ }
+
+ info->sndio_hdl = sndio_hdl;
+ AQUALUNG_THREAD_CREATE(info->sndio_thread_id, NULL, sndio_thread, info)
+ set_thread_priority(info->sndio_thread_id, "sndio output", realtime, priority);
+
+ return 0;
+}
+
+
+
#ifdef HAVE_OSS
/* return values:
* 0 : success
@@ -2210,7 +2438,7 @@ main(int argc, char ** argv) {
#if defined(HAVE_JACK) || defined(HAVE_ALSA) || defined(HAVE_OSS)
int auto_driver_found = 0;
-#endif /* jack || alsa || oss */
+#endif /* jack || alsa || oss || sndio */
if (setenv("LC_NUMERIC", "POSIX", 1) != 0) {
fprintf(stderr, "aqualung main(): setenv(\"LC_NUMERIC\", \"POSIX\") failed\n");
@@ -2277,6 +2505,11 @@ main(int argc, char ** argv) {
break;
case 'o':
output_str = strdup(optarg);
+ if (strcmp(output_str, "sndio") == 0) {
+ output = SNDIO_DRIVER;
+ free(output_str);
+ break;
+ }
if (strcmp(output_str, "oss") == 0) {
#ifdef HAVE_OSS
output = OSS_DRIVER;
@@ -2702,6 +2935,21 @@ main(int argc, char ** argv) {
}
}
#endif /* HAVE_ALSA */
+ if (output == 0) { /* probe sndio */
+ int ret;
+
+ printf("Probing sndio driver... ");
+ thread_info.out_SR = rate;
+
+ ret = sndio_init(&thread_info, 0, try_realtime, priority);
+ if (ret < 0) {
+ printf("unable to start with default params\n");
+ } else {
+ output = SNDIO_DRIVER;
+ auto_driver_found = 1;
+ printf("OK\n");
+ }
+ }
#ifdef HAVE_OSS
if (output == 0) { /* probe OSS */
int ret;
@@ -2793,6 +3041,10 @@ main(int argc, char ** argv) {
}
#endif /* HAVE_ALSA */
+ if (output == SNDIO_DRIVER) {
+ thread_info.out_SR = rate;
+ }
+
#ifdef HAVE_OSS
if (output == OSS_DRIVER) {
thread_info.out_SR = rate;
@@ -2814,6 +3066,15 @@ main(int argc, char ** argv) {
disk_try_realtime, disk_priority);
#endif /* _WIN32 */
+ if (output == SNDIO_DRIVER) {
+ if (!auto_driver_found) {
+ int ret = sndio_init(&thread_info, 1, try_realtime, priority);
+ if (ret < 0) {
+ exit(1);
+ }
+ }
+ }
+
#ifdef HAVE_OSS
if (output == OSS_DRIVER) {
if (!auto_driver_found) {
@@ -2845,6 +3106,12 @@ main(int argc, char ** argv) {
close_app_socket();
AQUALUNG_THREAD_JOIN(thread_info.disk_thread_id)
+
+ if (output == SNDIO_DRIVER) {
+ AQUALUNG_THREAD_JOIN(thread_info.sndio_thread_id)
+ free(thread_info.sndio_short_buf);
+ sio_close(thread_info.sndio_hdl);
+ }
#ifdef HAVE_OSS
if (output == OSS_DRIVER) {

View File

@ -1,25 +0,0 @@
$OpenBSD: patch-src_core_h,v 1.1 2009/01/28 00:20:57 sthen Exp $
--- src/core.h.orig Thu Dec 27 10:55:45 2007
+++ src/core.h Fri Jan 9 14:44:51 2009
@@ -59,7 +59,10 @@
#define WIN32_DRIVER 4
#endif /* _WIN32 */
+#define SNDIO_DRIVER 5
+#include <sndio.h>
+
#define MAX_SAMPLERATE 96000
@@ -80,6 +83,10 @@
typedef struct _thread_info {
AQUALUNG_THREAD_DECLARE(disk_thread_id)
+
+ AQUALUNG_THREAD_DECLARE(sndio_thread_id)
+ struct sio_hdl * sndio_hdl;
+ short * sndio_short_buf;
#ifdef HAVE_OSS
AQUALUNG_THREAD_DECLARE(oss_thread_id)

View File

@ -1,14 +0,0 @@
$OpenBSD: patch-src_decoder_dec_lavc_h,v 1.1 2008/07/09 02:07:36 jakemsr Exp $
--- src/decoder/dec_lavc.h.orig Sat Jun 21 11:55:41 2008
+++ src/decoder/dec_lavc.h Sat Jun 21 11:56:11 2008
@@ -23,8 +23,8 @@
#define _DEC_LAVC_H
#ifdef HAVE_LAVC
-#include <ffmpeg/avcodec.h>
-#include <ffmpeg/avformat.h>
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
#endif /* HAVE_LAVC */
#include "file_decoder.h"

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.4 2009/01/28 00:20:57 sthen Exp $
@comment $OpenBSD: PLIST,v 1.5 2009/02/09 22:13:39 sthen Exp $
@bin bin/aqualung
@man man/man1/aqualung.1
@owner root
@ -38,6 +38,7 @@ share/aqualung/skin/dark/btn_bg3.png
share/aqualung/skin/dark/next.png
share/aqualung/skin/dark/pause.png
share/aqualung/skin/dark/play.png
share/aqualung/skin/dark/play_pause.png
share/aqualung/skin/dark/prev.png
share/aqualung/skin/dark/rc
share/aqualung/skin/dark/repeat.png
@ -56,6 +57,7 @@ share/aqualung/skin/default/bg5.png
share/aqualung/skin/default/next.png
share/aqualung/skin/default/pause.png
share/aqualung/skin/default/play.png
share/aqualung/skin/default/play_pause.png
share/aqualung/skin/default/prev.png
share/aqualung/skin/default/rc
share/aqualung/skin/default/repeat.png
@ -72,6 +74,7 @@ share/aqualung/skin/metal/bg6.png
share/aqualung/skin/metal/next.png
share/aqualung/skin/metal/pause.png
share/aqualung/skin/metal/play.png
share/aqualung/skin/metal/play_pause.png
share/aqualung/skin/metal/prev.png
share/aqualung/skin/metal/rc
share/aqualung/skin/metal/repeat.png
@ -83,6 +86,7 @@ share/aqualung/skin/no_skin/
share/aqualung/skin/no_skin/next.png
share/aqualung/skin/no_skin/pause.png
share/aqualung/skin/no_skin/play.png
share/aqualung/skin/no_skin/play_pause.png
share/aqualung/skin/no_skin/prev.png
share/aqualung/skin/no_skin/rc
share/aqualung/skin/no_skin/repeat.png
@ -99,6 +103,7 @@ share/aqualung/skin/ocean/next.png
share/aqualung/skin/ocean/pause.png
share/aqualung/skin/ocean/pl.png
share/aqualung/skin/ocean/play.png
share/aqualung/skin/ocean/play_pause.png
share/aqualung/skin/ocean/prev.png
share/aqualung/skin/ocean/rc
share/aqualung/skin/ocean/repeat.png
@ -109,6 +114,7 @@ share/aqualung/skin/plain/
share/aqualung/skin/plain/next.png
share/aqualung/skin/plain/pause.png
share/aqualung/skin/plain/play.png
share/aqualung/skin/plain/play_pause.png
share/aqualung/skin/plain/prev.png
share/aqualung/skin/plain/rc
share/aqualung/skin/plain/repeat.png
@ -120,6 +126,7 @@ share/aqualung/skin/woody/next.png
share/aqualung/skin/woody/pause.png
share/aqualung/skin/woody/pine.png
share/aqualung/skin/woody/play.png
share/aqualung/skin/woody/play_pause.png
share/aqualung/skin/woody/prev.png
share/aqualung/skin/woody/rc
share/aqualung/skin/woody/repeat.png
@ -137,10 +144,30 @@ share/aqualung/skin/woody/wood6.png
share/aqualung/tab-close.png
share/doc/aqualung/
share/doc/aqualung/README
share/doc/aqualung/aqualung-doc.css
share/doc/aqualung/aqualung-doc.dtd
share/doc/aqualung/aqualung-doc.xml
share/doc/aqualung/aqualung-latex.xsl
share/doc/aqualung/aqualung-man.xsl
share/doc/aqualung/aqualung-xhtml-multipage.xsl
share/doc/aqualung/aqualung-xhtml-view.xsl
share/doc/aqualung/aqualung-xhtml.xsl
share/doc/aqualung/external.eps
share/doc/aqualung/external.png
share/doc/aqualung/jack.png
share/doc/aqualung/main.png
share/doc/aqualung/playlist.png
share/doc/aqualung/settings.png
share/doc/aqualung/split.sh
share/doc/aqualung/store.png
share/doc/aqualung/systray.png
share/doc/aqualung/timer.eps
share/doc/aqualung/timer.png
share/locale/de/LC_MESSAGES/aqualung.mo
share/locale/hu/LC_MESSAGES/aqualung.mo
share/locale/it/LC_MESSAGES/aqualung.mo
share/locale/ru/LC_MESSAGES/aqualung.mo
share/locale/sv/LC_MESSAGES/aqualung.mo
share/locale/uk/LC_MESSAGES/aqualung.mo
@exec %D/bin/update-desktop-database
@unexec %D/bin/update-desktop-database