summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavio Ceolin <flavio.ceolin@gmail.com>2014-09-04 22:56:47 -0300
committerFlavio Ceolin <flavio.ceolin@gmail.com>2014-09-04 22:56:47 -0300
commit5b761f05d47e235756e83163a1880173e647cd2a (patch)
tree772dd79d75f471e6fcf64fa8bdf63e3723409d13
parent9ffc98ee4c8679f9efaa51a36c13f61e766296c1 (diff)
emixer: Fallback to other backend in fail
-rw-r--r--src/bin/main.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index f7da8e1..276a0d4 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -9,6 +9,9 @@ EAPI int
9elm_main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED) 9elm_main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
10{ 10{
11 Evas_Object *win; 11 Evas_Object *win;
12 Eina_List *l;
13 const char *backend_name;
14 Eina_Bool backend_loaded = EINA_FALSE;
12 15
13 EINA_SAFETY_ON_FALSE_RETURN_VAL(emixer_common_init("emixer"), EXIT_FAILURE); 16 EINA_SAFETY_ON_FALSE_RETURN_VAL(emixer_common_init("emixer"), EXIT_FAILURE);
14 EINA_SAFETY_ON_FALSE_RETURN_VAL(emix_init() == EINA_TRUE, EXIT_FAILURE); 17 EINA_SAFETY_ON_FALSE_RETURN_VAL(emix_init() == EINA_TRUE, EXIT_FAILURE);
@@ -19,16 +22,24 @@ elm_main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
19 22
20 if (emix_backend_set("PULSEAUDIO") == EINA_FALSE) 23 if (emix_backend_set("PULSEAUDIO") == EINA_FALSE)
21 { 24 {
22 if (emix_backend_set("ALSA") == EINA_FALSE) 25 WRN("Could not load PULSEAUDIO, trying another one ...");
26 EINA_LIST_FOREACH((Eina_List *)emix_backends_available(), l,
27 backend_name)
23 { 28 {
24 ERR("Could not start the backend !"); 29 if (emix_backend_set(backend_name) == EINA_TRUE)
25 goto end; 30 {
31 DBG("Loaded backend: %s!", backend_name);
32 backend_loaded = EINA_TRUE;
33 break;
34 }
26 } 35 }
27 } 36 }
37 else
38 backend_loaded = EINA_TRUE;
28 39
29 elm_run(); 40 if (backend_loaded)
41 elm_run();
30 42
31end:
32 emixer_common_shutdown(); 43 emixer_common_shutdown();
33 emix_shutdown(); 44 emix_shutdown();
34 return 0; 45 return 0;