[totem-pl-parser] disc: Fix media detection on loopback devices



commit ba8ee7f0e957eacc990318ed2580a3f27e58fe3e
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Mar 29 18:08:41 2013 +0100

    disc: Fix media detection on loopback devices
    
    We think they're physical media, but they don't actually have
    a drive associated, so they cannot be removable.
    
    This fixes: ./disc /dev/loop0
    when an ISO is loopback mounted with udisks2

 plparse/totem-disc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plparse/totem-disc.c b/plparse/totem-disc.c
index d480ee5..83d1137 100644
--- a/plparse/totem-disc.c
+++ b/plparse/totem-disc.c
@@ -448,8 +448,10 @@ cd_cache_has_medium (CdCache *cache)
     return FALSE;
 
   drive = g_volume_get_drive (cache->volume);
-  if (drive == NULL)
-    return FALSE;
+  if (drive == NULL) {
+    /* No drive, so not something that can have a medium */
+    return TRUE;
+  }
   retval = g_drive_has_media (drive);
   g_object_unref (drive);
 


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