head 1.11; access; symbols pkgsrc-2026Q1:1.11.0.32 pkgsrc-2026Q1-base:1.11 pkgsrc-2025Q4:1.11.0.30 pkgsrc-2025Q4-base:1.11 pkgsrc-2025Q3:1.11.0.28 pkgsrc-2025Q3-base:1.11 pkgsrc-2025Q2:1.11.0.26 pkgsrc-2025Q2-base:1.11 pkgsrc-2025Q1:1.11.0.24 pkgsrc-2025Q1-base:1.11 pkgsrc-2024Q4:1.11.0.22 pkgsrc-2024Q4-base:1.11 pkgsrc-2024Q3:1.11.0.20 pkgsrc-2024Q3-base:1.11 pkgsrc-2024Q2:1.11.0.18 pkgsrc-2024Q2-base:1.11 pkgsrc-2024Q1:1.11.0.16 pkgsrc-2024Q1-base:1.11 pkgsrc-2023Q4:1.11.0.14 pkgsrc-2023Q4-base:1.11 pkgsrc-2023Q3:1.11.0.12 pkgsrc-2023Q3-base:1.11 pkgsrc-2023Q2:1.11.0.10 pkgsrc-2023Q2-base:1.11 pkgsrc-2023Q1:1.11.0.8 pkgsrc-2023Q1-base:1.11 pkgsrc-2022Q4:1.11.0.6 pkgsrc-2022Q4-base:1.11 pkgsrc-2022Q3:1.11.0.4 pkgsrc-2022Q3-base:1.11 pkgsrc-2022Q2:1.11.0.2 pkgsrc-2022Q2-base:1.11 pkgsrc-2022Q1:1.10.0.82 pkgsrc-2022Q1-base:1.10 pkgsrc-2021Q4:1.10.0.80 pkgsrc-2021Q4-base:1.10 pkgsrc-2021Q3:1.10.0.78 pkgsrc-2021Q3-base:1.10 pkgsrc-2021Q2:1.10.0.76 pkgsrc-2021Q2-base:1.10 pkgsrc-2021Q1:1.10.0.74 pkgsrc-2021Q1-base:1.10 pkgsrc-2020Q4:1.10.0.72 pkgsrc-2020Q4-base:1.10 pkgsrc-2020Q3:1.10.0.70 pkgsrc-2020Q3-base:1.10 pkgsrc-2020Q2:1.10.0.66 pkgsrc-2020Q2-base:1.10 pkgsrc-2020Q1:1.10.0.46 pkgsrc-2020Q1-base:1.10 pkgsrc-2019Q4:1.10.0.68 pkgsrc-2019Q4-base:1.10 pkgsrc-2019Q3:1.10.0.64 pkgsrc-2019Q3-base:1.10 pkgsrc-2019Q2:1.10.0.62 pkgsrc-2019Q2-base:1.10 pkgsrc-2019Q1:1.10.0.60 pkgsrc-2019Q1-base:1.10 pkgsrc-2018Q4:1.10.0.58 pkgsrc-2018Q4-base:1.10 pkgsrc-2018Q3:1.10.0.56 pkgsrc-2018Q3-base:1.10 pkgsrc-2018Q2:1.10.0.54 pkgsrc-2018Q2-base:1.10 pkgsrc-2018Q1:1.10.0.52 pkgsrc-2018Q1-base:1.10 pkgsrc-2017Q4:1.10.0.50 pkgsrc-2017Q4-base:1.10 pkgsrc-2017Q3:1.10.0.48 pkgsrc-2017Q3-base:1.10 pkgsrc-2017Q2:1.10.0.44 pkgsrc-2017Q2-base:1.10 pkgsrc-2017Q1:1.10.0.42 pkgsrc-2017Q1-base:1.10 pkgsrc-2016Q4:1.10.0.40 pkgsrc-2016Q4-base:1.10 pkgsrc-2016Q3:1.10.0.38 pkgsrc-2016Q3-base:1.10 pkgsrc-2016Q2:1.10.0.36 pkgsrc-2016Q2-base:1.10 pkgsrc-2016Q1:1.10.0.34 pkgsrc-2016Q1-base:1.10 pkgsrc-2015Q4:1.10.0.32 pkgsrc-2015Q4-base:1.10 pkgsrc-2015Q3:1.10.0.30 pkgsrc-2015Q3-base:1.10 pkgsrc-2015Q2:1.10.0.28 pkgsrc-2015Q2-base:1.10 pkgsrc-2015Q1:1.10.0.26 pkgsrc-2015Q1-base:1.10 pkgsrc-2014Q4:1.10.0.24 pkgsrc-2014Q4-base:1.10 pkgsrc-2014Q3:1.10.0.22 pkgsrc-2014Q3-base:1.10 pkgsrc-2014Q2:1.10.0.20 pkgsrc-2014Q2-base:1.10 pkgsrc-2014Q1:1.10.0.18 pkgsrc-2014Q1-base:1.10 pkgsrc-2013Q4:1.10.0.16 pkgsrc-2013Q4-base:1.10 pkgsrc-2013Q3:1.10.0.14 pkgsrc-2013Q3-base:1.10 pkgsrc-2013Q2:1.10.0.12 pkgsrc-2013Q2-base:1.10 pkgsrc-2013Q1:1.10.0.10 pkgsrc-2013Q1-base:1.10 pkgsrc-2012Q4:1.10.0.8 pkgsrc-2012Q4-base:1.10 pkgsrc-2012Q3:1.10.0.6 pkgsrc-2012Q3-base:1.10 pkgsrc-2012Q2:1.10.0.4 pkgsrc-2012Q2-base:1.10 pkgsrc-2012Q1:1.10.0.2 pkgsrc-2012Q1-base:1.10 pkgsrc-2011Q4:1.9.0.64 pkgsrc-2011Q4-base:1.9 pkgsrc-2011Q3:1.9.0.62 pkgsrc-2011Q3-base:1.9 pkgsrc-2011Q2:1.9.0.60 pkgsrc-2011Q2-base:1.9 pkgsrc-2011Q1:1.9.0.58 pkgsrc-2011Q1-base:1.9 pkgsrc-2010Q4:1.9.0.56 pkgsrc-2010Q4-base:1.9 pkgsrc-2010Q3:1.9.0.54 pkgsrc-2010Q3-base:1.9 pkgsrc-2010Q2:1.9.0.52 pkgsrc-2010Q2-base:1.9 pkgsrc-2010Q1:1.9.0.50 pkgsrc-2010Q1-base:1.9 pkgsrc-2009Q4:1.9.0.48 pkgsrc-2009Q4-base:1.9 pkgsrc-2009Q3:1.9.0.46 pkgsrc-2009Q3-base:1.9 pkgsrc-2009Q2:1.9.0.44 pkgsrc-2009Q2-base:1.9 pkgsrc-2009Q1:1.9.0.42 pkgsrc-2009Q1-base:1.9 pkgsrc-2008Q4:1.9.0.40 pkgsrc-2008Q4-base:1.9 pkgsrc-2008Q3:1.9.0.38 pkgsrc-2008Q3-base:1.9 cube-native-xorg:1.9.0.36 cube-native-xorg-base:1.9 pkgsrc-2008Q2:1.9.0.34 pkgsrc-2008Q2-base:1.9 cwrapper:1.9.0.32 pkgsrc-2008Q1:1.9.0.30 pkgsrc-2008Q1-base:1.9 pkgsrc-2007Q4:1.9.0.28 pkgsrc-2007Q4-base:1.9 pkgsrc-2007Q3:1.9.0.26 pkgsrc-2007Q3-base:1.9 pkgsrc-2007Q2:1.9.0.24 pkgsrc-2007Q2-base:1.9 pkgsrc-2007Q1:1.9.0.22 pkgsrc-2007Q1-base:1.9 pkgsrc-2006Q4:1.9.0.20 pkgsrc-2006Q4-base:1.9 pkgsrc-2006Q3:1.9.0.18 pkgsrc-2006Q3-base:1.9 pkgsrc-2006Q2:1.9.0.16 pkgsrc-2006Q2-base:1.9 pkgsrc-2006Q1:1.9.0.14 pkgsrc-2006Q1-base:1.9 pkgsrc-2005Q4:1.9.0.12 pkgsrc-2005Q4-base:1.9 pkgsrc-2005Q3:1.9.0.10 pkgsrc-2005Q3-base:1.9 pkgsrc-2005Q2:1.9.0.8 pkgsrc-2005Q2-base:1.9 pkgsrc-2005Q1:1.9.0.6 pkgsrc-2005Q1-base:1.9 pkgsrc-2004Q4:1.9.0.4 pkgsrc-2004Q4-base:1.9 pkgsrc-2004Q3:1.9.0.2 pkgsrc-2004Q3-base:1.9 pkgsrc-2004Q2:1.8.0.4 pkgsrc-2004Q2-base:1.8 pkgsrc-2004Q1:1.8.0.2 pkgsrc-2004Q1-base:1.8 pkgsrc-2003Q4:1.7.0.2 pkgsrc-2003Q4-base:1.7 netbsd-1-6-1:1.4.0.2 netbsd-1-6-1-base:1.4 netbsd-1-6:1.3.0.4 netbsd-1-6-RELEASE-base:1.3 pkgviews:1.1.0.4 pkgviews-base:1.1 buildlink2-base:1.1 buildlink2:1.1.0.2; locks; strict; comment @# @; 1.11 date 2022.06.06.12.12.47; author martin; state Exp; branches; next 1.10; commitid PaSMqvuWsGDhxYGD; 1.10 date 2012.02.07.09.44.22; author martin; state Exp; branches; next 1.9; 1.9 date 2004.09.12.05.08.28; author minskim; state Exp; branches; next 1.8; 1.8 date 2004.02.20.00.41.16; author abs; state Exp; branches; next 1.7; 1.7 date 2003.09.03.19.55.28; author abs; state Exp; branches; next 1.6; 1.6 date 2003.09.03.12.35.13; author martin; state Exp; branches; next 1.5; 1.5 date 2003.06.07.11.06.14; author abs; state Exp; branches; next 1.4; 1.4 date 2002.10.03.15.46.57; author abs; state Exp; branches; next 1.3; 1.3 date 2002.08.02.23.01.47; author abs; state Exp; branches; next 1.2; 1.2 date 2002.07.31.14.02.45; author abs; state Exp; branches; next 1.1; 1.1 date 2002.06.14.20.04.08; author abs; state Exp; branches 1.1.2.1; next ; 1.1.2.1 date 2002.06.14.20.04.08; author jlam; state dead; branches; next 1.1.2.2; 1.1.2.2 date 2002.06.23.18.39.00; author jlam; state Exp; branches; next ; desc @@ 1.11 log @Fix handling of 64bit time_t on 32bit archs @ text @$NetBSD: patch-af,v 1.10 2012/02/07 09:44:22 martin Exp $ --- mserv/mserv.c.orig 2003-08-03 16:57:20.000000000 +0200 +++ mserv/mserv.c 2012-02-07 10:39:02.000000000 +0100 @@@@ -62,12 +62,27 @@@@ met: #include #include +#ifdef PARSE_OGG_INFO +#include +#include +#endif + #include "mserv.h" + +#ifdef HAVE_INTTYPES_H +#include +#define TIME_T_PRI_CAST uint64_t +#define TIME_T_PRI PRIu64 +#else +#define TIME_T_PRI_CAST unsigned long +#define TIME_T_PRI "lu" +#endif + #include "misc.h" #include "cmd.h" #include "acl.h" #include "mp3info.h" -#include "soundcard.h" +#include "mservsoundcard.h" #include "defconf.h" #include "conf.h" #include "opt.h" @@@@ -79,6 +94,13 @@@@ met: # define MIN(X,Y) (((X) < (Y)) ? (X) : (Y)) #endif +#ifndef HAVE_STRLCPY +#define strlcpy strncpy +#endif +#ifndef HAVE_STRTOUMAX +#define strtoumax strtoul +#endif + extern char *optarg; extern int optind; /* extern int getopt(int, char *const *, const char *); */ /* sunos ;( */ @@@@ -131,7 +153,8 @@@@ static void mserv_vresponse(t_client *cl static void mserv_scandir(void); static void mserv_scandir_recurse(const char *pathname); static t_track *mserv_loadtrk(const char *filename); -static t_album *mserv_loadalbum(const char *filename, int onlyifexists); +static t_album *mserv_loadalbum(const char *filename, int onlyifexists, + const char *default_author); static int album_insertsort(t_album *album); static t_author *mserv_authorlist(void); static int author_insertsort(t_author **list, t_author *author); @@@@ -224,7 +247,7 @@@@ int main(int argc, char *argv[]) int i; struct protoent *protocol; struct sockaddr_in sin; - int so_int; + int so_int, proto; int flags; char *mserv_root = NULL; char *mserv_conf = NULL; @@@@ -292,7 +315,7 @@@@ int main(int argc, char *argv[]) ps->pw_dir[strlen(ps->pw_dir)-1] == '/' ? "" : "/"); } else { /* copy out of environment */ - if ((m = malloc(strlen(mserv_root))) == NULL) { + if ((m = malloc(strlen(mserv_root)+1)) == NULL) { fprintf(stderr, "%s: out of memory\n", progname); exit(1); } @@@@ -305,7 +328,7 @@@@ int main(int argc, char *argv[]) l--; mserv_root[l] = '\0'; if (!mserv_conf) { - if ((m = malloc(strlen(mserv_root)+sizeof("/config"))) == NULL) { + if ((m = malloc(strlen(mserv_root)+sizeof("/config")+1)) == NULL) { fprintf(stderr, "%s: out of memory\n", progname); exit(1); } @@@@ -427,8 +450,13 @@@@ int main(int argc, char *argv[]) if (mserv_verbose && mserv_port) printf("Port set via command line options to %d\n", mserv_port); + protocol = getprotobyname("IP"); - mserv_socket = socket(AF_INET, SOCK_STREAM, protocol->p_proto); + if (protocol) + proto = protocol->p_proto; + else + proto = IPPROTO_IP; + mserv_socket = socket(AF_INET, SOCK_STREAM, proto); if (mserv_socket == -1) { mserv_log("Socket error '%s'", strerror(errno)); mserv_closedown(1); @@@@ -1624,6 +1652,7 @@@@ static void mserv_scandir_recurse(const int i; t_album *album; int flag = 0; + const char *default_author = 0; /* pathname is "" or "directory/" or "directory/directory/..." */ @@@@ -1686,22 +1715,32 @@@@ static void mserv_scandir_recurse(const toomany = 1; break; } + if (mserv_verbose) mserv_log("Track file: %s", fullpath); if ((tracks[tnum] = mserv_loadtrk(filename)) == NULL) { mserv_log("Unable to add track '%s'", fullpath); } else { + + if (default_author == 0) + default_author = tracks[tnum]->author; + else if (default_author != (const char *)-1 && strcmp(default_author, + tracks[tnum]->author)) + default_author = (const char *)-1; + tracks[tnum]->id = mserv_nextid_track++; tracks[tnum]->n_album = mserv_nextid_album; tracks[tnum]->n_track = tnum+1; tracks[tnum]->next = mserv_tracks; mserv_tracks = tracks[tnum++]; } + flag = 1; /* there is at least one track in this directory */ } closedir(dir); /* load album, but only if there is an album file or flag is set */ - if ((album = mserv_loadalbum(pathname, flag ? 0 : 1)) == NULL) + if ((album = mserv_loadalbum(pathname, flag ? 0 : 1, + (default_author == (const char *)-1) ?0 :default_author)) == NULL) return; qsort(tracks, TRACKSPERALBUM, sizeof(t_track *), mserv_trackcompare_filename); @@@@ -1815,7 +1854,7 @@@@ static int mserv_trackcompare_rating(con } } -static t_album *mserv_loadalbum(const char *filename, int onlyifexists) +static t_album *mserv_loadalbum(const char *filename, int onlyifexists, const char *default_author) { FILE *fd; char fullpath[MAXFNAME]; @@@@ -1899,8 +1938,13 @@@@ static t_album *mserv_loadalbum(const ch return NULL; mtime = time(NULL); } - if (!*author) - strcpy(author, "!-Unindexed"); + if (!*author) { + if (default_author) + strcpy(author, default_author); + else + strcpy(author, "!-Unindexed"); + } + if (!*name) { if (!*filename || !*(filename+1)) { strcpy(name, "rootdir"); @@@@ -2019,11 +2063,13 @@@@ static t_track *mserv_loadtrk(const char alen = strlen(buffer); if (buffer[alen-1] != '\n') { mserv_log("Line %d too long in '%s'", line, fullpath_trk); + fclose(fd); return NULL; } buffer[--alen] = '\0'; if (!(l = strcspn(buffer, "=")) || l >= 64) { mserv_log("Invalid track line %d in '%s'", line, fullpath_trk); + fclose(fd); return NULL; } strncpy(token, buffer, l); @@@@ -2043,7 +2089,7 @@@@ static t_track *mserv_loadtrk(const char /* ignore old line */ modified = 1; } else if (!stricmp(token, "_lastplay")) { - lastplay = atol(value); + lastplay = (time_t)strtoumax(value, NULL, 10); } else if (!stricmp(token, "_duration")) { duration = atol(value); } else if (!stricmp(token, "_miscinfo")) { @@@@ -2059,6 +2105,7 @@@@ static t_track *mserv_loadtrk(const char } if ((arate = malloc(sizeof(t_rating)+strlen(token)+1)) == NULL) { mserv_log("Out of memory creating ratings for '%s'", fullpath_trk); + fclose(fd); return NULL; } memset(arate, 0, sizeof(t_rating)); @@@@ -2082,15 +2129,18 @@@@ static t_track *mserv_loadtrk(const char } if (!*author) { mserv_log("No author specified in '%s'", fullpath_trk); + fclose(fd); return NULL; } if (!*name) { mserv_log("No name specified in '%s'", fullpath_trk); + fclose(fd); return NULL; } if (fstat(fileno(fd), &buf) == -1) { perror("fstat"); mserv_log("Unable to stat '%s': %s", filename, strerror(errno)); + fclose(fd); return NULL; } mtime = buf.st_mtime; @@@@ -2098,8 +2148,17 @@@@ static t_track *mserv_loadtrk(const char } if (duration == 0 && !*miscinfo) { len = strlen(fullpath_file); +#ifdef PARSE_OGG_INFO + if (len > 4 && !stricmp(".mp3", fullpath_file+len-4) || + !stricmp(".ogg", fullpath_file+len-4)) { + if (!stricmp(".mp3", fullpath_file+len-4)) + duration = mserv_mp3info_readlen(fullpath_file, &bitrate, &id3tag); + else + duration = mserv_ogginfo_readlen(fullpath_file, &bitrate, &id3tag); +#else if (len > 4 && !stricmp(".mp3", fullpath_file+len-4)) { duration = mserv_mp3info_readlen(fullpath_file, &bitrate, &id3tag); +#endif if (duration == -1) { mserv_log("Unable to determine details of mp3 '%s': %s", filename, strerror(errno)); @@@@ -2719,7 +2778,7 @@@@ t_album *mserv_checkdisk_album(t_album * } if (buf.st_mtime == album->mtime) return album; - if ((newalbum = mserv_loadalbum(album->filename, 1)) == NULL) { + if ((newalbum = mserv_loadalbum(album->filename, 1, 0)) == NULL) { mserv_log("Unable to re-load '%s'", album->filename); return album; } @@@@ -2762,7 +2821,7 @@@@ int mserv_savechanges(void) fprintf(fd, "_name=%s\n", track->name); fprintf(fd, "_year=%d\n", track->year); fprintf(fd, "_genres=%s\n", track->genres); - fprintf(fd, "_lastplay=%lu\n", (unsigned long int)track->lastplay); + fprintf(fd, "_lastplay=%" TIME_T_PRI "\n", (TIME_T_PRI_CAST)track->lastplay); fprintf(fd, "_duration=%lu\n", track->duration); fprintf(fd, "_miscinfo=%s\n", track->miscinfo); for (rate = track->ratings; rate; rate = rate->next) { @@@@ -3430,3 +3489,59 @@@@ int mserv_setmixer(t_client *cl, int wha } #endif + +#ifdef PARSE_OGG_INFO +int mserv_ogginfo_readlen(const char *fname, int *bitrate_ret, + t_id3tag *id3tag) +{ + OggVorbis_File vf; + FILE *f; + ogg_sync_state sync; + vorbis_info *vi; + vorbis_comment *vc; + char **comment; + double duration; + + if (id3tag) + memset(id3tag, 0, sizeof(*id3tag)); + + if ((f = fopen(fname, "rb")) == NULL) + return -1; + + if (ov_open(f, &vf, NULL, 0) < 0) { + fclose(f); + return -1; + } + + if ( !(vi = ov_info(&vf, -1)) || !(vc = ov_comment(&vf, -1))) { + ov_clear(&vf); + fclose(f); + return -1; + } + + if (bitrate_ret) + *bitrate_ret = vi->bitrate_nominal/1024; + + for (comment = vc->user_comments ; *comment ; ++comment) { + if (strncasecmp(*comment, "title=", 6) == 0) { + strlcpy(id3tag->title, *comment + 6, MP3ID3_TITLELEN+1); + id3tag->present = 1; + } + else if (strncasecmp(*comment, "artist=", 7) == 0) + strlcpy(id3tag->artist, *comment + 7, MP3ID3_ARTISTLEN+1); + else if (strncasecmp(*comment, "album=", 6) == 0) + strlcpy(id3tag->album, *comment + 6, MP3ID3_ALBUMLEN+1); + else if (strncasecmp(*comment, "date=", 5) == 0) + strlcpy(id3tag->year, *comment + 5, MP3ID3_YEARLEN+1); + else if (strncasecmp(*comment, "genre=", 6) == 0) + strlcpy(id3tag->genre, *comment + 6, 31); + /* tracknumber ignored */ + } + + duration = ov_time_total(&vf, -1); + ov_clear(&vf); + fclose(f); + return (int)duration * 100; +} + +#endif @ 1.10 log @Avoid a crash if getprotobyname("IP") does return NULL. @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.9 2004/09/12 05:08:28 minskim Exp $ d5 1 a5 1 @@@@ -62,12 +62,17 @@@@ d15 10 d34 1 a34 1 @@@@ -79,6 +84,10 @@@@ d41 3 d48 1 a48 1 @@@@ -131,7 +140,8 @@@@ d58 1 a58 1 @@@@ -224,7 +234,7 @@@@ d67 1 a67 1 @@@@ -292,7 +302,7 @@@@ d76 1 a76 1 @@@@ -305,7 +315,7 @@@@ d85 1 a85 1 @@@@ -427,8 +437,13 @@@@ d100 1 a100 1 @@@@ -1624,6 +1639,7 @@@@ d108 1 a108 1 @@@@ -1686,22 +1702,32 @@@@ d142 1 a142 1 @@@@ -1815,7 +1841,7 @@@@ d151 1 a151 1 @@@@ -1899,8 +1925,13 @@@@ d167 1 a167 1 @@@@ -2019,11 +2050,13 @@@@ d181 10 a190 1 @@@@ -2059,6 +2092,7 @@@@ d198 1 a198 1 @@@@ -2082,15 +2116,18 @@@@ d217 1 a217 1 @@@@ -2098,8 +2135,17 @@@@ d235 1 a235 1 @@@@ -2719,7 +2765,7 @@@@ d244 10 a253 1 @@@@ -3430,3 +3476,59 @@@@ @ 1.9 log @Make this package build on Linux by using strncpy() when strlcpy() is not available. @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 3 --- mserv/mserv.c.orig 2003-08-03 09:57:20.000000000 -0500 +++ mserv/mserv.c @@@@ -62,12 +62,17 @@@@ met: d24 1 a24 1 @@@@ -79,6 +84,10 @@@@ met: d35 1 a35 1 @@@@ -131,7 +140,8 @@@@ static void mserv_vresponse(t_client *cl d45 10 a54 1 @@@@ -292,7 +302,7 @@@@ int main(int argc, char *argv[]) d63 1 a63 1 @@@@ -305,7 +315,7 @@@@ int main(int argc, char *argv[]) d72 16 a87 1 @@@@ -1624,6 +1634,7 @@@@ static void mserv_scandir_recurse(const d95 1 a95 1 @@@@ -1686,22 +1697,32 @@@@ static void mserv_scandir_recurse(const d129 1 a129 1 @@@@ -1815,7 +1836,7 @@@@ static int mserv_trackcompare_rating(con d138 1 a138 1 @@@@ -1899,8 +1920,13 @@@@ static t_album *mserv_loadalbum(const ch d154 1 a154 1 @@@@ -2019,11 +2045,13 @@@@ static t_track *mserv_loadtrk(const char d168 1 a168 1 @@@@ -2059,6 +2087,7 @@@@ static t_track *mserv_loadtrk(const char d176 1 a176 1 @@@@ -2082,15 +2111,18 @@@@ static t_track *mserv_loadtrk(const char d195 1 a195 1 @@@@ -2098,8 +2130,17 @@@@ static t_track *mserv_loadtrk(const char d213 1 a213 1 @@@@ -2719,7 +2760,7 @@@@ t_album *mserv_checkdisk_album(t_album * d222 1 a222 1 @@@@ -3430,3 +3471,59 @@@@ int mserv_setmixer(t_client *cl, int wha @ 1.8 log @Update mserv to 0.35nb8: Fix parsing of ID3v1 data, fix some off by one malloc()s and default album author to tracks' author. @ text @d3 1 a3 1 --- mserv/mserv.c.orig Sun Aug 3 15:57:20 2003 d24 12 a35 1 @@@@ -131,7 +136,8 @@@@ static void mserv_vresponse(t_client *cl d45 1 a45 1 @@@@ -292,7 +298,7 @@@@ int main(int argc, char *argv[]) d54 1 a54 1 @@@@ -305,7 +311,7 @@@@ int main(int argc, char *argv[]) d63 1 a63 1 @@@@ -1624,6 +1630,7 @@@@ static void mserv_scandir_recurse(const d71 1 a71 1 @@@@ -1686,22 +1693,32 @@@@ static void mserv_scandir_recurse(const d105 1 a105 1 @@@@ -1815,7 +1832,7 @@@@ static int mserv_trackcompare_rating(con d114 1 a114 1 @@@@ -1899,8 +1916,13 @@@@ static t_album *mserv_loadalbum(const ch d130 1 a130 1 @@@@ -2019,11 +2041,13 @@@@ static t_track *mserv_loadtrk(const char d144 1 a144 1 @@@@ -2059,6 +2083,7 @@@@ static t_track *mserv_loadtrk(const char d152 1 a152 1 @@@@ -2082,15 +2107,18 @@@@ static t_track *mserv_loadtrk(const char d171 1 a171 1 @@@@ -2098,8 +2126,17 @@@@ static t_track *mserv_loadtrk(const char d189 1 a189 1 @@@@ -2719,7 +2756,7 @@@@ t_album *mserv_checkdisk_album(t_album * d198 4 a201 7 @@@@ -3427,6 +3464,62 @@@@ int mserv_setmixer(t_client *cl, int wha close(mixer_fd); mserv_response(cl, "NAN", NULL); return -1; +} + +#endif d255 3 a257 3 } #endif @ 1.7 log @Update mserv to 0.35nb1 Fix english.lang install location Install mservedit Add INSTALL and LICENSE to PLIST Fix config 'player_ogg=prog_ogg' -> 'player_ogg=prog_ogg123' Add PARSE_OGG_INFO @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.6 2003/09/03 12:35:13 martin Exp $ d3 5 a7 4 --- mserv/defconf.c.orig 2003-08-04 20:25:36.000000000 +0200 +++ mserv/defconf.c 2003-09-03 13:44:02.000000000 +0200 @@@@ -1,54 +1,53 @@@@ #include "defines.h" d9 48 a56 99 -const char defconf_file[] = "# Mserv configuration file for 0.33 and later\n\ -\n\ -# File locations, / at start is absolute, otherwise relative to mserv root\n\ -path_acl=acl\n\ -path_webacl=webacl\n\ -path_logfile=log\n\ -path_tracks=tracks\n\ -path_trackinfo=trackinfo\n\ -path_playout=player.out\n\ -path_idea=idea\n\ -path_mixer=/dev/mixer\n\ -path_language=" DATADIR "/english.lang\n\ -\n\ -# Define player invokation methods\n\ -# mservplay is our special wrapper, the first parameter is a 'nice' level\n\ -# play is part of sox\n\ -prog_mpg123=/usr/local/bin/mpg123 -b 1024\n\ -prog_freeamp=/usr/local/bin/freeamp -ui mpg123\n\ -prog_mservplay=/usr/local/bin/mservplay 0 mpg123 -b 1024\n\ -prog_play=/usr/local/bin/play\n\ -prog_ogg123=/usr/local/bin/ogg123\n\ -\n\ -# Set players for each file extension we want to support, unknown extensions\n\ -# are ignored by mserv\n\ -player_mp3=prog_mpg123\n\ -player_wav=prog_play\n\ -player_au=prog_play\n\ -player_ogg=prog_ogg\n\ -\n\ -# Set default random mode, either on or off. You must still tell mserv to\n\ -# start playing (PLAY).\n\ -random=off\n\ -\n\ -# Set whether or not you would like play to start as soon as mserv has loaded.\n\ -play=off\n\ -\n\ -# Set default random factor, 0.5 is completely random, 0.6 is less random\n\ -# and takes into account your ratings, 0.4 plays your worst tunes. 0.99 max.\n\ -factor=0.60\n\ -\n\ -# Set default filter, leave blank for off. Example: \"!classical\" to\n\ -# not play classical genre, or \"year>=1980&year<1990\" to only play\n\ -# 80's songs.\n\ -filter=\n\ -\n\ -# Set gap between songs, in seconds. 0 to start the next song as quick as\n\ -# possible.\n\ -gap=1\n\ -\n\ -"; +const char defconf_file[] = "# Mserv configuration file for 0.33 and later\n" +"\n" +"# File locations, / at start is absolute, otherwise relative to mserv root\n" +"path_acl=acl\n" +"path_webacl=webacl\n" +"path_logfile=log\n" +"path_tracks=tracks\n" +"path_trackinfo=trackinfo\n" +"path_playout=player.out\n" +"path_idea=idea\n" +"path_mixer=/dev/mixer\n" +"path_language=" DATADIR "/english.lang\n" +"\n" +"# Define player invokation methods\n" +"# mservplay is our special wrapper, the first parameter is a 'nice' level\n" +"# play is part of sox\n" +"prog_mpg123=" PATH_MPG123 " -b 1024\n" +"prog_freeamp=/usr/local/bin/freeamp -ui " PATH_MPG123 "\n" +"prog_mservplay=/usr/local/bin/mservplay 0 " PATH_MPG123 " -b 1024\n" +"prog_play=/usr/local/bin/play\n" +"prog_ogg123=/usr/local/bin/ogg123\n" +"\n" +"# Set players for each file extension we want to support, unknown extensions\n" +"# are ignored by mserv\n" +"player_mp3=prog_mpg123\n" +"player_wav=prog_play\n" +"player_au=prog_play\n" +"player_ogg=prog_ogg123\n" +"\n" +"# Set default random mode, either on or off. You must still tell mserv to\n" +"# start playing (PLAY).\n" +"random=off\n" +"\n" +"# Set whether or not you would like play to start as soon as mserv has loaded.\n" +"play=off\n" +"\n" +"# Set default random factor, 0.5 is completely random, 0.6 is less random\n" +"# and takes into account your ratings, 0.4 plays your worst tunes. 0.99 max.\n" +"factor=0.60\n" +"\n" +"# Set default filter, leave blank for off. Example: \"!classical\" to\n" +"# not play classical genre, or \"year>=1980&year<1990\" to only play\n" +"# 80's songs.\n" +"filter=\n" +"\n" +"# Set gap between songs, in seconds. 0 to start the next song as quick as\n" +"# possible.\n" +"gap=1\n" +"\n"; d58 192 a249 1 unsigned int defconf_size = sizeof(defconf_file)-1; @ 1.6 log @Update to mserv-0.35. Most previus patches have been integrated, various fixes. This version is compatible with a new nifty win32 gui client, see the homepage for links. @ text @d1 1 a1 1 $NetBSD$ d85 1 a85 1 +"player_ogg=prog_ogg\n" @ 1.5 log @Escape newlines in literal string for gcc3. No change to compiled package. @ text @d3 3 a5 3 --- mserv/defconf.c.orig Thu Jul 13 22:20:42 2000 +++ mserv/defconf.c @@@@ -1,47 +1,47 @@@@ d8 99 a106 85 -const char defconf_file[] = "# Mserv configuration file for 0.30 and later - -# File locations, / at start is absolute, otherwise relative to mserv root -path_acl=acl -path_webacl=webacl -path_logfile=log -path_tracks=tracks -path_trackinfo=trackinfo -path_playout=player.out -path_idea=idea -path_mixer=/dev/mixer -path_language=" SHAREDIR "/english.lang - -# Define player invokation methods -# mservplay is our special wrapper, the first parameter is a 'nice' level -mpg123=/usr/local/bin/mpg123 -b 1024 -freeamp=/usr/local/bin/freeamp -ui mpg123 -mservplay=/usr/local/bin/mservplay 0 mpg123 -b 1024 - -# Set default player from list above -player=mpg123 - -# Set default random mode, either on or off. You must still tell mserv to -# start playing (PLAY). -random=off - -# Set whether or not you would like play to start as soon as mserv has loaded. -play=off - -# Set default random factor, 0.5 is completely random, 0.6 is less random -# and takes into account your ratings, 0.4 plays your worst tunes. 0.99 max. -factor=0.60 - -# Set default filter, leave blank for off. Example: \"!classical\" to -# not play classical genre, or \"year>=1980&year<1990\" to only play -# 80's songs. -filter= - -# Set gap between songs, in seconds. 0 to start the next song as quick as -# possible. -gap=1 - +const char defconf_file[] = "# Mserv configuration file for 0.30 and later\n\ +\n\ +# File locations, / at start is absolute, otherwise relative to mserv root\n\ +path_acl=acl\n\ +path_webacl=webacl\n\ +path_logfile=log\n\ +path_tracks=tracks\n\ +path_trackinfo=trackinfo\n\ +path_playout=player.out\n\ +path_idea=idea\n\ +path_mixer=/dev/mixer\n\ +path_language=" SHAREDIR "/english.lang\n\ +\n\ +# Define player invokation methods\n\ +# mservplay is our special wrapper, the first parameter is a 'nice' level\n\ +mpg123=" PATH_MPG123 " -b 1024\n\ +freeamp=/usr/local/bin/freeamp -ui mpg123\n\ +mservplay=/usr/local/bin/mservplay 0 mpg123 -b 1024\n\ +\n\ +# Set default player from list above\n\ +player=mpg123\n\ +\n\ +# Set default random mode, either on or off. You must still tell mserv to\n\ +# start playing (PLAY).\n\ +random=off\n\ +\n\ +# Set whether or not you would like play to start as soon as mserv has loaded.\n\ +play=off\n\ +\n\ +# Set default random factor, 0.5 is completely random, 0.6 is less random\n\ +# and takes into account your ratings, 0.4 plays your worst tunes. 0.99 max.\n\ +factor=0.60\n\ +\n\ +# Set default filter, leave blank for off. Example: \"!classical\" to\n\ +# not play classical genre, or \"year>=1980&year<1990\" to only play\n\ +# 80's songs.\n\ +filter=\n\ +\n\ +# Set gap between songs, in seconds. 0 to start the next song as quick as\n\ +# possible.\n\ +gap=1\n\ +\n\ "; @ 1.4 log @Update mserv to mserv-0.33nb5: Correctly parse ID3V2 headers. @ text @d5 2 a6 1 @@@@ -15,7 +15,7 @@@@ path_language=" SHAREDIR "/english.lang d8 15 a22 2 # Define player invokation methods # mservplay is our special wrapper, the first parameter is a 'nice' level d24 69 a92 3 +mpg123=" PATH_MPG123 " -b 1024 freeamp=/usr/local/bin/freeamp -ui mpg123 mservplay=/usr/local/bin/mservplay 0 mpg123 -b 1024 d94 1 @ 1.3 log @Updated mserv to 0.33nb4: Ensure reset message is flushed before restart starts, and fix volume control to correctly report new value so 'volume -' and 'volume +' will always reduce/increase the volume by the minimum value. @ text @@ 1.2 log @Update mserv to 0.33nb3: Broadcast an information line both on server RESET initiation and on completion. @ text @@ 1.1 log @Update mserv to mserv-0.33nb2 - Clip TRACKSPERALBUM to 250 not 1200 as more than 255 loses - Fix default pathname to mpg123 - Add DEPENDS for mpg123 - Fix soundcard support @ text @d3 3 a5 5 --- mserv/defines.h.orig Thu Jul 13 21:35:18 2000 +++ mserv/defines.h @@@@ -16,6 +16,10 @@@@ #define PATH_LANGUAGE SHAREDIR "/english.lang" */ d7 6 a12 6 +#ifndef PATH_MPG123 +#define PATH_MPG123 BINDIR "/mpg123" +#endif + /* maximum amount to queue in each output buffer */ #define OUTBUFLEN 32*1024 a13 9 @@@@ -57,7 +61,7 @@@@ #define MISCINFOLEN 128 /* maximum number of tracks in each album */ -#define TRACKSPERALBUM 200 +#define TRACKSPERALBUM 250 /* maximum language line length */ #define LANGLINELEN 1024 @ 1.1.2.1 log @file patch-af was added on branch buildlink2 on 2002-06-23 18:39:00 +0000 @ text @d1 24 @ 1.1.2.2 log @Merge from pkgsrc-current to buildlink2 branch. @ text @a0 24 $NetBSD: patch-af,v 1.1.2.1 2002/06/23 18:39:00 jlam Exp $ --- mserv/defines.h.orig Thu Jul 13 21:35:18 2000 +++ mserv/defines.h @@@@ -16,6 +16,10 @@@@ #define PATH_LANGUAGE SHAREDIR "/english.lang" */ +#ifndef PATH_MPG123 +#define PATH_MPG123 BINDIR "/mpg123" +#endif + /* maximum amount to queue in each output buffer */ #define OUTBUFLEN 32*1024 @@@@ -57,7 +61,7 @@@@ #define MISCINFOLEN 128 /* maximum number of tracks in each album */ -#define TRACKSPERALBUM 200 +#define TRACKSPERALBUM 250 /* maximum language line length */ #define LANGLINELEN 1024 @