changeset 3042:fbfdd7946be9

More cleanups.
author William Pitcock <nenolod@atheme.org>
date Tue, 14 Apr 2009 18:19:27 -0500
parents d6fa54737096
children 8a7364b4c957
files src/filewriter/filewriter.c
diffstat 1 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/filewriter/filewriter.c	Tue Apr 14 15:57:15 2009 -0500
+++ b/src/filewriter/filewriter.c	Tue Apr 14 18:19:27 2009 -0500
@@ -118,25 +118,25 @@
 
 SIMPLE_OUTPUT_PLUGIN(filewriter, file_oplist);
 
+FileWriter *plugins[FILEEXT_MAX] = {
+    &wav_plugin,
+#ifdef FILEWRITER_MP3
+    &mp3_plugin,
+#endif
+#ifdef FILEWRITER_VORBIS
+    &vorbis_plugin,
+#endif
+#ifdef FILEWRITER_FLAC
+    &flac_plugin,
+#endif
+};
+
 static void set_plugin(void)
 {
     if (fileext < 0 || fileext >= FILEEXT_MAX)
         fileext = 0;
 
-    if (fileext == WAV)
-        plugin = &wav_plugin;
-#ifdef FILEWRITER_MP3
-    if (fileext == MP3)
-        plugin = &mp3_plugin;
-#endif
-#ifdef FILEWRITER_VORBIS
-    if (fileext == VORBIS)
-        plugin = &vorbis_plugin;
-#endif
-#ifdef FILEWRITER_FLAC
-    if (fileext == FLAC)
-        plugin = &flac_plugin;
-#endif
+    plugin = plugins[fileext];
 }
 
 static OutputPluginInitStatus file_init(void)