in = eo_data_get(input, ECORE_AUDIO_OBJ_IN_CLASS);
+ if (ret)
+ *ret = EINA_FALSE;
+
+ if (in->output == eo_obj)
+ return;
+
if (in->output) eo_do(in->output, ecore_audio_obj_out_input_detach(input));
in->output = eo_obj;
Eina_Bool ret;
Ecore_Audio_Object *ea_obj = eo_data_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
+ eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_attach(in, &ret));
+ if (!ret)
+ return EINA_FALSE;
+
ss.format = PA_SAMPLE_FLOAT32LE;
eo_do(in, ecore_audio_obj_in_samplerate_get((int *)&ss.rate));
eo_do(in, ecore_audio_obj_in_speed_get(&speed));
stream = pa_stream_new(class_vars.context, name, &ss, NULL);
if (!stream) {
ERR("Could not create stream");
+ eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_detach(in));
return EINA_FALSE;
}
- eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_attach(in, &ret));
-
eo_do(in, eo_event_callback_add(ECORE_AUDIO_EV_IN_SAMPLERATE_CHANGED, _update_samplerate_cb, eo_obj));
eo_do(in, eo_base_data_set("pulse_data", stream, NULL));
{
Eo *out2;
Eina_List *in3;
+ Eina_Bool attached;
Eo *in = eo_add(ECORE_AUDIO_OBJ_IN_CLASS, NULL);
Eo *in2 = eo_add(ECORE_AUDIO_OBJ_IN_CLASS, NULL);
fail_if(eina_list_count(in3) != 0);
- fail_if(!eo_do(out, ecore_audio_obj_out_input_attach(in, NULL)));
+ fail_if(!eo_do(out, ecore_audio_obj_out_input_attach(in, &attached)));
+ fail_if(!attached);
+
+ fail_if(!eo_do(out, ecore_audio_obj_out_input_attach(in, &attached)));
+ fail_if(attached);
fail_if(!eo_do(in, ecore_audio_obj_in_output_get(&out2)));