* limitations under the License.
*
*/
-
+
#include <stdlib.h>
#include <string.h>
static int _MMSoundPluginGetList(const char *plugdir ,char ***list);
static int _MMSoundPluginDestroyList(char **list);
+/* default "empty list" used in case of error */
+static MMSoundPluginType empty_plugin_list = {
+ .type = MM_SOUND_PLUGIN_TYPE_NONE,
+ .module = NULL
+};
+
char* MMSoundPluginGetTypeName(int type)
{
static char *typename[] = {
debug_msg(" Plugin dir :: %s \n", plugindir);
err = _MMSoundPluginGetList(plugindir, &list);
- if (err != MM_ERROR_NONE)
+ if (err != MM_ERROR_NONE) {
+ *pluginlist = &empty_plugin_list;
return err;
+ }
while((item = list[index++]) != NULL) {
if(MMSoundPluginOpen(item, &plugin[plugin_index]) != MM_ERROR_NONE) {
MMSoundPluginClose(&pluginlist[loop++]);
}
- free (pluginlist);
+ if (pluginlist != &empty_plugin_list)
+ free (pluginlist);
debug_fleave ();