summaryrefslogtreecommitdiff
path: root/audio/mserv
diff options
context:
space:
mode:
authorabs <abs>2002-10-03 15:46:55 +0000
committerabs <abs>2002-10-03 15:46:55 +0000
commitd031ded42107db721deb0c501948add18933c75b (patch)
tree1662f19eb3e94e65f8b10214d974587ddf14464c /audio/mserv
parent2be4bb487d340f27c22e1ba695837a667db4e2de (diff)
downloadpkgsrc-d031ded42107db721deb0c501948add18933c75b.tar.gz
Update mserv to mserv-0.33nb5:
Correctly parse ID3V2 headers.
Diffstat (limited to 'audio/mserv')
-rw-r--r--audio/mserv/Makefile4
-rw-r--r--audio/mserv/distinfo10
-rw-r--r--audio/mserv/patches/patch-aa2
-rw-r--r--audio/mserv/patches/patch-ab2
-rw-r--r--audio/mserv/patches/patch-ac2
-rw-r--r--audio/mserv/patches/patch-ad2
-rw-r--r--audio/mserv/patches/patch-ae2
-rw-r--r--audio/mserv/patches/patch-af2
-rw-r--r--audio/mserv/patches/patch-ag2
-rw-r--r--audio/mserv/patches/patch-ah2
-rw-r--r--audio/mserv/patches/patch-ai139
-rw-r--r--audio/mserv/patches/patch-aj26
-rw-r--r--audio/mserv/patches/patch-ak52
-rw-r--r--audio/mserv/patches/patch-al15
-rw-r--r--audio/mserv/patches/patch-am15
15 files changed, 219 insertions, 58 deletions
diff --git a/audio/mserv/Makefile b/audio/mserv/Makefile
index 137d4df17cf..6320adf7568 100644
--- a/audio/mserv/Makefile
+++ b/audio/mserv/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.5 2002/08/02 23:01:45 abs Exp $
+# $NetBSD: Makefile,v 1.6 2002/10/03 15:46:55 abs Exp $
#
DISTNAME= mserv-0.33
-PKGREVISION= 4
+PKGREVISION= 5
CATEGORIES= audio
MASTER_SITES= http://www.mserv.org/download/
diff --git a/audio/mserv/distinfo b/audio/mserv/distinfo
index 68798fa1227..47e1bae0b42 100644
--- a/audio/mserv/distinfo
+++ b/audio/mserv/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2002/08/02 23:01:46 abs Exp $
+$NetBSD: distinfo,v 1.6 2002/10/03 15:46:55 abs Exp $
SHA1 (mserv-0.33.tar.gz) = 4aa66852057942341d9da9c6f839d7ee250f6785
Size (mserv-0.33.tar.gz) = 136456 bytes
@@ -10,6 +10,8 @@ SHA1 (patch-ae) = 6954c13dc501ff0ea55cee19301d584130ca0d24
SHA1 (patch-af) = 819c178948b6aff9352ef35b45e13ab8f0ff84df
SHA1 (patch-ag) = e4e2f19bc1b14b20d5a03f7362026a61ffb291bc
SHA1 (patch-ah) = ca0dc3be3c02f82d033cab93aaa454d6918d45de
-SHA1 (patch-ai) = 572ef68fe6efe77a6f8af71d8136ceb2310ce1d9
-SHA1 (patch-aj) = eed5668942fdc801685aeda8aa2c31ec24d03729
-SHA1 (patch-ak) = 91080a55922bbd46a4ba55dc4641dfa0171a553e
+SHA1 (patch-ai) = 62709c796913aae2e5866a94b22f929189b57d9a
+SHA1 (patch-aj) = 6638a7d9422332aaf9b435337c316cc882f51e9e
+SHA1 (patch-ak) = f83430d69e2a87d045a7d42642053744cc33c8e1
+SHA1 (patch-al) = eed5668942fdc801685aeda8aa2c31ec24d03729
+SHA1 (patch-am) = 91080a55922bbd46a4ba55dc4641dfa0171a553e
diff --git a/audio/mserv/patches/patch-aa b/audio/mserv/patches/patch-aa
index 5ff9e24f7bf..f4de1a9b701 100644
--- a/audio/mserv/patches/patch-aa
+++ b/audio/mserv/patches/patch-aa
@@ -1,4 +1,4 @@
-$NetBSD: patch-aa,v 1.4 2002/08/02 23:01:46 abs Exp $
+$NetBSD: patch-aa,v 1.5 2002/10/03 15:46:56 abs Exp $
--- Makefile.orig Sat Jul 15 19:29:10 2000
+++ Makefile
diff --git a/audio/mserv/patches/patch-ab b/audio/mserv/patches/patch-ab
index 67625fdbc40..f535809da34 100644
--- a/audio/mserv/patches/patch-ab
+++ b/audio/mserv/patches/patch-ab
@@ -1,4 +1,4 @@
-$NetBSD: patch-ab,v 1.5 2002/08/02 23:01:46 abs Exp $
+$NetBSD: patch-ab,v 1.6 2002/10/03 15:46:56 abs Exp $
--- mserv/cmd.c.orig Sat Jul 15 18:52:56 2000
+++ mserv/cmd.c
diff --git a/audio/mserv/patches/patch-ac b/audio/mserv/patches/patch-ac
index 688e1b33d15..e406ded96fe 100644
--- a/audio/mserv/patches/patch-ac
+++ b/audio/mserv/patches/patch-ac
@@ -1,4 +1,4 @@
-$NetBSD: patch-ac,v 1.3 2002/08/02 23:01:46 abs Exp $
+$NetBSD: patch-ac,v 1.4 2002/10/03 15:46:57 abs Exp $
--- mserv/config.h.in.orig Tue Jan 25 19:59:08 2000
+++ mserv/config.h.in
diff --git a/audio/mserv/patches/patch-ad b/audio/mserv/patches/patch-ad
index 91dfad98600..d0b9b6efdb6 100644
--- a/audio/mserv/patches/patch-ad
+++ b/audio/mserv/patches/patch-ad
@@ -1,4 +1,4 @@
-$NetBSD: patch-ad,v 1.3 2002/08/02 23:01:46 abs Exp $
+$NetBSD: patch-ad,v 1.4 2002/10/03 15:46:57 abs Exp $
--- mserv/configure.in.orig Tue Jan 25 19:59:11 2000
+++ mserv/configure.in
diff --git a/audio/mserv/patches/patch-ae b/audio/mserv/patches/patch-ae
index 79c039d50bf..01784a6ec79 100644
--- a/audio/mserv/patches/patch-ae
+++ b/audio/mserv/patches/patch-ae
@@ -1,4 +1,4 @@
-$NetBSD: patch-ae,v 1.3 2002/08/02 23:01:47 abs Exp $
+$NetBSD: patch-ae,v 1.4 2002/10/03 15:46:57 abs Exp $
--- mserv/configure.orig Sat Jul 15 19:33:45 2000
+++ mserv/configure
diff --git a/audio/mserv/patches/patch-af b/audio/mserv/patches/patch-af
index 3ae85dde45c..2ac054016dd 100644
--- a/audio/mserv/patches/patch-af
+++ b/audio/mserv/patches/patch-af
@@ -1,4 +1,4 @@
-$NetBSD: patch-af,v 1.3 2002/08/02 23:01:47 abs Exp $
+$NetBSD: patch-af,v 1.4 2002/10/03 15:46:57 abs Exp $
--- mserv/defconf.c.orig Thu Jul 13 22:20:42 2000
+++ mserv/defconf.c
diff --git a/audio/mserv/patches/patch-ag b/audio/mserv/patches/patch-ag
index ad4d88035ca..0606548920d 100644
--- a/audio/mserv/patches/patch-ag
+++ b/audio/mserv/patches/patch-ag
@@ -1,4 +1,4 @@
-$NetBSD: patch-ag,v 1.3 2002/08/02 23:01:47 abs Exp $
+$NetBSD: patch-ag,v 1.4 2002/10/03 15:46:57 abs Exp $
--- mserv/defines.h.orig Thu Jul 13 22:35:18 2000
+++ mserv/defines.h
diff --git a/audio/mserv/patches/patch-ah b/audio/mserv/patches/patch-ah
index 71ae381cb7c..b763f254130 100644
--- a/audio/mserv/patches/patch-ah
+++ b/audio/mserv/patches/patch-ah
@@ -1,4 +1,4 @@
-$NetBSD: patch-ah,v 1.3 2002/08/02 23:01:47 abs Exp $
+$NetBSD: patch-ah,v 1.4 2002/10/03 15:46:58 abs Exp $
--- mserv/english.lang.orig Thu Jul 13 23:14:11 2000
+++ mserv/english.lang
diff --git a/audio/mserv/patches/patch-ai b/audio/mserv/patches/patch-ai
index e5f063dc6b2..c9a51e1f852 100644
--- a/audio/mserv/patches/patch-ai
+++ b/audio/mserv/patches/patch-ai
@@ -1,19 +1,124 @@
-$NetBSD: patch-ai,v 1.2 2002/08/02 23:01:47 abs Exp $
+$NetBSD: patch-ai,v 1.3 2002/10/03 15:46:58 abs Exp $
---- mserv/mserv.c.orig Sat Jul 15 18:01:15 2000
-+++ mserv/mserv.c
-@@ -3370,7 +3370,13 @@ int mserv_setmixer(t_client *cl, int wha
- mserv_response(cl, "IOCTLWR", NULL);
- return -1;
- }
-- newval = newval & 0xFF;
-+ if (ioctl(mixer_fd, MIXER_READ(what), &newval) == -1) {
-+ close(mixer_fd);
-+ perror("iotcl read");
-+ mserv_response(cl, "IOCTLRD", 0);
-+ return -1;
+--- mserv/mp3info.c.orig Thu Oct 3 16:10:58 2002
++++ mserv/mp3info.c
+@@ -7,6 +7,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
++#include "mserv.h"
+ #include "mp3info.h"
+
+ /* mp3 frame header structure */
+@@ -25,6 +26,8 @@
+ #define h_id(val) ((val>>19)&1)
+ #define h_thing(val) ((val>>20)&0xfff)
+
++#define ID3V2HEADERLEN 10
++
+ /* mp3 bit rate and sampling frequency tables */
+
+ const int bitrate_table[2][3][16] =
+@@ -51,6 +54,16 @@ typedef struct id3tag_disc_str
+ unsigned char genre;
+ } id3tag_disc;
+
++/* id3 v2 frame tag data */
++
++typedef struct id3v2_frame_str
++{
++ char frameid[4];
++ uint32_t size;
++ uint16_t flags;
++ char data[1024];
++ size_t datalen;
++} id3v2_frame;
+ /* id3 tags genre */
+
+ const char *genres_table[] = {
+@@ -201,20 +214,46 @@ static int is_mp3(unsigned long int flag
+ return 1;
+ }
+
++/* returns 0 if id3v2 frame found, -1 otherwise */
++
++static int read_id3v2_frame(FILE *f, id3v2_frame *frame)
++{
++ if (fread(frame->frameid, 1, 4, f) != 4 ||
++ fread(&frame->size, 1, 4, f) != 4 || fread(&frame->flags, 1, 2, f) != 2)
++ return -1;
++ frame->size = ntohl(frame->size);
++ frame->flags = ntohs(frame->flags);
++ frame->datalen = (frame->size >= sizeof(frame->data) - 1)
++ ?(sizeof(frame->data) - 1) :frame->size;
++ if (fread(frame->data, 1, frame->datalen, f) != frame->datalen)
++ return -1;
++ if (frame->frameid[0] == 'T' && memcmp(frame->frameid + 1, "XXX", 3)) {
++ frame->data[frame->datalen] = 0;
++ if (frame->data[0] == 0) /* Only handle non unicode */
++ strcpy(frame->data, frame->data + 1);
++ else
++ frame->data[0] = 0;
++ }
++ return 0;
++}
++
+ /* returns 0 if no id3v2 header, otherwise returns tag length, or -1
+ and errno set */
+
+ static int mp3_id3v2head(FILE *f)
+ {
+ char tag[3];
++ char size[4];
+ if (fseek(f, 0, SEEK_SET) == -1 || fread(tag, 1, 3, f) != 3)
+ return -1;
+
+ if (strncmp(tag, "ID3", 3))
+ return 0; /* no header */
++ if (fseek(f, 2 + 1, SEEK_CUR) == -1 || fread(size, 1, 4, f) != 4)
++ return -1;
+
+- errno = ENOSYS;
+- return -1;
++ return ID3V2HEADERLEN + size[3] + (size[2] << 7) + (size[1] << 14) +
++ (size[0] << 21);
+ }
+
+ /* determines length and bitrate of an mp3. returns -1 on failure with errno
+@@ -321,12 +360,35 @@ int mserv_mp3info_readlen(const char *fn
+ /* No ID3 tag present; last 128 bytes is music. */
+ filelen += 128;
+ }
+- fclose(f); /* ignore error */
+
+ *bitrate_ret = bitrate;
+ length = ((filelen - headerlen) / mean_frame_size ) *
+ ((115200/2) * (1+h_id(flags)) ) / fs; /* in 1/100 seconds */
++
++ /* If mp3v2 header present, read its contents */
++ if (headerlen && fseek(f, ID3V2HEADERLEN, SEEK_SET) != -1) {
++ id3v2_frame frame;
++ while (read_id3v2_frame(f, &frame) != -1) {
++ if (!memcmp(frame.frameid, "TALB", 4)) {
++ memcpy(id3tag->album, frame.data, sizeof(id3tag->album) - 1);
++ id3tag->album[sizeof(id3tag->album) - 1] = 0;
+ }
-+ newval = newval & 0xff;
- if (type == 0 || newval != curval)
- break;
- param++;
++ else if (!memcmp(frame.frameid, "TPE1", 4)) {
++ memcpy(id3tag->artist, frame.data, sizeof(id3tag->artist) - 1);
++ id3tag->artist[sizeof(id3tag->artist) - 1] = 0;
++ }
++ else if (!memcmp(frame.frameid, "TIT2", 4)) {
++ memcpy(id3tag->title, frame.data, sizeof(id3tag->title) - 1);
++ id3tag->title[sizeof(id3tag->title) - 1] = 0;
++ }
++ if (ftell(f) >= headerlen)
++ break;
++ }
++ }
++
++ fclose(f); /* ignore error */
+ return length;
++
+ error:
+ errnok = errno;
+ fclose(f); /* ignore error */
diff --git a/audio/mserv/patches/patch-aj b/audio/mserv/patches/patch-aj
index 55194d8a250..ba6e77d13c4 100644
--- a/audio/mserv/patches/patch-aj
+++ b/audio/mserv/patches/patch-aj
@@ -1,15 +1,15 @@
-$NetBSD: patch-aj,v 1.2 2002/08/02 23:01:47 abs Exp $
+$NetBSD: patch-aj,v 1.3 2002/10/03 15:46:58 abs Exp $
---- mserv/mservplay.c.orig Tue Jan 25 19:59:16 2000
-+++ mserv/mservplay.c
-@@ -14,10 +14,6 @@
- #include "defines.h"
- #include "misc.h"
+--- mserv/mp3info.h.orig Thu Oct 3 16:10:22 2002
++++ mserv/mp3info.h
+@@ -7,8 +7,8 @@
--#ifndef PATH_MPG123
--#define PATH_MPG123 "/usr/local/bin/mpg123"
--#endif
--
- int main(int argc, char *argv[])
- {
- const pid_t pid = getpid();
+ typedef struct {
+ int present:1;
+- char title[MP3ID3_TITLELEN+1];
+- char artist[MP3ID3_ARTISTLEN+1];
++ char title[NAMELEN+1];
++ char artist[AUTHORLEN+1];
+ char album[MP3ID3_ALBUMLEN+1];
+ char year[MP3ID3_YEARLEN+1];
+ char comment[MP3ID3_COMMENTLEN+1];
diff --git a/audio/mserv/patches/patch-ak b/audio/mserv/patches/patch-ak
index cbc9052e451..5db691ee103 100644
--- a/audio/mserv/patches/patch-ak
+++ b/audio/mserv/patches/patch-ak
@@ -1,15 +1,39 @@
-$NetBSD: patch-ak,v 1.1 2002/08/02 23:01:48 abs Exp $
+$NetBSD: patch-ak,v 1.2 2002/10/03 15:46:58 abs Exp $
---- mserv/opt.c.orig Thu Jul 13 22:14:41 2000
-+++ mserv/opt.c
-@@ -164,8 +164,8 @@ int opt_read(const char *root)
- /* special case - player variable is an indirected to another variable */
- if ((val = conf_getvalue("player")) == NULL) {
- if (mserv_verbose)
-- printf("No player specified, defaulting to /usr/local/bin/mpg123\n");
-- opt_player = "/usr/local/bin/mpg123";
-+ printf("No player specified, defaulting to " PATH_MPG123 "\n");
-+ opt_player = PATH_MPG123;
- } else {
- if ((opt_player = conf_getvalue(val)) == NULL) {
- fprintf(stderr, "%s: player setting '%s' not found\n", progname,
+--- mserv/mserv.c.orig Sat Jul 15 18:01:15 2000
++++ mserv/mserv.c
+@@ -2098,13 +2098,13 @@ static t_track *mserv_loadtrk(const char
+ } else {
+ if (id3tag.present) {
+ if (newinfofile) {
+- strncpy(author, id3tag.artist, AUTHORLEN);
+- author[AUTHORLEN] = '\0';
+- strncpy(name, id3tag.title, NAMELEN);
+- name[NAMELEN] = '\0';
++ strncpy(author, id3tag.artist, sizeof(id3tag.artist) - 1);
++ author[sizeof(id3tag.artist) - 1] = '\0';
++ strncpy(name, id3tag.title, sizeof(id3tag.title) - 1);
++ name[sizeof(id3tag.title) - 1] = '\0';
+ year = atoi(id3tag.year);
+- strncpy(genres, id3tag.genre, GENRESLEN);
+- genres[GENRESLEN] = '\0';
++ strncpy(genres, id3tag.genre, sizeof(id3tag.genre) - 1);
++ genres[sizeof(id3tag.genre) - 1] = '\0';
+ mserv_strtoprintable(author);
+ mserv_strtoprintable(name);
+ mserv_strtoprintable(genres);
+@@ -3370,7 +3370,13 @@ int mserv_setmixer(t_client *cl, int wha
+ mserv_response(cl, "IOCTLWR", NULL);
+ return -1;
+ }
+- newval = newval & 0xFF;
++ if (ioctl(mixer_fd, MIXER_READ(what), &newval) == -1) {
++ close(mixer_fd);
++ perror("iotcl read");
++ mserv_response(cl, "IOCTLRD", 0);
++ return -1;
++ }
++ newval = newval & 0xff;
+ if (type == 0 || newval != curval)
+ break;
+ param++;
diff --git a/audio/mserv/patches/patch-al b/audio/mserv/patches/patch-al
new file mode 100644
index 00000000000..3c4dc7638fe
--- /dev/null
+++ b/audio/mserv/patches/patch-al
@@ -0,0 +1,15 @@
+$NetBSD: patch-al,v 1.1 2002/10/03 15:46:58 abs Exp $
+
+--- mserv/mservplay.c.orig Tue Jan 25 19:59:16 2000
++++ mserv/mservplay.c
+@@ -14,10 +14,6 @@
+ #include "defines.h"
+ #include "misc.h"
+
+-#ifndef PATH_MPG123
+-#define PATH_MPG123 "/usr/local/bin/mpg123"
+-#endif
+-
+ int main(int argc, char *argv[])
+ {
+ const pid_t pid = getpid();
diff --git a/audio/mserv/patches/patch-am b/audio/mserv/patches/patch-am
new file mode 100644
index 00000000000..8f59fe8f40e
--- /dev/null
+++ b/audio/mserv/patches/patch-am
@@ -0,0 +1,15 @@
+$NetBSD: patch-am,v 1.1 2002/10/03 15:46:59 abs Exp $
+
+--- mserv/opt.c.orig Thu Jul 13 22:14:41 2000
++++ mserv/opt.c
+@@ -164,8 +164,8 @@ int opt_read(const char *root)
+ /* special case - player variable is an indirected to another variable */
+ if ((val = conf_getvalue("player")) == NULL) {
+ if (mserv_verbose)
+- printf("No player specified, defaulting to /usr/local/bin/mpg123\n");
+- opt_player = "/usr/local/bin/mpg123";
++ printf("No player specified, defaulting to " PATH_MPG123 "\n");
++ opt_player = PATH_MPG123;
+ } else {
+ if ((opt_player = conf_getvalue(val)) == NULL) {
+ fprintf(stderr, "%s: player setting '%s' not found\n", progname,