Re: DVD disk detection
H}kan Hjort <[email protected]>
| Newsgroups | gmane.comp.video.ogle.devel |
|---|---|
| Message-ID | <[email protected]> |
Sat Mar 15 2003, Paulo Richards wrote:
> 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");
That would be "/dev/hdc" right?
> if (&dvd!=0)
Do if (dvd != NULL)
Don't test the address of the dvd pointer, but rather test if the
pointer value is not null.. the address will always be != NULL.
Your compiler should have given you a warning here.
> {
> 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.
>
--
Håkan Hjort