changeset 3199:88b8338b8cf4 trunk

Automated merge with ssh://hg.atheme.org//hg/audacious
author William Pitcock <nenolod@atheme-project.org>
date Wed, 01 Aug 2007 03:37:06 -0500
parents 7628b2b7a688 (diff) 5dd8bc77a590 (current diff)
children 95cfda3878da
files
diffstat 1 files changed, 48 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/input.c	Wed Aug 01 13:55:02 2007 +0900
+++ b/src/audacious/input.c	Wed Aug 01 03:37:06 2007 -0500
@@ -412,13 +412,56 @@
     mimetype = vfs_get_metadata(fd, "content-type");
     if ((ip = mime_get_plugin(mimetype)) != NULL)
     {
-        g_free(filename_proxy);
-        vfs_fclose(fd);
+        if (!input_is_enabled(ip->filename))
+            break;
+
+        if (ip->probe_for_tuple != NULL)
+        {
+            TitleInput *tuple = ip->probe_for_tuple(filename_proxy, fd);
+
+            if (tuple != NULL)
+            {
+                g_free(filename_proxy);
+                vfs_fclose(fd);
+
+                pr = g_new0(ProbeResult, 1);
+                pr->ip = ip;
+                pr->tuple = tuple;
+                pr->tuple->mtime = input_get_mtime(filename_proxy);
+
+                return pr;
+            }
+        }
+        else if (fd && ip->is_our_file_from_vfs != NULL)
+        {
+            ret = ip->is_our_file_from_vfs(filename_proxy, fd);
 
-        pr = g_new0(ProbeResult, 1);
-        pr->ip = ip;
+            if (ret > 0)
+            {
+                g_free(filename_proxy);
+                vfs_fclose(fd);
+
+                pr = g_new0(ProbeResult, 1);
+                pr->ip = ip;
 
-        return pr;
+                return pr;
+            }
+        }
+        else if (ip->is_our_file != NULL)
+        {
+            ret = ip->is_our_file(filename_proxy);
+
+            if (ret > 0)
+            {
+                g_free(filename_proxy);
+                vfs_fclose(fd);
+
+                pr = g_new0(ProbeResult, 1);
+                pr->ip = ip;
+
+                return pr;
+            }
+        }
     }
 
     for (node = get_input_list(); node != NULL; node = g_list_next(node))