[vlc-devel] Re: default dvd/vcd/audio cd device (on windows)

Brian Robb vascy at hotmail.com
Sun Sep 4 22:24:35 CEST 2005

>Please patch against the latest SVN. In the latest SVN the device is no 
>longer hard-coded,
>by default it is left empty and libdvdcss will autodetect the first 
>available CD-ROM drive.

Well I've yet to work out how to use diff with svn.
(A diff file would probably make changing this more difficult since it's 
only one bit to add...)
Anyhow, the change is now:

In gui/wxwidgets/open.cpp
After the lines (Line 710):

    wxStaticText *label = new wxStaticText( panel, -1, wxU(_("Device name")) 
    disc_device = new wxTextCtrl( panel, DiscDevice_Event, wxT(""),
                                  wxDefaultPosition, wxDefaultSize,

Add the lines:

#ifdef WIN32
    if (1)
        char psz_default_device[3] = {0};

        // find the drive_name for the first cdrom drive, which is probably 
        // and put the drive_name into psz_default_device...
        for (char drive_letter = 'A'; drive_letter <= 'Z'; ++drive_letter) {
            char drive_name[3] = {drive_letter, ':', 0};
            UINT type = GetDriveType(drive_name);
            if (type == DRIVE_CDROM) {
                psz_default_device[0] = drive_letter;
                psz_default_device[1] = ':';

        if( strlen(psz_default_device) > 0 ) {
            if (disc_device) disc_device->SetValue( 
wxL2U(psz_default_device) );

So suppose this might be a point of a pointless addition
if the MRL of dvd:// would cause libdvdcss to play the first dvd drive it 

But if this is added it'll be great because I won't have to keep changing it 
to E: anymore... :)

This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html

More information about the vlc-devel mailing list