jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6db0ff42291ff4c44815df3a5f77c31ae1bad1ac

commit 6db0ff42291ff4c44815df3a5f77c31ae1bad1ac
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Wed Jun 24 14:43:07 2015 +0900

    Ecore_Audio: Avoid abort() in PulseAudio
    
    In some cases (stress test), pulseaudio fails to play a sound
    and pa_stream_drain() returns NULL, making pa_operation_unref()
    crash right after.
---
 src/lib/ecore_audio/ecore_audio_obj_out_pulse.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c 
b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
index 901d9f6..eab7464 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
@@ -184,6 +184,7 @@ _ecore_audio_out_pulse_ecore_audio_out_input_detach(Eo 
*eo_obj, Ecore_Audio_Out_
 {
   pa_stream *stream = NULL;
   Eina_Bool ret2 = EINA_FALSE;
+  pa_operation *op;
 
   eo_do_super(eo_obj, MY_CLASS, ret2 = ecore_audio_obj_out_input_detach(in));
   if (!ret2)
@@ -192,8 +193,14 @@ _ecore_audio_out_pulse_ecore_audio_out_input_detach(Eo 
*eo_obj, Ecore_Audio_Out_
   eo_do(in, stream = eo_key_data_get("pulse_data"));
 
   pa_stream_set_write_callback(stream, NULL, NULL);
-  pa_operation_unref(pa_stream_drain(stream, _drain_cb, NULL));
+  op = pa_stream_drain(stream, _drain_cb, NULL);
+  if (!op)
+    {
+       ERR("Failed to drain PulseAudio stream.");
+       return EINA_FALSE;
+    }
 
+  pa_operation_unref(op);
   return EINA_TRUE;
 }
 

-- 


Reply via email to