Package: cdcd
Version: 0.6.5-4
Severity: minor
Tags: patch
Hi!
I've had some problems ejecting the CD tray when
there was no CD in the drive. Looking at the code
for cdcd revealed that unless a CD was stopped
successfully the tray wouldn't be ejected. if no
CD is present it can't be stopped, at least not
successfully.
The tested patch below (against Debians cdcd
0.6.5-4, but also applies with offset against
upstreams cdcd 0.6.6) checks if a CD is presently
being played and stops it. It also unconditionally
ejects the CD tray just as one would expect cdcd
to work. ;-)
I have sent this mail both to Debians bug tracking
system and the upstream maintaianer.
/ Sebastian Rasmussen
--- cdcd-0.6.5-4/cmd_cdcd.c 2003-03-30 20:14:07.000000000 +0200
+++ cdcd-0.6.5-4.patched/cmd_cdcd.c 2005-07-25 19:06:00.000000000 +0200
@@ -491,8 +491,16 @@ int
cmd_open (char **argv)
{
NOARG;
- if (cd_stop (cd_desc) == 0)
- cd_eject (cd_desc);
+ struct disc_status status;
+
+ if (cd_poll (cd_desc, &status) &&
+ (status.status_mode == CDAUDIO_PLAYING ||
+ (status.status_mode == CDAUDIO_PAUSED)))
+ {
+ cd_stop(cd_desc);
+ }
+
+ cd_eject (cd_desc);
return XRET_NULL;
}
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]