]> git.sesse.net Git - vlc/commitdiff
* playlist.m:
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 17 Feb 2005 17:30:36 +0000 (17:30 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 17 Feb 2005 17:30:36 +0000 (17:30 +0000)
  - Make sure cd/dvd's can be D&D and recognized. (cdda autodetection still fails)
  - Make sure disk names are retrieved when opening cd/dvd's
* macosx.m: Give the submodules proper descriptions.

modules/gui/macosx/macosx.m
modules/gui/macosx/playlist.m

index 7ef816fc4bc3d28b9e9e81488ab1f9a61288bc28..331d0eca3d2ee3d4cd14e23ffa2c28765f51498e 100644 (file)
@@ -68,12 +68,13 @@ void E_(CloseVideoGL) ( vlc_object_t * );
         "borders (OpenGL only)." )
 
 vlc_module_begin();
-    set_description( _("Mac OS X interface, sound and video") );
+    set_description( _("Mac OS X interface") );
     set_capability( "interface", 100 );
     set_callbacks( E_(OpenIntf), E_(CloseIntf) );
     set_category( CAT_INTERFACE );
     set_subcategory( SUBCAT_INTERFACE_GENERAL );
     add_submodule();
+        set_description( _("Quartz video") );
         set_capability( "video output", 100 );
         set_callbacks( E_(OpenVideoQT), E_(CloseVideoQT) );
         add_integer( "macosx-vdev", 0, NULL, VDEV_TEXT, VDEV_LONGTEXT,
@@ -85,6 +86,7 @@ vlc_module_begin();
         add_bool( "macosx-fill", 0, NULL, FILL_TEXT, FILL_LONGTEXT,
                   VLC_TRUE );
     add_submodule();
+        set_description( _("Mac OS X OpenGL") );
         set_capability( "opengl provider", 100 );
         set_callbacks( E_(OpenVideoGL), E_(CloseVideoGL) );
 vlc_module_end();
index 4fb380cbc8795d25a67cb95daa8b6e056b12d9de..520029a49154b71375a0766793f95f7b9110781c 100644 (file)
@@ -518,6 +518,29 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
         o_name = (NSString *)[o_one_item objectForKey: @"ITEM_NAME"];
         o_options = (NSArray *)[o_one_item objectForKey: @"ITEM_OPTIONS"];
 
+        /* Find the name for a disc entry ( i know, can you believe the trouble?) */
+        if( ( !o_name || [o_name isEqualToString:@""] ) && [o_uri rangeOfString: @"/dev/"].location != NSNotFound )
+        {
+            int i_count, i_index;
+            struct statfs *mounts = NULL;
+            
+            i_count = getmntinfo (&mounts, MNT_NOWAIT);
+            /* getmntinfo returns a pointer to static data. Do not free. */
+            for( i_index = 0 ; i_index < i_count; i_index++ )
+            {
+                NSMutableString *o_temp, *o_temp2;
+                o_temp = [NSMutableString stringWithString: o_uri];
+                o_temp2 = [NSMutableString stringWithCString: mounts[i_index].f_mntfromname];
+                [o_temp replaceOccurrencesOfString: @"/dev/rdisk" withString: @"/dev/disk" options:NULL range:NSMakeRange(0, [o_temp length]) ];
+                [o_temp2 replaceOccurrencesOfString: @"s0" withString: @"" options:NULL range:NSMakeRange(0, [o_temp2 length]) ];
+                [o_temp2 replaceOccurrencesOfString: @"s1" withString: @"" options:NULL range:NSMakeRange(0, [o_temp2 length]) ];
+
+                if( strstr( [o_temp fileSystemRepresentation], [o_temp2 fileSystemRepresentation] ) != NULL )
+                {
+                    o_name = [[NSFileManager defaultManager] displayNameAtPath: [NSString stringWithCString:mounts[i_index].f_mntonname]];
+                }
+            }
+        }
         /* If no name, then make a guess */
         if( !o_name) o_name = [[NSFileManager defaultManager] displayNameAtPath: o_uri];
 
@@ -529,10 +552,16 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
             /* Converts mountpoint to a /dev file */
             struct statfs *buf;
             char *psz_dev;
+            NSMutableString *o_temp;
+
             buf = (struct statfs *) malloc (sizeof(struct statfs));
             statfs( [o_uri fileSystemRepresentation], buf );
             psz_dev = strdup(buf->f_mntfromname);
-            o_uri = [NSString stringWithCString: psz_dev ];
+            o_temp = [NSMutableString stringWithCString: psz_dev ];
+            [o_temp replaceOccurrencesOfString: @"/dev/disk" withString: @"/dev/rdisk" options:NULL range:NSMakeRange(0, [o_temp length]) ];
+            [o_temp replaceOccurrencesOfString: @"s0" withString: @"" options:NULL range:NSMakeRange(0, [o_temp length]) ];
+            [o_temp replaceOccurrencesOfString: @"s1" withString: @"" options:NULL range:NSMakeRange(0, [o_temp length]) ];
+            o_uri = o_temp;
         }
 
         if( o_options && [o_options count] > 0 )