summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonny Davies <woodchip@gentoo.org>2001-09-18 23:00:47 +0000
committerDonny Davies <woodchip@gentoo.org>2001-09-18 23:00:47 +0000
commit32b0ed1fd1e9475c2b538957a36af611fe07196c (patch)
treeed7f6cee47c333f7028c6f680b96e0b520acdccd /media-sound/mpg321
parentchanged the hard-coded esd DEPEND to conditional on esd being in USE (diff)
downloadgentoo-2-32b0ed1fd1e9475c2b538957a36af611fe07196c.tar.gz
gentoo-2-32b0ed1fd1e9475c2b538957a36af611fe07196c.tar.bz2
gentoo-2-32b0ed1fd1e9475c2b538957a36af611fe07196c.zip
added a console-based mp3 player, alsa capable
Diffstat (limited to 'media-sound/mpg321')
-rw-r--r--media-sound/mpg321/files/digest-mpg321-0.1.51
-rw-r--r--media-sound/mpg321/files/mpg321-0.1.5-ao.diff247
-rw-r--r--media-sound/mpg321/mpg321-0.1.5.ebuild28
3 files changed, 276 insertions, 0 deletions
diff --git a/media-sound/mpg321/files/digest-mpg321-0.1.5 b/media-sound/mpg321/files/digest-mpg321-0.1.5
new file mode 100644
index 000000000000..2d0ed48236b8
--- /dev/null
+++ b/media-sound/mpg321/files/digest-mpg321-0.1.5
@@ -0,0 +1 @@
+MD5 8632ea26959ae3057a6a6414e47fb486 mpg321_0.1.5.tar.gz
diff --git a/media-sound/mpg321/files/mpg321-0.1.5-ao.diff b/media-sound/mpg321/files/mpg321-0.1.5-ao.diff
new file mode 100644
index 000000000000..1fcb4db730b2
--- /dev/null
+++ b/media-sound/mpg321/files/mpg321-0.1.5-ao.diff
@@ -0,0 +1,247 @@
+diff -urN mpg321-0.1.5/mad.c mpg321-0.1.5-new/mad.c
+--- mpg321-0.1.5/mad.c Wed Jul 18 02:39:34 2001
++++ mpg321-0.1.5-new/mad.c Wed Sep 12 15:49:36 2001
+@@ -94,112 +94,35 @@
+
+ void open_ao_playdevice(struct mad_header const *header)
+ {
+- int numChannels = MAD_NCHANNELS(header);
+- if(options.opt & MPG321_USE_WAV)
+- {
+- int driver_id = ao_get_driver_id("wav");
+- ao_option_t *ao_options = NULL;
++ int numChannels = MAD_NCHANNELS(header);
++ int driver_id;
++ ao_sample_format format;
+
+- /* Don't have to check options.device here: we only define
+- MPG321_USE_WAV when -w <wavfile> is defined, and <wavfile>
+- is pointd to by options.device */
+- ao_append_option(&ao_options, "file", options.device);
++ if (options.opt & MPG321_FILE_PLAY) {
++ fprintf (stderr, "wav output not supported yet\n");
++ exit (-1);
++ }
+
+- if((playdevice=ao_open(driver_id, 16, header->samplerate, numChannels, ao_options))==NULL)
+- {
+- fprintf(stderr, "Error opening libao wav file driver.\n");
+- exit(1);
+- }
+- }
++ if (!options.output || !*options.output) {
++ driver_id = ao_default_driver_id ();
++ } else {
++ driver_id = ao_driver_id (options.output);
++ if (driver_id == -1) {
++ fprintf (stderr, "couldn't find plugin \"%s\"\n", options.output);
++ exit (-1);
++ }
++ }
+
+- else if(options.opt & MPG321_USE_NULL)
+- {
+- int driver_id = ao_get_driver_id("null");
+- if((playdevice = ao_open(driver_id, 0, 0, 0, NULL)) == NULL)
+- {
+- fprintf(stderr, "Error opening libao null driver.\n");
+- exit(1);
+- }
+- }
+-
+- else if (options.opt & MPG321_USE_STDOUT)
+- {
+- ao_option_t * ao_options = NULL;
+- int driver_id = ao_get_driver_id("raw");
+-
+- ao_append_option(&ao_options, "file", "-");
+-
+- if((playdevice=ao_open(driver_id, 16, header->samplerate, numChannels, ao_options))==NULL)
+- {
+- fprintf(stderr, "Error opening libao raw output driver.\n");
+- exit(1);
+- }
+- }
+-
+- else if(options.opt & MPG321_USE_ESD)
+- {
+- ao_option_t *ao_options = NULL;
+- int driver_id = ao_get_driver_id("esd");
+-
+- if(options.device)
+- ao_append_option(&ao_options, "host", options.device);
+-
+- if((playdevice=ao_open(driver_id, 16, header->samplerate, numChannels, ao_options))==NULL)
+- {
+- fprintf(stderr, "Error opening libao esd driver.\n");
+- exit(1);
+- }
+- }
+-
+- else if(options.opt & MPG321_USE_ALSA)
+- {
+- ao_option_t *ao_options = NULL;
+- int driver_id = ao_get_driver_id("alsa");
+- char *c;
+-
+- if (options.device)
+- {
+- if ((c = strchr(options.device, ':')) == NULL || strlen(c+1) < 1)
+- {
+- fprintf(stderr, "Poorly formed ALSA card:device specification %s", options.device);
+- exit(1);
+- }
+-
+- *(c++) = '\0'; /* change the : to a null to create two separate strings */
+-
+- ao_append_option(&ao_options, "card", options.device);
+- ao_append_option(&ao_options, "dev", c);
+- }
+-
+- if((playdevice=ao_open(driver_id, 16, header->samplerate, numChannels, ao_options))==NULL)
+- {
+- fprintf(stderr, "Error opening libao alsa driver.\n");
+- exit(1);
+- }
+- }
+-
+- else
+- {
+- ao_option_t *ao_options = NULL;
+- int driver_id = ao_get_driver_id(AUDIO_DEFAULT);
+-
+- if (strcmp(AUDIO_DEFAULT, "oss") == 0)
+- {
+- if (options.device)
+- ao_append_option(&ao_options, "dsp", options.device);
+- }
+- else if (strcmp(AUDIO_DEFAULT, "sun") == 0)
+- {
+- if (options.device)
+- ao_append_option(&ao_options, "dev", options.device);
+- }
++ format.rate = header->samplerate;
++ format.channels = numChannels;
++ format.bits = 16;
++ format.byte_format = AO_FMT_LITTLE;
+
+- if((playdevice=ao_open(driver_id, 16, header->samplerate, numChannels, ao_options))==NULL)
+- {
+- fprintf(stderr, "Error opening libao oss driver.\n");
+- exit(1);
+- }
+- }
++ playdevice = ao_open_live (driver_id, &format, NULL);
++ if (playdevice == NULL) {
++ fprintf (stderr, "error opening device \"%s\"\n", options.output);
++ exit (-1);
++ }
+ }
+
+ char * layerstring(enum mad_layer layer)
+diff -urN mpg321-0.1.5/mpg321.c mpg321-0.1.5-new/mpg321.c
+--- mpg321-0.1.5/mpg321.c Sat Aug 11 04:31:16 2001
++++ mpg321-0.1.5-new/mpg321.c Wed Sep 12 15:50:43 2001
+@@ -53,7 +53,7 @@
+ int stop_playing_file = 0;
+ int quit_now = 0;
+ char *playlist_file;
+-ao_device_t *playdevice=NULL;
++ao_device *playdevice=NULL;
+ mad_timer_t current_time;
+ mpg321_options options = { 0, NULL, 0 };
+
+@@ -221,7 +221,7 @@
+ break;
+
+ case 'q':
+- options.opt |= MPG321_QUIET_PLAY;
++ options.output = "null";
+ break;
+
+ case 'R':
+@@ -238,11 +238,11 @@
+ break;
+
+ case 't':
+- options.opt |= MPG321_USE_NULL;
++ options.output = "null";
+ break;
+
+ case 'w':
+- options.opt |= MPG321_USE_WAV;
++ options.opt |= MPG321_FILE_PLAY;
+ options.device = strdup(optarg);
+ break;
+
+@@ -252,25 +252,13 @@
+ break;
+
+ case 's':
+- options.opt |= MPG321_USE_STDOUT;
++ options.opt |= MPG321_FILE_PLAY;
++ options.device = "-";
+ break;
+
+ case 'o':
+- if (strcmp(optarg, "alsa") == 0)
+- {
+- options.opt |= MPG321_USE_ALSA;
+- }
+-
+- else if (strcmp(optarg, "esd") == 0)
+- {
+- options.opt |= MPG321_USE_ESD;
+- }
+-
+- else
+- {
+- fprintf(stderr, "Option %s to --output not implemented or not understood.\n", optarg);
+- }
+-
++ options.output = strdup(optarg);
++
+ break;
+
+ case 'g':
+@@ -328,6 +316,7 @@
+
+ /* Get the command line options */
+ options.volume = 100;
++ options.output = "";
+
+ /* also adds all playlist files to playlist pl */
+ parse_options(argc, argv, pl);
+diff -urN mpg321-0.1.5/mpg321.h mpg321-0.1.5-new/mpg321.h
+--- mpg321-0.1.5/mpg321.h Sat Aug 11 04:25:08 2001
++++ mpg321-0.1.5-new/mpg321.h Wed Sep 12 15:47:26 2001
+@@ -59,13 +59,14 @@
+ typedef struct
+ {
+ int opt;
++ char *output;
+ char *device;
+ unsigned long seek;
+ int volume;
+ } mpg321_options;
+
+ extern mpg321_options options;
+-extern ao_device_t *playdevice;
++extern ao_device *playdevice;
+ extern mad_timer_t current_time;
+ extern int stop_playing_file;
+
+@@ -74,12 +75,7 @@
+ MPG321_VERBOSE_PLAY = 0x0001,
+ MPG321_QUIET_PLAY = 0x0002,
+ MPG321_REMOTE_PLAY = 0x0004,
+-
+- MPG321_USE_STDOUT = 0x0010,
+- MPG321_USE_ALSA = 0x0020,
+- MPG321_USE_ESD = 0x0040,
+- MPG321_USE_NULL = 0x0080,
+- MPG321_USE_WAV = 0x0100
++ MPG321_FILE_PLAY = 0x0008,
+ };
+
+ #define DEFAULT_PLAYLIST_SIZE 1024
diff --git a/media-sound/mpg321/mpg321-0.1.5.ebuild b/media-sound/mpg321/mpg321-0.1.5.ebuild
new file mode 100644
index 000000000000..e29b358fe2e1
--- /dev/null
+++ b/media-sound/mpg321/mpg321-0.1.5.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2000 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Author David Rufino <daverufino@btinternet.com>
+# $Header: /var/cvsroot/gentoo-x86/media-sound/mpg321/mpg321-0.1.5.ebuild,v 1.1 2001/09/18 23:00:47 woodchip Exp $
+
+A=${PN}_${PV}.tar.gz
+S=${WORKDIR}/${P}
+DESCRIPTION="Free mp3 player"
+SRC_URI="http://people.debian.org/~drew/${A}"
+HOMEPAGE="http://people.debian.org/~drew/"
+
+DEPEND="virtual/glibc
+ >=media-sound/mad-0.13.0b
+ >=media-libs/libao-0.8.0"
+
+src_unpack () {
+ unpack ${A}
+ patch -p0 < ${FILESDIR}/mpg321-0.1.5-ao.diff || die
+}
+
+src_compile() {
+ ./configure --prefix=/usr --host=${CHOST} || die
+ make || die
+}
+
+src_install () {
+ make DESTDIR=${D} install || die
+}