Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Frank Mayhar <frank <at> exit.com>
Subject: FreeBSD problem with import/ioaux.c.
Newsgroups: gmane.comp.video.transcode.devel
Date: Tuesday 4th April 2006 00:50:32 UTC (over 10 years ago)
Since FreeBSD doesn't do major/minor stuff any longer, the type
detection is totally broken.  Below is a patch that forces it to use the
name of the file, instead, iff it's a character-special device.  It
Works For Me(tm).  YMMV, but here it is.

--- ioaux.c	Mon Apr  3 17:43:15 2006
+++ ../../../ioaux.c	Mon Apr  3 17:39:45 2006
@@ -261,6 +261,24 @@
       /* char device could be several things, depending on system */
       /* *BSD DVD device? v4l? bktr? sunau? */
       if(S_ISCHR(fbuf.st_mode)) {
+# ifdef __FreeBSD__
+	  char *sl, *sn;
+
+	  if (name[0] == '/')
+	      sn = &name[1];
+	  else
+	      sn = name;
+	  if ((sl = strstr(sn, "/")) == NULL)
+	      sl = sn;
+	  if (strncmp(sl, "/acd", 4) == 0)
+	      return(TC_PROBE_PATH_ABSPATH);
+	  if (strncmp(sl, "/cd", 3) == 0)
+	      return(TC_PROBE_PATH_ABSPATH);
+	  if (strncmp(sl, "/bktr", 5) == 0)
+                  return(TC_PROBE_PATH_BKTR);
+	  if (strncmp(sl, "/dsp", 4) == 0)
+                  return(TC_PROBE_PATH_OSS);
+# endif
 	  switch (major(fbuf.st_rdev)) {
 #ifdef SYS_BSD
 # ifdef __OpenBSD__
@@ -270,14 +288,6 @@
                   return(TC_PROBE_PATH_SUNAU);
 	      case 49: /* bktr */
                   return(TC_PROBE_PATH_BKTR);
-# endif
-# ifdef __FreeBSD__
-              case 4: /* acd */
-                  return(TC_PROBE_PATH_ABSPATH);
-              case 229: /* bktr */
-                  return(TC_PROBE_PATH_BKTR);
-              case 0: /* OSS */
-                  return(TC_PROBE_PATH_OSS);
 # endif
               default: /* libdvdread uses "raw" disk devices here */
                   return(TC_PROBE_PATH_ABSPATH);

-- 
Frank Mayhar [email protected]     http://www.exit.com/
Exit Consulting                 http://www.gpsclock.com/
                                http://www.exit.com/blog/frank/
 
CD: 16ms