this has been revived upstream, update to 0.3.2

This commit is contained in:
naddy 2012-07-13 09:05:38 +00:00
parent 89f08e79ca
commit 3b3cb2a94a
7 changed files with 72 additions and 136 deletions

View File

@ -1,12 +1,12 @@
# $OpenBSD: Makefile,v 1.26 2012/03/29 13:38:13 sthen Exp $
# $OpenBSD: Makefile,v 1.27 2012/07/13 09:05:38 naddy Exp $
# not very useful with static libao
SHARED_ONLY= Yes
COMMENT= free clone of mpg123, a command-line mp3 player
DISTNAME= mpg321-0.2.10
REVISION= 3
VERSION= 0.3.2
PKGNAME= mpg321-${VERSION}
CATEGORIES= audio
HOMEPAGE= http://mpg321.sourceforge.net/
@ -18,18 +18,19 @@ PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= ao>=3 c id3tag>=2 mad>=2 z
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mpg321/}
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mpg321/}
DISTFILES= mpg321_${VERSION}.orig.tar.gz
WANTLIB= ao c id3tag m mad pthread z
LIB_DEPENDS= audio/libao \
audio/libid3tag \
audio/libmad
WRKDIST= ${WRKDIR}/mpg321-${VERSION}-orig
SEPARATE_BUILD= Yes
USE_GROFF = Yes
CONFIGURE_STYLE=gnu
CONFIGURE_ARGS= --disable-mpg123-symlink
CONFIGURE_ARGS= --disable-mpg123-symlink \
--disable-alsa
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"

View File

