summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-06-23 17:41:39 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-06-23 17:49:43 -0400
commit62e102750912664dd1b1da720ce0c2b2c3071243 (patch)
tree440077f45fb3f3d397962a7498db1ca2164eb3ad
parent4879b340a235a69fa6d68927c8e4e662e5b8cb7a (diff)
try only 1 reconnect to pulse when mixer fails to init
this causes huge lag on failure with no termination case. if it fails on the reconnect attempt then odds are it's never going to succeed
-rw-r--r--src/modules/mixer/lib/backends/pulseaudio/pulse.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/modules/mixer/lib/backends/pulseaudio/pulse.c b/src/modules/mixer/lib/backends/pulseaudio/pulse.c
index a1db4c7ec..fa869175c 100644
--- a/src/modules/mixer/lib/backends/pulseaudio/pulse.c
+++ b/src/modules/mixer/lib/backends/pulseaudio/pulse.c
@@ -810,17 +810,11 @@ _pulse_connect(void *data)
810 } 810 }
811#endif 811#endif
812 c->context = pa_context_new_with_proplist(&(c->api), NULL, proplist); 812 c->context = pa_context_new_with_proplist(&(c->api), NULL, proplist);
813 if (!c->context) 813 if (c->context)
814 { 814 {
815 WRN("Could not create the pulseaudio context"); 815 pa_context_set_state_callback(c->context, _pulse_pa_state_cb, c);
816 goto err; 816 if (pa_context_connect(c->context, NULL, PA_CONTEXT_NOFLAGS, NULL) < 0)
817 } 817 ERR("Could not connect to pulse");
818
819 pa_context_set_state_callback(c->context, _pulse_pa_state_cb, c);
820 if (pa_context_connect(c->context, NULL, PA_CONTEXT_NOFLAGS, NULL) < 0)
821 {
822 WRN("Could not connect to pulse");
823 goto err;
824 } 818 }
825#if !defined(EMIXER_BUILD) && defined(HAVE_WAYLAND) && !defined(HAVE_WAYLAND_ONLY) 819#if !defined(EMIXER_BUILD) && defined(HAVE_WAYLAND) && !defined(HAVE_WAYLAND_ONLY)
826 if (e_comp->comp_type != E_PIXMAP_TYPE_X) 820 if (e_comp->comp_type != E_PIXMAP_TYPE_X)
@@ -835,10 +829,6 @@ _pulse_connect(void *data)
835 829
836 pa_proplist_free(proplist); 830 pa_proplist_free(proplist);
837 return ECORE_CALLBACK_DONE; 831 return ECORE_CALLBACK_DONE;
838
839 err:
840 pa_proplist_free(proplist);
841 return ECORE_CALLBACK_RENEW;
842} 832}
843 833
844static Eina_Bool pulse_started; 834static Eina_Bool pulse_started;