summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-03-17 12:04:38 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-25 22:13:07 +0100
commita29d54d1d81a85a0927b4973b1fbfc0c6ed4a162 (patch)
tree854e0b1d5f10bbd5e8ee3d8b2506d00e4c9ac2fe
parent8e5625dbe66a82cb892d7e1b0ad204bdc7379bff (diff)
ecore/audio: remove duplicated vio code from sndfile input
this is already done in the base implementation Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11529
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
index bebfba59d2..93cf66ff49 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
@@ -135,15 +135,6 @@ _ecore_audio_in_sndfile_ecore_audio_format_get(const Eo *eo_obj, Ecore_Audio_In_
135 return obj->format;; 135 return obj->format;;
136} 136}
137 137
138static void _free_vio(Ecore_Audio_Object *ea_obj)
139{
140 if (ea_obj->vio->free_func)
141 ea_obj->vio->free_func(ea_obj->vio->data);
142
143 free(ea_obj->vio);
144 ea_obj->vio = NULL;
145}
146
147EOLIAN static void 138EOLIAN static void
148_ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *obj, Ecore_Audio_Vio *vio, void *data, efl_key_data_free_func free_func) 139_ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *obj, Ecore_Audio_Vio *vio, void *data, efl_key_data_free_func free_func)
149{ 140{
@@ -156,22 +147,16 @@ _ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_D
156 obj->handle = NULL; 147 obj->handle = NULL;
157 } 148 }
158 149
159 eina_stringshare_replace(&ea_obj->source, "VIO"); 150 if (vio)
160 151 eina_stringshare_replace(&ea_obj->source, "VIO");
161 if (!ea_obj->source) 152 else
162 return; 153 eina_stringshare_replace(&ea_obj->source, NULL);
163 if (ea_obj->vio)
164 _free_vio(ea_obj);
165 154
166 in_obj->seekable = EINA_FALSE; 155 in_obj->seekable = EINA_FALSE;
156 ecore_audio_obj_vio_set(efl_super(eo_obj, MY_CLASS), vio, data, free_func);
167 157
168 if (!vio) 158 if (!vio)
169 return; 159 return;
170
171 ea_obj->vio = calloc(1, sizeof(Ecore_Audio_Vio_Internal));
172 ea_obj->vio->vio = vio;
173 ea_obj->vio->data = data;
174 ea_obj->vio->free_func = free_func;
175 in_obj->seekable = (vio->seek != NULL); 160 in_obj->seekable = (vio->seek != NULL);
176 161
177 obj->handle = ESF_CALL(sf_open_virtual)(&vio_wrapper, SFM_READ, &obj->sfinfo, eo_obj); 162 obj->handle = ESF_CALL(sf_open_virtual)(&vio_wrapper, SFM_READ, &obj->sfinfo, eo_obj);
@@ -201,14 +186,9 @@ _ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_D
201EOLIAN static void 186EOLIAN static void
202_ecore_audio_in_sndfile_efl_object_destructor(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *obj) 187_ecore_audio_in_sndfile_efl_object_destructor(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *obj)
203{ 188{
204 Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
205
206 if (obj->handle) 189 if (obj->handle)
207 ESF_CALL(sf_close)(obj->handle); 190 ESF_CALL(sf_close)(obj->handle);
208 191
209 if (ea_obj->vio)
210 _free_vio(ea_obj);
211
212 efl_destructor(efl_super(eo_obj, MY_CLASS)); 192 efl_destructor(efl_super(eo_obj, MY_CLASS));
213} 193}
214 194