mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-24 00:45:52 +00:00
Fix CD-ROM detection by using CDIOCGETVOL instead of CDIOCCAPABILITY as
the CD device test ioctl. While CDIOCCAPABILITY sounds pleasant enough, it's not actually implemented anywhere. Seems this is a pretty old issue (see kern/50687).
This commit is contained in:
parent
37dca5bd72
commit
cf040766ab
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=179537
@ -8,6 +8,7 @@
|
||||
|
||||
PORTNAME= gnome-media
|
||||
PORTVERSION= 2.16.1
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= audio gnome
|
||||
MASTER_SITES= ${MASTER_SITE_GNOME}
|
||||
MASTER_SITE_SUBDIR= sources/gnome-media/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/}
|
||||
|
30
audio/gnome-media/files/patch-gnome-cd_gst-cdrom.c
Normal file
30
audio/gnome-media/files/patch-gnome-cd_gst-cdrom.c
Normal file
@ -0,0 +1,30 @@
|
||||
--- gnome-cd/gst-cdrom.c.orig Tue Dec 12 00:18:40 2006
|
||||
+++ gnome-cd/gst-cdrom.c Tue Dec 12 00:23:17 2006
|
||||
@@ -41,13 +41,17 @@
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
-# define GST_CDROM_IOCTL_CDCAPABILITY_REQUEST CDIOCCAPABILITY
|
||||
+# define GST_CDROM_IOCTL_CDCAPABILITY_REQUEST CDIOCGETVOL
|
||||
+struct ioc_vol vol_value;
|
||||
+# define GST_CDROM_IOCTL_CDCAPABILITY_REQUEST_ADDR &vol_value
|
||||
# define GST_CDROM_IOCTL_EJECT_REQUEST CDIOCEJECT
|
||||
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
# define GST_CDROM_IOCTL_CDCAPABILITY_REQUEST CDIOCGETVOL
|
||||
+# define GST_CDROM_IOCTL_CDCAPABILITY_REQUEST_ADDR 0
|
||||
# define GST_CDROM_IOCTL_EJECT_REQUEST CDIOCEJECT
|
||||
#else
|
||||
# define GST_CDROM_IOCTL_CDCAPABILITY_REQUEST CDROM_GET_CAPABILITY
|
||||
+# define GST_CDROM_IOCTL_CDCAPABILITY_REQUEST_ADDR 0
|
||||
# define GST_CDROM_IOCTL_EJECT_REQUEST CDROMEJECT
|
||||
#endif
|
||||
|
||||
@@ -184,7 +188,7 @@ gst_cdrom_is_cdrom_device (GnomeCDRom *
|
||||
|
||||
fd = open (device, O_RDONLY | O_NONBLOCK);
|
||||
if (fd >= 0) {
|
||||
- if (ioctl (fd, GST_CDROM_IOCTL_CDCAPABILITY_REQUEST, 0) >= 0) {
|
||||
+ if (ioctl (fd, GST_CDROM_IOCTL_CDCAPABILITY_REQUEST, GST_CDROM_IOCTL_CDCAPABILITY_REQUEST_ADDR) >= 0) {
|
||||
res = TRUE;
|
||||
} else {
|
||||
GST_DEBUG ("ioctl() failed: %s", g_strerror (errno));
|
Loading…
Reference in New Issue
Block a user