Mercurial > audlegacy-plugins
changeset 253:ab24cfe495e0 trunk
[svn] Port to NewVFS file probe & add explicit cast to silence warning, thanks to spb.
author | chainsaw |
---|---|
date | Sat, 18 Nov 2006 10:02:24 -0800 |
parents | eef1490ef371 |
children | cdf9756d1528 |
files | ChangeLog src/wavpack/Makefile src/wavpack/libwavpack.cxx |
diffstat | 3 files changed, 20 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sat Nov 18 10:01:53 2006 -0800 +++ b/ChangeLog Sat Nov 18 10:02:24 2006 -0800 @@ -1,3 +1,10 @@ +2006-11-18 18:01:53 +0000 Tony Vroon <chainsaw@gentoo.org> + revision [522] + Port to NewVFS file probe. + trunk/src/sexypsf/xmms.c | 23 ++++++++++------------- + 1 file changed, 10 insertions(+), 13 deletions(-) + + 2006-11-18 04:18:21 +0000 William Pitcock <nenolod@nenolod.net> revision [520] - make pause do something. closes #636
--- a/src/wavpack/Makefile Sat Nov 18 10:01:53 2006 -0800 +++ b/src/wavpack/Makefile Sat Nov 18 10:02:24 2006 -0800 @@ -11,6 +11,8 @@ CXXFLAGS += $(PICFLAGS) $(GTK_CFLAGS) $(WAVPACK_CFLAGS) -I../../intl -I../.. +LDFLAGS += -lstdc++ + OBJECTS = ${SOURCES:.cxx=.o} include ../../mk/objective.mk
--- a/src/wavpack/libwavpack.cxx Sat Nov 18 10:01:53 2006 -0800 +++ b/src/wavpack/libwavpack.cxx Sat Nov 18 10:02:24 2006 -0800 @@ -31,7 +31,7 @@ extern "C" InputPlugin * get_iplugin_info(void); static void wv_load_config(); -static int wv_is_our_file(char *); +static int wv_is_our_fd(gchar *filename, VFSFile *file); static void wv_play(char *); static void wv_stop(void); static void wv_pause(short); @@ -63,7 +63,7 @@ wv_load_config, wv_about_box, wv_configure, - wv_is_our_file, + NULL, //old style is_our_file NULL, //no use wv_play, wv_stop, @@ -82,6 +82,9 @@ wv_file_info_box, //info box NULL, //output wv_get_song_tuple, + NULL, + NULL, + wv_is_our_fd, }; int32_t read_bytes (void *id, void *data, int32_t bcount) @@ -250,16 +253,12 @@ } static int -wv_is_our_file(char *filename) +wv_is_our_fd(gchar *filename, VFSFile *file) { - char *ext; - - ext = strrchr(filename, '.'); - if (ext) { - if (!strcasecmp(ext, ".wv")) { - return TRUE; - } - } + gchar magic[4]; + vfs_fread(magic,1,4,file); + if (!memcmp(magic,"wvpk",4)) + return TRUE; return FALSE; } @@ -317,7 +316,7 @@ while (!killDecodeThread) { if (isSeek != -1) { DBG("seeking to position %d\n", isSeek); - WavpackSeekSample(d.ctx, isSeek * d.sample_rate); + WavpackSeekSample(d.ctx, (int)(isSeek * d.sample_rate)); isSeek = -1; } if (paused == 0