diff -ur vitunes-0.93/Makefile vitunes/Makefile --- vitunes-0.93/Makefile 2009-03-11 22:39:03.000000000 +0100 +++ vitunes/Makefile 2009-12-05 15:52:53.000000000 +0100 @@ -1,9 +1,9 @@ # additional dependencies not in base -CFLAGS_DEPS=-I/usr/local/include -LDFLAGS_DEPS=-L/usr/local/lib -lid3tag -lmp4v2 -logg -lvorbis -lvorbisfile +CFLAGS_DEPS=-I/opt/local/include +LDFLAGS_DEPS=-L/opt/local/lib -lid3tag -lmp4v2 -logg -lvorbis -lvorbisfile CC=/usr/bin/gcc -CFLAGS=-c -Wall -ansi -O2 -DDEBUG -g $(CFLAGS_DEPS) +CFLAGS=-c -Wall -O2 -DDEBUG -g $(CFLAGS_DEPS) LDFLAGS=-lncurses -lm $(LDFLAGS_DEPS) diff -ur vitunes-0.93/media_player.c vitunes/media_player.c --- vitunes-0.93/media_player.c 2009-03-04 21:57:35.000000000 +0100 +++ vitunes/media_player.c 2009-12-05 16:21:20.000000000 +0100 @@ -66,7 +66,7 @@ /* launch the media player */ /* TODO: fuck mplayer -- try to find a better msglevel */ - if (execl("/usr/local/bin/mplayer", "mplayer", + if (execl("/opt/local/bin/mplayer", "mplayer", "-slave", "-idle", "-quiet", "-msglevel", "cplayer=0:ao=0:vo=0:decaudio=0:decvideo=0:demuxer=0", (char*)NULL) == -1) diff -ur vitunes-0.93/meta_info.c vitunes/meta_info.c --- vitunes-0.93/meta_info.c 2009-03-11 23:00:31.000000000 +0100 +++ vitunes/meta_info.c 2009-12-05 16:09:49.000000000 +0100 @@ -1,3 +1,50 @@ +#include +#include +#include + +#define INVALID 1 +#define TOOSMALL 2 +#define TOOLARGE 3 + +long long +strtonum(const char *numstr, long long minval, long long maxval, + const char **errstrp) +{ + long long ll = 0; + char *ep; + int error = 0; + struct errval { + const char *errstr; + int err; + } ev[4] = { + { NULL, 0 }, + { "invalid", EINVAL }, + { "too small", ERANGE }, + { "too large", ERANGE }, + }; + + ev[0].err = errno; + errno = 0; + if (minval > maxval) + error = INVALID; + else { + ll = strtoll(numstr, &ep, 10); + if (numstr == ep || *ep != '\0') + error = INVALID; + else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) + error = TOOSMALL; + else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval) + error = TOOLARGE; + } + if (errstrp != NULL) + *errstrp = ev[error].errstr; + errno = ev[error].err; + if (error) + ll = 0; + + return (ll); +} + #include "meta_info.h" @@ -470,9 +517,9 @@ if (meta_extract_vorbis(fullname, mi) == 0) return mi; - if (meta_extract_mp4(fullname, mi) == 0) - return mi; - + // fd leak + //if (meta_extract_mp4(fullname, mi) == 0) + // return mi; /* if we've reached here, no meta info found. free the meta_info * struct and return null. */ diff -ur vitunes-0.93/meta_info_db.c vitunes/meta_info_db.c --- vitunes-0.93/meta_info_db.c 2009-03-05 00:49:50.000000000 +0100 +++ vitunes/meta_info_db.c 2009-12-05 15:54:20.000000000 +0100 @@ -312,7 +312,7 @@ if (index != -1) /* file DOES exist in DB... */ { /* check if the file has been modified since it was added */ - if (ftsent->fts_statp->st_mtim.tv_sec > + if (ftsent->fts_statp->st_mtimespec.tv_sec > midb->files[index]->last_updated) { /* it has been modified... update the record */ mi = meta_extract(ftsent->fts_accpath); @@ -399,7 +399,7 @@ } else { /* file still exists... check if it has been modified */ - if (sb.st_mtim.tv_sec > midb->files[i]->last_updated) + if (sb.st_mtimespec.tv_sec > midb->files[i]->last_updated) { meta_info *mi = meta_extract(filename); if (mi == NULL) { midb_remove_record(midb, i); diff -ur vitunes-0.93/uinterface.h vitunes/uinterface.h --- vitunes-0.93/uinterface.h 2009-05-08 03:22:43.000000000 +0200 +++ vitunes/uinterface.h 2009-12-05 15:55:11.000000000 +0100 @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include