[sound-juicer] mb-test: make sure drives have been polled



commit 15d7f722b8027e54f8868d9af183e757999bab25
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Mon Aug 1 12:54:52 2011 +0200

    mb-test: make sure drives have been polled
    
    If we try to query metadata too early, the querying won't fail
    because the metadata getter will think there is no CD in the drive.

 tests/mb-test.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/tests/mb-test.c b/tests/mb-test.c
index 9734136..31c8d88 100644
--- a/tests/mb-test.c
+++ b/tests/mb-test.c
@@ -1,4 +1,5 @@
 #include "config.h"
+#include <brasero-medium-monitor.h>
 #include <glib.h>
 #include <gconf/gconf-client.h>
 #include <dbus/dbus.h>
@@ -94,6 +95,7 @@ int main (int argc, char** argv)
   GMainLoop *loop;
   GConfClient *gconf_client;
   GError *error = NULL;
+  BraseroMediumMonitor *monitor;
 
   dbus_threads_init_default ();
 
@@ -105,6 +107,13 @@ int main (int argc, char** argv)
     g_warning ("Could not create GConf client.\n");
     exit (1);
   }
+
+  /* Make sure probing of the various media have settled before going on */
+  monitor = brasero_medium_monitor_get_default ();
+  while (brasero_medium_monitor_is_probing (monitor))
+      g_usleep (G_USEC_PER_SEC/10);
+  g_object_unref (G_OBJECT (monitor));
+
   gconf_client_add_dir (gconf_client, GCONF_ROOT, GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
   
   metadata = sj_metadata_getter_new ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]