changeset 1951:c2a63f41d8c6 trunk

[svn] - NewVFS input probing layer. VFS-Aware plugins can automatically take advantage of this. Non VFS-aware plugins (such as FLAC) won't be able to yet. To take advantage, just modify your probing function as described in plugin.h. - __AUDACIOUS_NEWVFS__ is defined to designate availability of this new probing layer.
author nenolod
date Sun, 05 Nov 2006 18:36:26 -0800
parents d012e8d8c3b3
children 52dda29aa5e0
files ChangeLog audacious/input.c audacious/plugin.h
diffstat 3 files changed, 31 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Nov 05 18:00:14 2006 -0800
+++ b/ChangeLog	Sun Nov 05 18:36:26 2006 -0800
@@ -1,3 +1,11 @@
+2006-11-06 02:00:14 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [2857]
+  - fix potential display corruption problem in doublesize
+  
+  trunk/audacious/mainwin.c |    7 ++++---
+  1 file changed, 4 insertions(+), 3 deletions(-)
+
+
 2006-11-06 01:45:59 +0000  William Pitcock <nenolod@nenolod.net>
   revision [2855]
   - do not evaluate mainwinHeight() or mainwinWidth() in skin scripts if doublesize is on
--- a/audacious/input.c	Sun Nov 05 18:00:14 2006 -0800
+++ b/audacious/input.c	Sun Nov 05 18:36:26 2006 -0800
@@ -1,4 +1,7 @@
-/*  BMP - Cross-platform multimedia player
+/*  Audacious
+ *  Copyright (C) 2005-2006  Audacious development team.
+ *
+ *  BMP - Cross-platform multimedia player
  *  Copyright (C) 2003-2004  BMP development team.
  *
  *  Based on XMMS:
@@ -401,18 +404,24 @@
 InputPlugin *
 input_check_file(const gchar * filename, gboolean show_warning)
 {
+    VFSFile *fd;
     GList *node;
     InputPlugin *ip;
     gchar *filename_proxy;
     gint ret = 1;
 
     filename_proxy = g_strdup(filename);
+    fd = vfs_fopen(filename, "rb");
 
     for (node = get_input_list(); node != NULL; node = g_list_next(node)) {
         ip = INPUT_PLUGIN(node->data);
         if (ip && input_is_enabled(ip->filename) &&
-            (ret = ip->is_our_file(filename_proxy)) > 0) {
+            (ip->is_our_file_from_vfs != NULL &&
+             (ret = ip->is_our_file_from_vfs(filename_proxy, fd) > 0) || 
+             (ip->is_our_file != NULL &&
+              (ret = ip->is_our_file(filename_proxy)) > 0))) {
             g_free(filename_proxy);
+            vfs_fclose(fd);
             return ip;
         }
 	else if (ret <= -1)
@@ -425,6 +434,8 @@
         input_file_not_playable(filename);
     }
 
+    vfs_fclose(fd);
+
     return NULL;
 }
 
--- a/audacious/plugin.h	Sun Nov 05 18:00:14 2006 -0800
+++ b/audacious/plugin.h	Sun Nov 05 18:36:26 2006 -0800
@@ -32,6 +32,11 @@
 
 
 #include <glib.h>
+#ifdef _AUDACIOUS_CORE
+# include "libaudacious/vfs.h"
+#else
+# include "audacious/vfs.h"
+#endif
 #include "audacious/titlestring.h"
 
 #define INPUT_PLUGIN(x)   ((InputPlugin *)(x))
@@ -42,6 +47,7 @@
 
 #define LOWLEVEL_PLUGIN(x) ((LowlevelPlugin *)(x))
 
+#define __AUDACIOUS_NEWVFS__
 
 typedef enum {
     FMT_U8,
@@ -173,9 +179,13 @@
 
     OutputPlugin *output;
 
+    /* Added in Audacious 1.1.0 */
     TitleInput *(*get_song_tuple) (gchar * filename);
     void (*set_song_tuple) (TitleInput * tuple);
     void (*set_status_buffering) (gboolean status);
+
+    /* Added in Audacious 1.2.2 */
+    gint (*is_our_file_from_vfs) (gchar *filename, VFSFile *fd);
 };
 
 struct _GeneralPlugin {