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)
downloadefl-a29d54d1d81a85a0927b4973b1fbfc0c6ed4a162.tar.gz
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_
return obj->format;;
}
-static void _free_vio(Ecore_Audio_Object *ea_obj)
-{
- if (ea_obj->vio->free_func)
- ea_obj->vio->free_func(ea_obj->vio->data);
-
- free(ea_obj->vio);
- ea_obj->vio = NULL;
-}
-
EOLIAN static void
_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)
{
@@ -156,22 +147,16 @@ _ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_D
obj->handle = NULL;
}
- eina_stringshare_replace(&ea_obj->source, "VIO");
-
- if (!ea_obj->source)
- return;
- if (ea_obj->vio)
- _free_vio(ea_obj);
+ if (vio)
+ eina_stringshare_replace(&ea_obj->source, "VIO");
+ else
+ eina_stringshare_replace(&ea_obj->source, NULL);
in_obj->seekable = EINA_FALSE;
+ ecore_audio_obj_vio_set(efl_super(eo_obj, MY_CLASS), vio, data, free_func);
if (!vio)
return;
-
- ea_obj->vio = calloc(1, sizeof(Ecore_Audio_Vio_Internal));
- ea_obj->vio->vio = vio;
- ea_obj->vio->data = data;
- ea_obj->vio->free_func = free_func;
in_obj->seekable = (vio->seek != NULL);
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
EOLIAN static void
_ecore_audio_in_sndfile_efl_object_destructor(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *obj)
{
- Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS);
-
if (obj->handle)
ESF_CALL(sf_close)(obj->handle);
- if (ea_obj->vio)
- _free_vio(ea_obj);
-
efl_destructor(efl_super(eo_obj, MY_CLASS));
}