changeset 252:eef1490ef371 trunk

[svn] Port to NewVFS file probe.
author chainsaw
date Sat, 18 Nov 2006 10:01:53 -0800
parents 0469aa4ae1ec
children ab24cfe495e0
files ChangeLog src/sexypsf/xmms.c
diffstat 2 files changed, 18 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Nov 17 20:18:21 2006 -0800
+++ b/ChangeLog	Sat Nov 18 10:01:53 2006 -0800
@@ -1,3 +1,11 @@
+2006-11-18 04:18:21 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [520]
+  - make pause do something. closes #636
+  
+  trunk/src/cue/cuesheet.c |    9 ++++++++-
+  1 file changed, 8 insertions(+), 1 deletion(-)
+
+
 2006-11-15 20:04:06 +0000  William Pitcock <nenolod@nenolod.net>
   revision [518]
   - fix taglib stupidity. closes #633
--- a/src/sexypsf/xmms.c	Fri Nov 17 20:18:21 2006 -0800
+++ b/src/sexypsf/xmms.c	Sat Nov 18 10:01:53 2006 -0800
@@ -52,8 +52,7 @@
          return &sexypsf_ip;
       }
 
-static int is_our_file(gchar *filename) {
-	VFSFile *file;
+static int is_our_fd(gchar *filename, VFSFile *file) {
 	gchar magic[4];
 	
 	// Filter out psflib [we use them, but we can't play them]
@@ -65,15 +64,10 @@
 		if (!strcasecmp(tmps, teststr))
 		return 0;
 	}
-	if ((file = vfs_fopen(filename,"rb"))) {
-		vfs_fread(magic,1,4,file);
-		//Only allow PSF1 for now.
-		if (!strncmp(magic,"PSF\x01",4)) {
-			vfs_fclose(file);
-			return 1;
-		}
-		vfs_fclose(file);
-	}
+	vfs_fread(magic,1,4,file);
+	//Only allow PSF1 for now.
+	if (!memcmp(magic,"PSF\x01",4))
+		return 1;
 	return 0;
 }
 
@@ -270,7 +264,7 @@
 	0,
 	0,
 	0,
-	is_our_file,
+	0,
 	0,
 	sexypsf_xmms_play,
 	sexypsf_xmms_stop,
@@ -288,5 +282,8 @@
 	sexypsf_xmms_getsonginfo,
 	0,
 	0,
-	get_tuple_psf
+	get_tuple_psf,
+	0,
+	0,
+	is_our_fd,
 };