static int _MMSoundMgrCodecRegisterInterface(MMSoundPluginType *plugin);
static int _MMSoundMgrCodecStopCallback(int param);
+static gboolean _mm_sound_mgr_codec_slot_is_empty();
+
+static gboolean _idle_cb(gpointer user_data)
+{
+ if (_mm_sound_mgr_codec_slot_is_empty()) {
+ debug_msg("slot is empty, ready to shutdown! %p", g_shutdown_cb);
+ if (g_shutdown_cb)
+ g_shutdown_cb(NULL);
+ } else {
+ debug_warning("slot is not empty!!! no shutdown...");
+ }
+
+ return FALSE;
+}
+
+static gboolean _timeout_cb(gpointer user_data)
+{
+ debug_warning("TIMEOUT : add idle callback now...");
+
+ g_idle_add(_idle_cb, NULL);
+ g_timer_id = 0;
+
+ return FALSE;
+}
+
/* FIXME : critical section for g_timer_id? */
static void _mm_sound_mgr_codec_shutdown_timer_start()
debug_error("Already active timer [%d] exists", g_timer_id);
return;
}
-
if (g_shutdown_cb) {
- g_timer_id = g_timeout_add_seconds(SHUTDOWN_TIMEOUT_SEC, g_shutdown_cb, NULL);
+ g_timer_id = g_timeout_add_seconds(SHUTDOWN_TIMEOUT_SEC, _timeout_cb, NULL);
debug_error("TIMER : new timer [%d]", g_timer_id);
} else {
debug_warning("No Timer started due to invalid shutdown callback");