DVD disk detection

Paulo Richards <[email protected]>
Newsgroups gmane.comp.video.ogle.devel
Message-ID <[email protected]>
Hello.
I'm working on a multimedia player based on PC.
It will be only an administrator for external aplications that will handle the 
diferent tasks.
I like that when you insert a media on the drive, press play, and it play
For that i have to identify what kind of media is inserted, i have no problem 
with cdroms (audio, vcd, data cds with divx) using ioctl calls, but i can't 
identify dvds
I'm using libdvdread for that, i thougt that if i try to open the dvd, and 
it's succeded, it's a dvd, if not, is a cdrom.
But it dosn't work.
this is the code (C++):

dvd_reader_t *dvd;
dvd=DVDOpen("dev/hdc");
if (&dvd!=0)
 {
    DVDClose(dvd);
    return 4; //type 4, dvd 
  }
else 
//is cdrom, cdrom code..

What i'm doing wrong?, anyone have other idea for doing this?
any help will be really appreciate.

Thanks
Paulo Richards
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.