summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-06-24 14:43:07 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-25 14:36:08 +0900
commit6db0ff42291ff4c44815df3a5f77c31ae1bad1ac (patch)
tree1a33fec31b87e193763c9af30f15a4fd912a5326 /src
parent8c473648461f48ee07a9d8efa0e5b8ee9b1e43ca (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_pulse.c9
1 files changed, 8 insertions, 1 deletions
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_
184{ 184{
185 pa_stream *stream = NULL; 185 pa_stream *stream = NULL;
186 Eina_Bool ret2 = EINA_FALSE; 186 Eina_Bool ret2 = EINA_FALSE;
187 pa_operation *op;
187 188
188 eo_do_super(eo_obj, MY_CLASS, ret2 = ecore_audio_obj_out_input_detach(in)); 189 eo_do_super(eo_obj, MY_CLASS, ret2 = ecore_audio_obj_out_input_detach(in));
189 if (!ret2) 190 if (!ret2)
@@ -192,8 +193,14 @@ _ecore_audio_out_pulse_ecore_audio_out_input_detach(Eo *eo_obj, Ecore_Audio_Out_
192 eo_do(in, stream = eo_key_data_get("pulse_data")); 193 eo_do(in, stream = eo_key_data_get("pulse_data"));
193 194
194 pa_stream_set_write_callback(stream, NULL, NULL); 195 pa_stream_set_write_callback(stream, NULL, NULL);
195 pa_operation_unref(pa_stream_drain(stream, _drain_cb, NULL)); 196 op = pa_stream_drain(stream, _drain_cb, NULL);
197 if (!op)
198 {
199 ERR("Failed to drain PulseAudio stream.");
200 return EINA_FALSE;
201 }
196 202
203 pa_operation_unref(op);
197 return EINA_TRUE; 204 return EINA_TRUE;
198} 205}
199 206