From: Derk-Jan Hartman Date: Thu, 17 Feb 2005 17:30:36 +0000 (+0000) Subject: * playlist.m: X-Git-Tag: 0.8.2~1131 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=beb1ae86c994026e553f4e5ae2f1773a0c8dbb36;p=vlc * playlist.m: - 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. --- diff --git a/modules/gui/macosx/macosx.m b/modules/gui/macosx/macosx.m index 7ef816fc4b..331d0eca3d 100644 --- a/modules/gui/macosx/macosx.m +++ b/modules/gui/macosx/macosx.m @@ -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(); diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index 4fb380cbc8..520029a491 100644 --- a/modules/gui/macosx/playlist.m +++ b/modules/gui/macosx/playlist.m @@ -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 )