changeset 229:5783d6281431 trunk

[svn] - revert due to branching issue
author nenolod
date Mon, 06 Nov 2006 15:04:13 -0800
parents ef1967a3cd28
children ee81e087615c
files ChangeLog src/sexypsf/xmms.c
diffstat 2 files changed, 20 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Nov 06 14:11:04 2006 -0800
+++ b/ChangeLog	Mon Nov 06 15:04:13 2006 -0800
@@ -1,3 +1,10 @@
+2006-11-06 22:11:04 +0000  Tony Vroon <chainsaw@gentoo.org>
+  revision [456]
+  New-style VFS probe function. If you want an #ifdef feel free to bolt some on.
+  trunk/src/sexypsf/xmms.c |   25 ++++++++++++-------------
+  1 file changed, 12 insertions(+), 13 deletions(-)
+
+
 2006-11-06 21:30:44 +0000  Jonathan Schleifer <js@h3c.de>
   revision [454]
   Fixed missing header
--- a/src/sexypsf/xmms.c	Mon Nov 06 14:11:04 2006 -0800
+++ b/src/sexypsf/xmms.c	Mon Nov 06 15:04:13 2006 -0800
@@ -52,7 +52,8 @@
          return &sexypsf_ip;
       }
 
-static int is_our_fd(gchar *filename, VFSFile *file) {
+static int is_our_file(gchar *filename) {
+	VFSFile *file;
 	gchar magic[4];
 	
 	// Filter out psflib [we use them, but we can't play them]
@@ -64,12 +65,15 @@
 		if (!strcasecmp(tmps, teststr))
 		return 0;
 	}
-	if (vfs_ftell(file) != 0)
-		vfs_fseek(file, 0, SEEK_SET);
-	vfs_fread(magic,1,4,file);
-	//Only allow PSF1 for now.
-	if (!strncmp(magic,"PSF\x01",4))
-		return 1;
+	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);
+	}
 	return 0;
 }
 
@@ -266,7 +270,7 @@
 	0,
 	0,
 	0,
-	0,
+	is_our_file,
 	0,
 	sexypsf_xmms_play,
 	sexypsf_xmms_stop,
@@ -284,8 +288,5 @@
 	sexypsf_xmms_getsonginfo,
 	0,
 	0,
-	get_tuple_psf,
-	0,
-	0,
-	is_our_fd,
+	get_tuple_psf
 };