Index: audio.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/audio/audio.module,v
retrieving revision 1.156
diff -u -F^function -r1.156 audio.module
--- audio.module	31 Jul 2009 23:20:53 -0000	1.156
+++ audio.module	27 Oct 2009 22:41:31 -0000
@@ -175,10 +175,17 @@ function audio_theme() {
   foreach (audio_get_players('names') as $name => $player) {
     if ($player['module'] == 'audio') {
       $theme[$player['theme_node']] = array(
-        'arguments' => array('node'),
-        'file' => $name .'.inc',
+        'arguments' => array('node', 'options'),
+        'file' => $player['file'],
         'path' => $player_path,
       );
+      if (!empty($player['theme_xspf'])) {
+        $theme[$player['theme_xspf']] = array(
+          'arguments' => array('path', 'options'),
+          'file' => $player['file'],
+          'path' => $player_path,
+        );
+      }
     }
   }
   return $theme;
@@ -1034,6 +1041,10 @@ function _audio_player_build_list() {
     if (function_exists($function)) {
       $result = $function();
       if (isset($result) && is_array($result)) {
+        foreach (array_keys($result) as $player) {
+          // Keep track of the file where this player was found.
+          $result[$player]['file'] = $file->basename; 
+        }
         $players_name = array_merge($players_name, $result);
       }
     }
@@ -1107,7 +1118,7 @@ function audio_get_node_player($node, $p
     }
     $player = audio_get_players('name', $playername);
     // Try to use the requested player, if that doesn't work out, use the generic one.
-    return theme(array($player['theme_node'], 'audio_default_node_player'), $node);
+    return theme(array($player['theme_node'], 'audio_default_node_player'), $node, isset($player['options']) ? $player['options'] : array());
   }
 }
 
