diff audacious/input.c @ 355:1c701dfe5098 trunk

[svn] Cache the decoder used for each PlaylistEntry. This reduces the amount of times we probe a resource to a strict limit of two times. (Once to detect the type, and the second time to get the stream information.) Something this simple should have been done to begin with...
author nenolod
date Thu, 29 Dec 2005 22:10:26 -0800
parents 763afa52f416
children e4e897d20791
line wrap: on
line diff
--- a/audacious/input.c	Thu Dec 29 02:29:29 2005 -0800
+++ b/audacious/input.c	Thu Dec 29 22:10:26 2005 -0800
@@ -375,8 +375,27 @@
         input_show_unplayable_files(filename);
 }
 
-
-gboolean
+/*
+ * input_check_file()
+ *
+ * Inputs:
+ *       filename to check recursively against input plugins
+ *       whether or not to show an error
+ *
+ * Outputs:
+ *       pointer to input plugin which can handle this file
+ *       otherwise, NULL
+ *
+ *       (the previous code returned a boolean of whether or not we can
+ *        play the file... even WORSE for performance)
+ *
+ * Side Effects:
+ *       various input plugins open the file and probe it
+ *       -- this can have very ugly effects performance wise on streams
+ *
+ * --nenolod, Dec 31 2005
+ */
+InputPlugin *
 input_check_file(const gchar * filename, gboolean show_warning)
 {
     GList *node;
@@ -390,7 +409,7 @@
         if (ip && input_is_enabled(ip->filename) &&
             ip->is_our_file(filename_proxy)) {
             g_free(filename_proxy);
-            return TRUE;
+            return ip;
         }
     }
 
@@ -400,7 +419,7 @@
         input_file_not_playable(filename);
     }
 
-    return FALSE;
+    return NULL;
 }