[mb-commits] r9762 - libdiscid/trunk/src

root at musicbrainz.org root at musicbrainz.org
Tue Mar 11 07:44:34 UTC 2008


Author: robert
Date: 2008-03-11 07:44:34 +0000 (Tue, 11 Mar 2008)
New Revision: 9762

Modified:
   libdiscid/trunk/src/disc_darwin.c
Log:
Minor tweaks to make picard happy.


Modified: libdiscid/trunk/src/disc_darwin.c
===================================================================
--- libdiscid/trunk/src/disc_darwin.c	2008-03-11 06:10:38 UTC (rev 9761)
+++ libdiscid/trunk/src/disc_darwin.c	2008-03-11 07:44:34 UTC (rev 9762)
@@ -63,9 +63,7 @@
 
     // CD media are instances of class kIOCDMediaClass.
     classesToMatch = IOServiceMatching( kIOCDMediaClass );
-    if ( classesToMatch == NULL )
-        printf( "IOServiceMatching returned a NULL dictionary.\n" );
-    else
+    if ( classesToMatch != NULL )
     {
         // Each IOMedia object has a property with key kIOMediaEjectableKey
         // which is true if the media is indeed ejectable. So add this
@@ -120,8 +118,7 @@
     kern_return_t kernResult;
     io_iterator_t mediaIterator;
 
-    if (*defaultDevice)
-        return defaultDevice;
+    *defaultDevice = 0;
 
     kernResult = find_ejectable_cd_media( &mediaIterator );
     if ( kernResult != KERN_SUCCESS )
@@ -140,10 +137,10 @@
 	int i;
 	dk_cd_read_toc_t toc;
 	CDTOC *cdToc;
-  
-	if (device == NULL)
-	    device = defaultDevice;
 
+	if (device == NULL || *device == 0)
+        device = mb_disc_get_default_device_unportable();
+
     if (!*device)
     {
 	    snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,  "No CD-ROMs found. Please insert a disc and try again.");




More information about the MusicBrainz-commits mailing list