changeset 3047:4434b4c4a715

ported EsounD plugin
author Andrew O. Shadoura <bugzilla@tut.by>
date Fri, 17 Apr 2009 16:17:10 +0300
parents 75cd491339c9
children c269a0351b53
files src/esd/esdout.h src/esd/init.c
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/esd/esdout.h	Fri Apr 17 16:11:16 2009 +0300
+++ b/src/esd/esdout.h	Fri Apr 17 16:17:10 2009 +0300
@@ -44,7 +44,7 @@
 
 extern ESDConfig esd_cfg;
 
-void esdout_init(void);
+OutputPluginInitStatus esdout_init(void);
 void esdout_about(void);
 void esdout_configure(void);
 
--- a/src/esd/init.c	Fri Apr 17 16:11:16 2009 +0300
+++ b/src/esd/init.c	Fri Apr 17 16:17:10 2009 +0300
@@ -27,12 +27,13 @@
 esd_player_info_t *player_info;
 
 
-void
+OutputPluginInitStatus
 esdout_init(void)
 {
     mcs_handle_t *db;
     char *env;
     int lp = 80 , rp = 80;
+    int fd;
 
     memset(&esd_cfg, 0, sizeof(ESDConfig));
     esd_cfg.port = ESD_DEFAULT_PORT;
@@ -71,4 +72,13 @@
 
     if (!esd_cfg.server)
         esd_cfg.server = g_strdup("localhost");
+
+    fd = esd_open_sound(esd_cfg.hostname);
+    if (fd >= 0)
+    {
+        esd_close(fd);
+        return OUTPUT_PLUGIN_INIT_FOUND_DEVICES;
+    }
+    else
+        return OUTPUT_PLUGIN_INIT_NO_DEVICES;
 }