Author: duncan
Date: Tue Aug 21 13:40:20 2007
New Revision: 9832
Log:
[ 1775892 ] Eject error crashes Freevo
Patch from Gorka Olaizola applied
Modified:
branches/rel-1/freevo/ChangeLog
branches/rel-1/freevo/src/plugins/rom_drives.py
Modified: branches/rel-1/freevo/ChangeLog
==============================================================================
--- branches/rel-1/freevo/ChangeLog (original)
+++ branches/rel-1/freevo/ChangeLog Tue Aug 21 13:40:20 2007
@@ -24,6 +24,7 @@
* Updated a submenu selection when there is only one action to execute the
action (F#1774569)
* Updated tv favourite handling and programme item to provide a consistant
interface (F#1776909)
* Updated video item to include the full description (F#1777187)
+ * Fixed cd-rom drives eject causing a crash (B#1775892)
* Fixed tvmenu crashing because of the search plug-in (B#1774544)
== Release 1.7.3 (2007-08-01) ==
Modified: branches/rel-1/freevo/src/plugins/rom_drives.py
==============================================================================
--- branches/rel-1/freevo/src/plugins/rom_drives.py (original)
+++ branches/rel-1/freevo/src/plugins/rom_drives.py Tue Aug 21 13:40:20 2007
@@ -59,13 +59,24 @@
CDS_NO_DISC = 1
CDS_DISC_OK = 4
else:
- # strange ioctrls missing
+ # see linux/cdrom.h and Documentation/ioctl/cdrom.txt
CDROMEJECT = 0x5309
CDROMCLOSETRAY = 0x5319
CDROM_DRIVE_STATUS = 0x5326
CDROM_SELECT_SPEED = 0x5322
+ CDROM_LOCKDOOR = 0x5329 # lock or unlock door
+ CDS_NO_INFO = 0
CDS_NO_DISC = 1
+ CDS_TRAY_OPEN = 2
+ CDS_DRIVE_NOT_READY = 3
CDS_DISC_OK = 4
+ CDS_AUDIO = 100
+ CDS_DATA_1 = 101
+ CDS_DATA_2 = 102
+ CDS_XA_2_1 = 103
+ CDS_XA_2_2 = 104
+ CDS_MIXED = 105
+
import config
@@ -293,13 +304,16 @@
try:
fd = os.open(self.devicename, os.O_RDONLY | os.O_NONBLOCK)
- if os.uname()[0] == 'FreeBSD':
- s = ioctl(fd, CDIOCEJECT, 0)
- else:
- s = ioctl(fd, CDROMEJECT)
- self.tray_open = 1
- finally:
- os.close(fd)
+ try:
+ if os.uname()[0] == 'FreeBSD':
+ s = ioctl(fd, CDIOCEJECT, 0)
+ else:
+ s = ioctl(fd, CDROMEJECT)
+ self.tray_open = 1
+ finally:
+ os.close(fd)
+ except Exception, e:
+ _debug_('Cannot open "%s": %s"' % (self.devicename, e),
config.DWARNING)
if notify:
pop.destroy()
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog