summaryrefslogtreecommitdiff
path: root/src/lib/ecore_audio
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2014-04-02 14:21:57 +0100
committerTom Hacohen <tom@stosb.com>2014-04-10 04:20:21 +0100
commit96fe5bd941c5100f6435c77e2cfec18866c4bdb2 (patch)
treebc060ca763cf1c9f9c1f487219d769b9e4e5b8b5 /src/lib/ecore_audio
parentd36ca8f949489ff19e6e9987646ff262e4773d36 (diff)
More adjustments for eo2 calls.
Diffstat (limited to 'src/lib/ecore_audio')
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in.c20
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_tone.c6
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out.c8
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_pulse.c52
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c16
5 files changed, 51 insertions, 51 deletions
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c b/src/lib/ecore_audio/ecore_audio_obj_in.c
index db88b03e64..970e2adba3 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in.c
@@ -27,7 +27,7 @@ _ecore_audio_in_speed_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, double
27 27
28 obj->speed = speed; 28 obj->speed = speed;
29 29
30 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, NULL, NULL)); 30 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, NULL));
31} 31}
32 32
33EOLIAN static double 33EOLIAN static double
@@ -41,7 +41,7 @@ _ecore_audio_in_samplerate_set(Eo *eo_obj EINA_UNUSED, Ecore_Audio_Input *obj, i
41{ 41{
42 obj->samplerate = samplerate; 42 obj->samplerate = samplerate;
43 43
44 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, NULL, NULL)); 44 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_SAMPLERATE_CHANGED, NULL));
45} 45}
46 46
47EOLIAN static int 47EOLIAN static int
@@ -88,8 +88,8 @@ _ecore_audio_in_remaining_get(Eo *eo_obj, Ecore_Audio_Input *obj)
88{ 88{
89 if (!obj->seekable) return -1; 89 if (!obj->seekable) return -1;
90 else { 90 else {
91 double ret; 91 double ret = 0.0;
92 eo_do(eo_obj, ecore_audio_obj_in_seek(0, SEEK_CUR, &ret)); 92 eo_do(eo_obj, ret = ecore_audio_obj_in_seek(0, SEEK_CUR));
93 return obj->length - ret; 93 return obj->length - ret;
94 } 94 }
95} 95}
@@ -104,14 +104,14 @@ _ecore_audio_in_read(Eo *eo_obj, Ecore_Audio_Input *obj, void *buf, size_t len)
104 memset(buf, 0, len); 104 memset(buf, 0, len);
105 len_read = len; 105 len_read = len;
106 } else { 106 } else {
107 eo_do(eo_obj, ecore_audio_obj_in_read_internal(buf, len, &len_read)); 107 eo_do(eo_obj, len_read = ecore_audio_obj_in_read_internal(buf, len));
108 if (len_read == 0) { 108 if (len_read == 0) {
109 if (!obj->looped || !obj->seekable) { 109 if (!obj->looped || !obj->seekable) {
110 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_STOPPED, NULL, NULL)); 110 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_STOPPED, NULL));
111 } else { 111 } else {
112 eo_do(eo_obj, ecore_audio_obj_in_seek(0, SEEK_SET, NULL)); 112 eo_do(eo_obj, ecore_audio_obj_in_seek(0, SEEK_SET));
113 eo_do(eo_obj, ecore_audio_obj_in_read_internal(buf, len, &len_read)); 113 eo_do(eo_obj, len_read = ecore_audio_obj_in_read_internal(buf, len));
114 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_LOOPED, NULL, NULL)); 114 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_IN_EVENT_IN_LOOPED, NULL));
115 } 115 }
116 } 116 }
117 117
@@ -182,7 +182,7 @@ EOLIAN static void
182_ecore_audio_in_eo_base_destructor(Eo *eo_obj, Ecore_Audio_Input *obj) 182_ecore_audio_in_eo_base_destructor(Eo *eo_obj, Ecore_Audio_Input *obj)
183{ 183{
184 if(obj->output) 184 if(obj->output)
185 eo_do(obj->output, ecore_audio_obj_out_input_detach(eo_obj, NULL)); 185 eo_do(obj->output, ecore_audio_obj_out_input_detach(eo_obj));
186 186
187 eo_do_super(eo_obj, MY_CLASS, eo_destructor()); 187 eo_do_super(eo_obj, MY_CLASS, eo_destructor());
188} 188}
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_tone.c b/src/lib/ecore_audio/ecore_audio_obj_in_tone.c
index 1be57a426b..749772f401 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_tone.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_tone.c
@@ -83,7 +83,7 @@ _ecore_audio_in_tone_ecore_audio_in_length_set(Eo *eo_obj, Ecore_Audio_In_Tone_D
83} 83}
84 84
85EOLIAN static void 85EOLIAN static void
86_ecore_audio_in_tone_eo_key_data_set(Eo *eo_obj, Ecore_Audio_In_Tone_Data *obj, const char *key, const void *val, eo_key_data_free_func func) 86_ecore_audio_in_tone_eo_base_key_data_set(Eo *eo_obj, Ecore_Audio_In_Tone_Data *obj, const char *key, const void *val, eo_key_data_free_func func)
87{ 87{
88 if (!key) return; 88 if (!key) return;
89 89
@@ -96,13 +96,13 @@ _ecore_audio_in_tone_eo_key_data_set(Eo *eo_obj, Ecore_Audio_In_Tone_Data *obj,
96} 96}
97 97
98EOLIAN static void* 98EOLIAN static void*
99_ecore_audio_in_tone_eo_key_data_get(Eo *eo_obj, Ecore_Audio_In_Tone_Data *obj, const char *key) 99_ecore_audio_in_tone_eo_base_key_data_get(Eo *eo_obj, Ecore_Audio_In_Tone_Data *obj, const char *key)
100{ 100{
101 if (!strcmp(key, ECORE_AUDIO_ATTR_TONE_FREQ)) { 101 if (!strcmp(key, ECORE_AUDIO_ATTR_TONE_FREQ)) {
102 return (void *) (intptr_t) obj->freq; 102 return (void *) (intptr_t) obj->freq;
103 } else { 103 } else {
104 void *ret = NULL; 104 void *ret = NULL;
105 eo_do_super(eo_obj, MY_CLASS, eo_key_data_get(key, &ret)); 105 eo_do_super(eo_obj, MY_CLASS, ret = eo_key_data_get(key));
106 return ret; 106 return ret;
107 } 107 }
108} 108}
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out.c b/src/lib/ecore_audio/ecore_audio_obj_out.c
index 52e379fa3b..495e05c701 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out.c
@@ -25,7 +25,7 @@ static Eina_Bool _write_cb(void *data)
25 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_OUT_CLASS); 25 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_OUT_CLASS);
26 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); 26 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
27 27
28 ssize_t written, bread; 28 ssize_t written, bread = 0;
29 float buf[1024]; 29 float buf[1024];
30 30
31 if (!ea_obj->vio || !ea_obj->vio->vio->write) 31 if (!ea_obj->vio || !ea_obj->vio->vio->write)
@@ -34,7 +34,7 @@ static Eina_Bool _write_cb(void *data)
34 /* FIXME: Multiple inputs */ 34 /* FIXME: Multiple inputs */
35 in = eina_list_data_get(out_obj->inputs); 35 in = eina_list_data_get(out_obj->inputs);
36 36
37 eo_do(in, ecore_audio_obj_in_read(buf, 4*1024, &bread)); 37 eo_do(in, bread = ecore_audio_obj_in_read(buf, 4*1024));
38 38
39 if (bread == 0) { 39 if (bread == 0) {
40 ea_obj->paused = EINA_TRUE; 40 ea_obj->paused = EINA_TRUE;
@@ -61,7 +61,7 @@ _ecore_audio_out_input_attach(Eo *eo_obj, Ecore_Audio_Output *obj, Eo *input)
61 if (in->output == eo_obj) 61 if (in->output == eo_obj)
62 return EINA_FALSE; 62 return EINA_FALSE;
63 63
64 if (in->output) eo_do(in->output, ecore_audio_obj_out_input_detach(input, NULL)); 64 if (in->output) eo_do(in->output, ecore_audio_obj_out_input_detach(input));
65 in->output = eo_obj; 65 in->output = eo_obj;
66 66
67 /* TODO: Send event */ 67 /* TODO: Send event */
@@ -144,7 +144,7 @@ _ecore_audio_out_eo_base_destructor(Eo *eo_obj, Ecore_Audio_Output *obj)
144 Eo *in; 144 Eo *in;
145 145
146 EINA_LIST_FOREACH_SAFE(obj->inputs, cur, tmp, in) { 146 EINA_LIST_FOREACH_SAFE(obj->inputs, cur, tmp, in) {
147 eo_do(eo_obj, ecore_audio_obj_out_input_detach(in, NULL)); 147 eo_do(eo_obj, ecore_audio_obj_out_input_detach(in));
148 } 148 }
149 149
150 eo_do_super(eo_obj, MY_CLASS, eo_destructor()); 150 eo_do_super(eo_obj, MY_CLASS, eo_destructor());
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 4da2d0b77f..d958d2153b 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c
@@ -46,7 +46,7 @@ EOLIAN static void
46_ecore_audio_out_pulse_ecore_audio_volume_set(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED, double volume) 46_ecore_audio_out_pulse_ecore_audio_volume_set(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED, double volume)
47{ 47{
48 Eo *in; 48 Eo *in;
49 pa_stream *stream; 49 pa_stream *stream = NULL;
50 Eina_List *input; 50 Eina_List *input;
51 uint32_t idx; 51 uint32_t idx;
52 pa_cvolume pa_volume; 52 pa_cvolume pa_volume;
@@ -60,7 +60,7 @@ _ecore_audio_out_pulse_ecore_audio_volume_set(Eo *eo_obj, Ecore_Audio_Out_Pulse_
60 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_volume_set(volume)); 60 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_volume_set(volume));
61 61
62 EINA_LIST_FOREACH(out_obj->inputs, input, in) { 62 EINA_LIST_FOREACH(out_obj->inputs, input, in) {
63 eo_do(in, eo_key_data_get("pulse_data", (void **)&stream)); 63 eo_do(in, stream = eo_key_data_get("pulse_data"));
64 idx = pa_stream_get_index(stream); 64 idx = pa_stream_get_index(stream);
65 pa_operation_unref(pa_context_set_sink_input_volume(class_vars.context, idx, &pa_volume, NULL, NULL)); 65 pa_operation_unref(pa_context_set_sink_input_volume(class_vars.context, idx, &pa_volume, NULL, NULL));
66 } 66 }
@@ -72,12 +72,12 @@ static void _write_cb(pa_stream *stream, size_t len, void *data)
72 Eo *in = data; 72 Eo *in = data;
73 73
74 void *buf; 74 void *buf;
75 ssize_t bread; 75 ssize_t bread = 0;
76 size_t wlen = len; 76 size_t wlen = len;
77 77
78 pa_stream_begin_write(stream, &buf, &wlen); 78 pa_stream_begin_write(stream, &buf, &wlen);
79 79
80 eo_do(in, ecore_audio_obj_in_read(buf, wlen, &bread)); 80 eo_do(in, bread = ecore_audio_obj_in_read(buf, wlen));
81 81
82 pa_stream_write(stream, buf, bread, NULL, 0, PA_SEEK_RELATIVE); 82 pa_stream_write(stream, buf, bread, NULL, 0, PA_SEEK_RELATIVE);
83 if (bread < (int)len) 83 if (bread < (int)len)
@@ -88,14 +88,14 @@ static void _write_cb(pa_stream *stream, size_t len, void *data)
88 88
89static Eina_Bool _update_samplerate_cb(void *data EINA_UNUSED, Eo *eo_obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED) 89static Eina_Bool _update_samplerate_cb(void *data EINA_UNUSED, Eo *eo_obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
90{ 90{
91 pa_stream *stream; 91 pa_stream *stream = NULL;
92 int samplerate; 92 int samplerate = 0;
93 double speed; 93 double speed = 0;
94 94
95 eo_do(eo_obj, ecore_audio_obj_in_samplerate_get(&samplerate)); 95 eo_do(eo_obj, samplerate = ecore_audio_obj_in_samplerate_get());
96 eo_do(eo_obj, ecore_audio_obj_in_speed_get(&speed)); 96 eo_do(eo_obj, speed = ecore_audio_obj_in_speed_get());
97 97
98 eo_do(eo_obj, eo_key_data_get("pulse_data", (void **)&stream)); 98 eo_do(eo_obj, stream = eo_key_data_get("pulse_data"));
99 99
100 pa_operation_unref(pa_stream_update_sample_rate(stream, samplerate * speed, NULL, NULL)); 100 pa_operation_unref(pa_stream_update_sample_rate(stream, samplerate * speed, NULL, NULL));
101 101
@@ -104,29 +104,29 @@ static Eina_Bool _update_samplerate_cb(void *data EINA_UNUSED, Eo *eo_obj, const
104 104
105static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in) 105static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in)
106{ 106{
107 const char *name; 107 const char *name = NULL;
108 pa_sample_spec ss; 108 pa_sample_spec ss;
109 double speed; 109 double speed = 0;
110 pa_stream *stream; 110 pa_stream *stream;
111 Eina_Bool ret; 111 Eina_Bool ret = EINA_FALSE;
112 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); 112 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
113 113
114 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_attach(in, &ret)); 114 eo_do_super(eo_obj, MY_CLASS, ret = ecore_audio_obj_out_input_attach(in));
115 if (!ret) 115 if (!ret)
116 return EINA_FALSE; 116 return EINA_FALSE;
117 117
118 ss.format = PA_SAMPLE_FLOAT32LE; 118 ss.format = PA_SAMPLE_FLOAT32LE;
119 eo_do(in, ecore_audio_obj_in_samplerate_get((int *)&ss.rate)); 119 eo_do(in, ss.rate = ecore_audio_obj_in_samplerate_get());
120 eo_do(in, ecore_audio_obj_in_speed_get(&speed)); 120 eo_do(in, speed = ecore_audio_obj_in_speed_get());
121 eo_do(in, ecore_audio_obj_in_channels_get((int *)&ss.channels)); 121 eo_do(in, ss.channels = ecore_audio_obj_in_channels_get());
122 eo_do(in, ecore_audio_obj_name_get(&name)); 122 eo_do(in, name = ecore_audio_obj_name_get());
123 123
124 ss.rate = ss.rate * speed; 124 ss.rate = ss.rate * speed;
125 125
126 stream = pa_stream_new(class_vars.context, name, &ss, NULL); 126 stream = pa_stream_new(class_vars.context, name, &ss, NULL);
127 if (!stream) { 127 if (!stream) {
128 ERR("Could not create stream"); 128 ERR("Could not create stream");
129 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_detach(in, NULL)); 129 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_detach(in));
130 return EINA_FALSE; 130 return EINA_FALSE;
131 } 131 }
132 132
@@ -178,14 +178,14 @@ static void _drain_cb(pa_stream *stream, int success EINA_UNUSED, void *data EIN
178EOLIAN static Eina_Bool 178EOLIAN static Eina_Bool
179_ecore_audio_out_pulse_ecore_audio_out_input_detach(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED, Eo *in) 179_ecore_audio_out_pulse_ecore_audio_out_input_detach(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED, Eo *in)
180{ 180{
181 pa_stream *stream; 181 pa_stream *stream = NULL;
182 Eina_Bool ret2; 182 Eina_Bool ret2 = EINA_FALSE;
183 183
184 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_detach(in, &ret2)); 184 eo_do_super(eo_obj, MY_CLASS, ret2 = ecore_audio_obj_out_input_detach(in));
185 if (!ret2) 185 if (!ret2)
186 return EINA_FALSE; 186 return EINA_FALSE;
187 187
188 eo_do(in, eo_key_data_get("pulse_data", (void **)&stream)); 188 eo_do(in, stream = eo_key_data_get("pulse_data"));
189 189
190 pa_stream_set_write_callback(stream, NULL, NULL); 190 pa_stream_set_write_callback(stream, NULL, NULL);
191 pa_operation_unref(pa_stream_drain(stream, _drain_cb, NULL)); 191 pa_operation_unref(pa_stream_drain(stream, _drain_cb, NULL));
@@ -210,12 +210,12 @@ static void _state_cb(pa_context *context, void *data EINA_UNUSED)
210 if (state == PA_CONTEXT_READY) { 210 if (state == PA_CONTEXT_READY) {
211 DBG("PA context ready."); 211 DBG("PA context ready.");
212 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { 212 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) {
213 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, NULL, NULL)); 213 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, NULL));
214 } 214 }
215 } else if ((state == PA_CONTEXT_FAILED) || (state == PA_CONTEXT_TERMINATED)) { 215 } else if ((state == PA_CONTEXT_FAILED) || (state == PA_CONTEXT_TERMINATED)) {
216 DBG("PA context fail."); 216 DBG("PA context fail.");
217 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { 217 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) {
218 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL, NULL)); 218 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL));
219 } 219 }
220 } else { 220 } else {
221 DBG("Connection state %i", state); 221 DBG("Connection state %i", state);
@@ -241,7 +241,7 @@ static void _state_job(void *data EINA_UNUSED)
241 } 241 }
242 // the callback here can delete things in the list.. 242 // the callback here can delete things in the list..
243 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) { 243 EINA_LIST_FOREACH(class_vars.outputs, out, eo_obj) {
244 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL, NULL)); 244 eo_do(eo_obj, eo_event_callback_call(ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_FAIL, NULL));
245 } 245 }
246 // now unref everything safely 246 // now unref everything safely
247 EINA_LIST_FOREACH_SAFE(class_vars.outputs, out, tmp, eo_obj) { 247 EINA_LIST_FOREACH_SAFE(class_vars.outputs, out, tmp, eo_obj) {
diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
index d1ca3b5263..5e0e02f061 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_out_sndfile.c
@@ -37,13 +37,13 @@ static Eina_Bool _write_cb(void *data)
37 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_OUT_CLASS); 37 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_OUT_CLASS);
38 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); 38 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
39 39
40 ssize_t written, bread; 40 ssize_t written, bread = 0;
41 float buf[1024]; 41 float buf[1024];
42 42
43 /* TODO: Support mixing of multiple inputs */ 43 /* TODO: Support mixing of multiple inputs */
44 in = eina_list_data_get(out_obj->inputs); 44 in = eina_list_data_get(out_obj->inputs);
45 45
46 eo_do(in, ecore_audio_obj_in_read(buf, 4*1024, &bread)); 46 eo_do(in, bread = ecore_audio_obj_in_read(buf, 4*1024));
47 47
48 if (bread == 0) { 48 if (bread == 0) {
49 sf_write_sync(obj->handle); 49 sf_write_sync(obj->handle);
@@ -64,21 +64,21 @@ _ecore_audio_out_sndfile_ecore_audio_out_input_attach(Eo *eo_obj, Ecore_Audio_Ou
64{ 64{
65 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS); 65 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
66 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_OUT_CLASS); 66 Ecore_Audio_Output *out_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_OUT_CLASS);
67 Eina_Bool ret2; 67 Eina_Bool ret2 = EINA_FALSE;
68 68
69 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_attach(in, &ret2)); 69 eo_do_super(eo_obj, MY_CLASS, ret2 = ecore_audio_obj_out_input_attach(in));
70 if (!ret2) 70 if (!ret2)
71 return EINA_FALSE; 71 return EINA_FALSE;
72 72
73 eo_do(in, ecore_audio_obj_in_samplerate_get(&obj->sfinfo.samplerate)); 73 eo_do(in, obj->sfinfo.samplerate = ecore_audio_obj_in_samplerate_get());
74 eo_do(in, ecore_audio_obj_in_channels_get(&obj->sfinfo.channels)); 74 eo_do(in, obj->sfinfo.channels = ecore_audio_obj_in_channels_get());
75 75
76 obj->handle = sf_open(ea_obj->source, SFM_WRITE, &obj->sfinfo); 76 obj->handle = sf_open(ea_obj->source, SFM_WRITE, &obj->sfinfo);
77 77
78 if (!obj->handle) { 78 if (!obj->handle) {
79 eina_stringshare_del(ea_obj->source); 79 eina_stringshare_del(ea_obj->source);
80 ea_obj->source = NULL; 80 ea_obj->source = NULL;
81 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_detach(in, NULL)); 81 eo_do_super(eo_obj, MY_CLASS, ecore_audio_obj_out_input_detach(in));
82 return EINA_FALSE; 82 return EINA_FALSE;
83 } 83 }
84 84
@@ -165,7 +165,7 @@ _ecore_audio_out_sndfile_eo_base_constructor(Eo *eo_obj, Ecore_Audio_Out_Sndfile
165 165
166 eo_do_super(eo_obj, MY_CLASS, eo_constructor()); 166 eo_do_super(eo_obj, MY_CLASS, eo_constructor());
167 167
168 eo_do(eo_obj, ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_OGG, NULL)); 168 eo_do(eo_obj, ecore_audio_obj_format_set(ECORE_AUDIO_FORMAT_OGG));
169 169
170 // FIXME: Use writer from output 170 // FIXME: Use writer from output
171 out_obj->need_writer = EINA_FALSE; 171 out_obj->need_writer = EINA_FALSE;