Freeze during Reading file information from a CD-ROM

You found an error in the program ? Report it here
Post Reply
trekkie

Freeze during Reading file information from a CD-ROM

Post by trekkie »

It has happened to me several times that while trying the Add a movie to the database from a CD the reading process hung. That means i got to the "Select file to get information from " window . But Then the program froze.

The only way to close the program was using CTRL-ALT-DEL but then no more access to the CD-ROM was available from ANY other program i tried. ( only reboot helped)

I am using version 3.4.1 on Win ME.

My Guess is that the file opening process hungs because of problem accessing the CD .Maybe it's something to do with the ASPI drivers.

I Would suggest adding timeout during a read from CD-ROM drives.

:ha:
antp
Site Admin
Posts: 9675
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Very strange, but the problem is linked to Windows more than the program. Even if I put a timeout, Windows will block the part of the program that tries to access to the CD, and I do not really see what I could do.
If there's an error Windows should answer to the program that the file cannot be accessed, not lock it forever.
Does it happen only with CDs or also with the AVI if it is in the hard disk ? In the second case it is probably a bug in the program, that I could resolve.
trekkie

Freeze During Read File Information From CD-ROM

Post by trekkie »

No. It Only Happens when accessing CD-ROMS.
It never happened to me with any other program.(Accessing CD-ROM and got stuck) so I guess it's the way you access the drive.
Are you are using a direct Windows API or Delphi VCL unit ?
Maybe it's a built-in bug in the unit .

If you use timeout, the function MAY return with an error code.
Thus , At least I can exit your program and restart the adding process without blocking CD-ROM access.
antp
Site Admin
Posts: 9675
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I do that to open the file :

Code: Select all

  FileHandle := CreateFile(PChar(AVIFileName), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_ALWAYS, 0, 0);
  if FileHandle = INVALID_HANDLE_VALUE then
    Exit;
  try
    VideoFile := THandleStream.Create(FileHandle);
(I just saw that I should put OPEN_EXISTING instead of OPEN_ALWAYS, but that should not change anything)
Post Reply