+_mmplayer_watcher_removed_notify(gpointer data)
+{
+ mmplayer_t *player = (mmplayer_t *)data;
+ MMPLAYER_RETURN_IF_FAIL(player);
+
+ MMPLAYER_BUS_WATCHER_LOCK(player);
+ player->bus_watcher = 0;
+ MMPLAYER_BUS_WATCHER_SIGNAL(player);
+ MMPLAYER_BUS_WATCHER_UNLOCK(player);
+}
+
+void
+_mmplayer_bus_watcher_remove(MMHandleType hplayer)
+{
+ mmplayer_t *player = (mmplayer_t *)hplayer;
+ gint64 end_time = 0;
+ MMPLAYER_FENTER();
+ MMPLAYER_RETURN_IF_FAIL(player);
+
+ /* disconnecting bus watch */
+ if (player->bus_watcher > 0) {
+ __mmplayer_remove_g_source_from_context(player->context.thread_default, player->bus_watcher);
+ MMPLAYER_BUS_WATCHER_LOCK(player);
+ end_time = g_get_monotonic_time () + 2 * G_TIME_SPAN_SECOND;
+ while (player->bus_watcher > 0)
+ MMPLAYER_BUS_WATCHER_WAIT_UNTIL(player, end_time);
+ MMPLAYER_BUS_WATCHER_UNLOCK(player);
+
+ g_mutex_clear(&player->bus_watcher_mutex);
+ g_cond_clear(&player->bus_watcher_cond);
+ }
+
+ MMPLAYER_FLEAVE();
+}
+
+void