summaryrefslogtreecommitdiff
path: root/src/lib/ecore_audio
diff options
context:
space:
mode:
authorDaniel Willmann <d.willmann@samsung.com>2013-05-09 10:11:09 +0100
committerDaniel Willmann <d.willmann@samsung.com>2013-05-09 10:35:51 +0100
commit57a438fd1b78ccb3c6e626a58b2da99a27e66fd7 (patch)
tree7605ef6e44b8c5cbbb843e43a35eb312b3982aae /src/lib/ecore_audio
parentf224eaae11fff1e5036ad969a5d2c859d4fbc239 (diff)
ecore_audio: Handle destruction of sndfile input
Correctly close any file we have open and release VIO data Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
Diffstat (limited to 'src/lib/ecore_audio')
-rw-r--r--src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c16
1 files changed, 15 insertions, 1 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 82646eeb81..73a93c42da 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
@@ -238,12 +238,26 @@ static void _constructor(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_U
238 238
239} 239}
240 240
241static void _destructor(Eo *eo_obj, void *_pd, va_list *list EINA_UNUSED)
242{
243 Ecore_Audio_Sndfile *obj = _pd;
244 Ecore_Audio_Object *ea_obj = eo_data_scope_get(eo_obj, ECORE_AUDIO_OBJ_CLASS);
245
246 if (obj->handle)
247 sf_close(obj->handle);
248
249 if (ea_obj->vio)
250 _free_vio(ea_obj);
251
252 eo_do_super(eo_obj, MY_CLASS, eo_destructor());
253}
254
241static void _class_constructor(Eo_Class *klass) 255static void _class_constructor(Eo_Class *klass)
242{ 256{
243 const Eo_Op_Func_Description func_desc[] = { 257 const Eo_Op_Func_Description func_desc[] = {
244 /* Virtual functions of parent class implemented in this class */ 258 /* Virtual functions of parent class implemented in this class */
245 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor), 259 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
246 //EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor), 260 EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor),
247 261
248 EO_OP_FUNC(ECORE_AUDIO_OBJ_ID(ECORE_AUDIO_OBJ_SUB_ID_SOURCE_SET), _source_set), 262 EO_OP_FUNC(ECORE_AUDIO_OBJ_ID(ECORE_AUDIO_OBJ_SUB_ID_SOURCE_SET), _source_set),
249 EO_OP_FUNC(ECORE_AUDIO_OBJ_ID(ECORE_AUDIO_OBJ_SUB_ID_SOURCE_GET), _source_get), 263 EO_OP_FUNC(ECORE_AUDIO_OBJ_ID(ECORE_AUDIO_OBJ_SUB_ID_SOURCE_GET), _source_get),