@ -1,5 +1,2 @@
MD5 (mpg321-0.2.10.tar.gz) = u0A7NcLSVlXVXw9ha49Huw==
RMD160 (mpg321-0.2.10.tar.gz) = wIZ+bKfApeL/AG4MOqhm0v3lKbo=
SHA1 (mpg321-0.2.10.tar.gz) = kCaNDRh93XYl0UO5V5HLOaFjC3k=
SHA256 (mpg321-0.2.10.tar.gz) = 2wwplZK48fcE9BvT/Dor8ThlgQhYjVGvYWOMVRrxsNQ=
SIZE (mpg321-0.2.10.tar.gz) = 113449
SHA256 (mpg321_0.3.2.orig.tar.gz) = BW/MA+P1xQIex0u1BT0yxKO4m0CGR43Pga2uZQ6sKE4=
SIZE (mpg321_0.3.2.orig.tar.gz) = 151139

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-ao_c,v 1.2 2010/06/03 16:07:02 pea Exp $
--- ao.c.orig Sun Mar 24 06:49:47 2002
+++ ao.c Fri May 14 22:52:35 2010
@@ -94,7 +94,7 @@ void check_ao_default_play_device()
void check_default_play_device()
{
/* check that no output devices are currently selected */
- if (!(options.opt & (MPG321_USE_OSS | MPG321_USE_STDOUT | MPG321_USE_ALSA | MPG321_USE_ESD
+ if (!(options.opt & (MPG321_USE_OSS | MPG321_USE_SUN | MPG321_USE_STDOUT | MPG321_USE_ALSA | MPG321_USE_ESD
| MPG321_USE_NULL | MPG321_USE_WAV | MPG321_USE_ARTS | MPG321_USE_AU
| MPG321_USE_CDR | MPG321_USE_ALSA09 | MPG321_USE_USERDEF)))
{
@@ -229,6 +229,7 @@ void open_ao_playdevice(struct mad_header const *heade
and restore it afterwards */
signal(SIGINT, SIG_DFL);
+ memset(&format, 0, sizeof(format));
format.bits = 16;
format.rate = header->samplerate;
format.channels = (options.opt & MPG321_FORCE_STEREO) ? 2 : MAD_NCHANNELS(header);

View File

@ -0,0 +1,22 @@
$OpenBSD: patch-configure,v 1.4 2012/07/13 09:05:38 naddy Exp $
--- configure.orig Wed Jul 11 13:42:33 2012
+++ configure Wed Jul 11 13:44:46 2012
@@ -3860,7 +3860,8 @@ if test "x$ac_cv_lib_pthread_pthread_create" = x""yes;
#define HAVE_LIBPTHREAD 1
_ACEOF
- LIBS="-lpthread $LIBS"
+ CFLAGS="-pthread $CFLAGS"
+ LIBS="-pthread $LIBS"
else
as_fn_error $? "\"POSIX Threads is required to compile mpg321.\"" "$LINENO" 5
@@ -5739,7 +5740,7 @@ if test "x$enable_alsa" = "xyes"; then
$as_echo "yes" >&6; }
else
CFLAGS="$CFLAGS"
- LIBS="$LIBS -lz -lpthread -lm"
+ LIBS="$LIBS -lz -lm"
check_alsa="no"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-mpg321_c,v 1.6 2008/10/30 14:46:59 naddy Exp $
--- mpg321.c.orig Sun Mar 24 06:49:20 2002
+++ mpg321.c Thu Oct 30 14:48:54 2008
@@ -75,9 +75,15 @@ void mpg321_error(char *file)
$OpenBSD: patch-mpg321_c,v 1.7 2012/07/13 09:05:38 naddy Exp $
--- mpg321.c.orig Sun Mar 25 14:27:49 2012
+++ mpg321.c Sun Jul 8 14:15:18 2012
@@ -332,9 +332,15 @@ void mpg321_error(char *file)
void usage(char *argv0)
{
@ -18,12 +18,12 @@ $OpenBSD: patch-mpg321_c,v 1.6 2008/10/30 14:46:59 naddy Exp $
"Options supported:\n"
" --verbose or -v Increase verbosity\n"
" --quiet or -q Quiet mode (no title or boilerplate)\n"
@@ -85,7 +91,13 @@ void usage(char *argv0)
@@ -342,7 +348,13 @@ void usage(char *argv0)
" --skip N or -k N Skip N frames into the file\n"
" --verbose or -v Be more verbose in playing files\n"
" --frames N or -n N Play only the first N frames\n"
" -o dt Set output devicetype to dt\n"
- " [esd,alsa(09),arts,sun,oss]\n"
+ " (");
- " [esd,alsa(09),arts,sun,oss]\n"
+ " (");
+ for (i = 0; i < driver_count; i++) {
+ fprintf(stderr, "%s%s", devices[i]->short_name,
+ (i + 1 < driver_count) ? ", " : "");
@ -33,34 +33,16 @@ $OpenBSD: patch-mpg321_c,v 1.6 2008/10/30 14:46:59 naddy Exp $
" --audiodevice N or -a N Use N for audio-out\n"
" --stdout or -s Use stdout for audio-out\n"
" --au N Use au file N for output\n"
@@ -101,7 +113,7 @@ void usage(char *argv0)
" --version or -V Print version information\n"
"\n"
@@ -376,7 +388,7 @@ void usage(char *argv0)
"n Skip song. \n"
"\n"
"This version of mpg321 has been configured with " AUDIO_DEFAULT " as its default\n"
- "libao output device.\n" , argv0);
+ "libao output device.\n");
}
/* retsigtype is defined by configure;
@@ -188,7 +200,7 @@ static int show_id3(struct id3_tag const *tag)
else
{
- printf(names[i]);
+ printf("%s", names[i]);
free(names[i]);
}
}
@@ -203,7 +215,7 @@ static int show_id3(struct id3_tag const *tag)
if (!names[i]) {
fprintf (stderr, emptystring);
} else {
- fprintf (stderr, names[i]);
+ fprintf (stderr, "%s", names[i]);
free (names[i]);
}
if (i%2) fprintf (stderr, "\n");
@@ -239,6 +251,8 @@ int main(int argc, char *argv[])
@@ -539,6 +551,8 @@ int main(int argc, char *argv[])
status = MPG321_PLAYING;
@ -69,16 +51,15 @@ $OpenBSD: patch-mpg321_c,v 1.6 2008/10/30 14:46:59 naddy Exp $
/* Get the command line options */
parse_options(argc, argv, pl);
@@ -257,8 +271,6 @@ int main(int argc, char *argv[])
if (shuffle_play)
shuffle_files(pl);
@@ -666,7 +680,6 @@ int main(int argc, char *argv[])
- ao_initialize();
-
check_default_play_device();
}
else {
- ao_initialize();
check_default_play_device();
}
if (!(options.opt & MPG321_REMOTE_PLAY))
@@ -285,6 +297,8 @@ int main(int argc, char *argv[])
@@ -764,6 +777,8 @@ int main(int argc, char *argv[])
signal(SIGINT, SIG_DFL);
playbuf.buf = NULL;
@ -87,55 +68,3 @@ $OpenBSD: patch-mpg321_c,v 1.6 2008/10/30 14:46:59 naddy Exp $
playbuf.fd = -1;
playbuf.length = 0;
playbuf.done = 0;
@@ -410,12 +424,14 @@ int main(int argc, char *argv[])
if(fstat(fd, &stat) == -1)
{
+ close(fd);
mpg321_error(currentfile);
continue;
}
if (!S_ISREG(stat.st_mode))
{
+ close(fd);
continue;
}
@@ -432,6 +448,7 @@ int main(int argc, char *argv[])
if((playbuf.buf = mmap(0, playbuf.length, PROT_READ, MAP_SHARED, fd, 0))
== MAP_FAILED)
{
+ close(fd);
mpg321_error(currentfile);
continue;
}
@@ -509,9 +526,6 @@ int main(int argc, char *argv[])
mad_decoder_finish(&decoder);
- if (quit_now)
- break;
-
if (playbuf.frames)
free(playbuf.frames);
@@ -521,6 +535,7 @@ int main(int argc, char *argv[])
if (playbuf.fd == -1)
{
munmap(playbuf.buf, playbuf.length);
+ close(fd);
}
else
@@ -535,10 +550,6 @@ int main(int argc, char *argv[])
ao_close(playdevice);
ao_shutdown();
-
-#if defined(RAW_SUPPORT) || defined(HTTP_SUPPORT) || defined(FTP_SUPPORT)
- if(fd) close(fd);
-#endif
return(0);
}

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-mpg321_h,v 1.1 2012/07/13 09:05:38 naddy Exp $
--- mpg321.h.orig Sun Mar 25 14:27:49 2012
+++ mpg321.h Sun Jul 8 14:00:16 2012
@@ -200,6 +200,7 @@ void check_ao_default_play_device();
void check_default_play_device();
int playdevice_is_live();
void open_ao_playdevice(struct mad_header const *header);
+ao_device *open_ao_playdevice_buffer(struct mad_header const *header);
/* remote control (-R) functions */
void remote_get_input_wait(buffer *buf);
@@ -290,7 +291,7 @@ output_frame *Output_Queue;
/* Shared total decoded frames */
decoded_frames *Decoded_Frames;
-#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
+#if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) || defined(__OpenBSD__)
/* */
#else
union semun {

View File

@ -1,13 +0,0 @@
$OpenBSD: patch-network_c,v 1.1 2005/09/10 16:42:01 naddy Exp $
--- network.c.orig Sun Mar 24 06:49:56 2002
+++ network.c Mon Aug 15 17:26:03 2005
@@ -225,7 +225,8 @@ int http_open(char *arg)
* a html page and not the stream */
snprintf(http_request, sizeof(http_request), "GET /%s HTTP/1.0\r\n"
/* "User-Agent: Mozilla/2.0 (Win95; I)\r\n" */
- "Pragma: no-cache\r\n" "Host: %s\r\n" "Accept: */*\r\n" "\r\n", filename, host);
+ "User-Agent: mpg321/%s\r\n"
+ "Pragma: no-cache\r\n" "Host: %s\r\n" "Accept: */*\r\n" "\r\n", filename, VERSION, host);
send(tcp_sock, http_request, strlen(http_request), 0);