update to 0.2.0; unbreak

This commit is contained in:
naddy 2001-09-30 14:24:47 +00:00
parent 5c8e788f93
commit 47ac5b4444
4 changed files with 106 additions and 8 deletions

View File

@ -1,10 +1,8 @@
# $OpenBSD: Makefile,v 1.5 2001/08/20 21:39:26 naddy Exp $
BROKEN= "not yet updated for libao.so.2"
# $OpenBSD: Makefile,v 1.6 2001/09/30 14:24:47 naddy Exp $
COMMENT= "free clone of mpg123, a command-line mp3 player"
DISTNAME= mpg321-0.1.5
DISTNAME= mpg321-0.2.0
CATEGORIES= audio
NEED_VERSION= 1.435
@ -19,9 +17,10 @@ PERMIT_DISTFILES_FTP= Yes
MASTER_SITES= http://people.debian.org/~drew/
DISTFILES= ${DISTNAME:S/-/_/}${EXTRACT_SUFX}
LIB_DEPENDS= ao.1::audio/libao \
LIB_DEPENDS= ao.2::audio/libao \
mad.0::audio/mad
SEPARATE_BUILD= concurrent
CONFIGURE_STYLE=gnu
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"

View File

@ -1,3 +1,3 @@
MD5 (mpg321_0.1.5.tar.gz) = 8632ea26959ae3057a6a6414e47fb486
RMD160 (mpg321_0.1.5.tar.gz) = edb6d11ebad317df2b56686190ada02172620bc4
SHA1 (mpg321_0.1.5.tar.gz) = 77d1b4a985b57c923a2df85a7b144fd38f588caa
MD5 (mpg321_0.2.0.tar.gz) = 9bf6a0b049c492381819b53e7449455a
RMD160 (mpg321_0.2.0.tar.gz) = 1b7e00a90498d42c2ae07575e438e53a7411357b
SHA1 (mpg321_0.2.0.tar.gz) = c6e1e785938ae9b365b6fdafa62397d8d1ab4b89

View File

@ -0,0 +1,88 @@
$OpenBSD: patch-mad_c,v 1.1 2001/09/30 14:24:47 naddy Exp $
--- mad.c.orig Mon Sep 24 14:27:40 2001
+++ mad.c Mon Sep 24 15:28:55 2001
@@ -554,44 +554,47 @@ enum mad_flow move(buffer *buf, signed l
int calc_length(char *file, buffer *buf)
{
- FILE * f;
+ int f;
struct stat filestat;
void *fdm;
char buffer[3];
- if (stat(file, &filestat) == -1)
+ f = open(file, O_RDONLY);
+
+ if (f < 0)
{
mpg321_error(file);
return -1;
}
- f = fopen(file, "r");
-
- if (f == NULL)
+ if (fstat(f, &filestat) < 0)
{
mpg321_error(file);
+ close(f);
return -1;
}
if (!S_ISREG(filestat.st_mode))
{
fprintf(stderr, "%s: Not a regular file\n", file);
- fclose(f);
+ close(f);
return -1;
}
/* TAG checking is adapted from XMMS */
buf->length = filestat.st_size;
- if (fseek(f, -128, SEEK_END) < 0)
+ if (lseek(f, -128, SEEK_END) < 0)
{
mpg321_error(file);
+ close(f);
return -1;
}
- if (read(fileno(f), buffer, 3) != 3)
+ if (read(f, buffer, 3) != 3)
{
fprintf(stderr, "Couldnt read 3 bytes from %s\n", file);
+ close(f);
return -1;
}
@@ -600,12 +603,11 @@ int calc_length(char *file, buffer *buf)
buf->length -= 128; /* Correct for id3 tags */
}
- rewind(f);
-
- fdm = mmap(0, buf->length, PROT_READ, MAP_SHARED, fileno(f), 0);
+ fdm = mmap(0, buf->length, PROT_READ, MAP_SHARED, f, 0);
if (fdm == MAP_FAILED)
{
mpg321_error(file);
+ close(f);
return -1;
}
@@ -616,11 +618,11 @@ int calc_length(char *file, buffer *buf)
if (munmap(fdm, buf->length) == -1)
{
mpg321_error(file);
- fclose(f);
+ close(f);
return -1;
}
- if (fclose(f) == EOF)
+ if (close(f) < 0)
{
mpg321_error(file);
return -1;

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-playlist_c,v 1.1 2001/09/30 14:24:47 naddy Exp $
--- playlist.c.orig Mon Sep 24 21:05:52 2001
+++ playlist.c Mon Sep 24 21:06:24 2001
@@ -48,6 +48,7 @@ playlist * new_playlist()
pl->files_size = DEFAULT_PLAYLIST_SIZE;
pl->numfiles = 0;
pl->random_play = 0;
+ strcpy(pl->remote_file, "");
return pl;
}