pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/34053: multimedia/xine-lib: CDDA input plugin doesn't work



>Number:         34053
>Category:       pkg
>Synopsis:       multimedia/xine-lib: CDDA input plugin doesn't work
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 22 14:20:00 +0000 2006
>Originator:     Kimura Fuyuki
>Release:        3.99.23
>Organization:
>Environment:
NetBSD lapis.hadaly.org 3.99.23 NetBSD 3.99.23 (LAPIS) #45: Sat Jul 22 06:17:51 
JST 2006  
fuyuki%lapis.hadaly.org@localhost:/usr/obj/sys/arch/i386/compile/LAPIS i386
>Description:
CDDA input plugin does not work on NetBSD.

>How-To-Repeat:

>Fix:
Partially taken from libcdio/files/_cdio_netbsd.c. Tested with amarok
and xine-ui.

Index: distinfo
===================================================================
RCS file: /cvs/cvsroot/pkgsrc/multimedia/xine-lib/distinfo,v
retrieving revision 1.33
diff -u -r1.33 distinfo
--- distinfo    4 Jul 2006 16:42:38 -0000       1.33
+++ distinfo    22 Jul 2006 14:06:59 -0000
@@ -16,7 +16,7 @@
 SHA1 (patch-ak) = 34b41bf29efeb1d0fa29b22d419d7665e33d2cb2
 SHA1 (patch-al) = 9e3ad86a7d7f32e58de157fa37141138af10838e
 SHA1 (patch-am) = 10f6433a8549bdce60ace5dcbd51df85eaa7ea16
-SHA1 (patch-an) = feb2cefb7bd9b7c82d9579ed223213f4a9a75c47
+SHA1 (patch-an) = 758c64fdf768b962c5949b82a4137c9ce016ddcf
 SHA1 (patch-ao) = c5bbffceb34516951d2f19558bb6e082376ab195
 SHA1 (patch-ap) = aaf63024c1049c1f2175d9974367a6b84ac3028f
 SHA1 (patch-aq) = 6f486b79dcb14155f613df44b10ef8223b44167e
Index: patches/patch-an
===================================================================
RCS file: /cvs/cvsroot/pkgsrc/multimedia/xine-lib/patches/patch-an,v
retrieving revision 1.5
diff -u -r1.5 patch-an
--- patches/patch-an    21 Jun 2006 18:31:14 -0000      1.5
+++ patches/patch-an    22 Jul 2006 14:06:59 -0000
@@ -1,6 +1,6 @@
-$NetBSD: patch-an,v 1.5 2006/06/21 18:31:14 drochner Exp $
+$NetBSD$
 
---- src/input/input_cdda.c.orig        2006-06-21 13:33:04.000000000 +0200
+--- src/input/input_cdda.c.orig        2005-10-08 22:57:42.000000000 +0900
 +++ src/input/input_cdda.c
 @@ -32,7 +32,7 @@
  #include <unistd.h>
@@ -11,3 +11,161 @@
  #include <sys/param.h>
  #endif
  #ifdef HAVE_DIRENT_H
+@@ -613,14 +613,20 @@ static int read_cdrom_frames(cdda_input_
+   return 0;
+ }
+ 
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__NetBSD__)
+ 
+ #include <sys/cdio.h>
++#include <sys/scsiio.h>
+ 
+ static int read_cdrom_toc(int fd, cdrom_toc *toc) {
+ 
+   struct ioc_toc_header tochdr;
++#if defined(__FreeBSD__)
+   struct ioc_read_toc_single_entry tocentry;
++#elif defined(__NetBSD__)
++  struct ioc_read_toc_entry tocentry;
++  struct cd_toc_entry data;
++#endif
+   int i;
+ 
+   /* fetch the table of contents */
+@@ -646,13 +652,26 @@ static int read_cdrom_toc(int fd, cdrom_
+ 
+     memset(&tocentry, 0, sizeof(tocentry));
+ 
++#if defined(__FreeBSD__)
+     tocentry.track = i;
+     tocentry.address_format = CD_MSF_FORMAT;
+     if (ioctl(fd, CDIOREADTOCENTRY, &tocentry) == -1) {
+       perror("CDIOREADTOCENTRY");
+       return -1;
+     }
++#elif defined(__NetBSD__)
++    memset(&data, 0, sizeof(data));
++    tocentry.data_len = sizeof(data);
++    tocentry.data = &data;
++    tocentry.starting_track = i;
++    tocentry.address_format = CD_MSF_FORMAT;
++    if (ioctl(fd, CDIOREADTOCENTRYS, &tocentry) == -1) {
++      perror("CDIOREADTOCENTRYS");
++      return -1;
++    }
++#endif
+ 
++#if defined(__FreeBSD__)
+     toc->toc_entries[i-1].track_mode = (tocentry.entry.control & 0x04) ? 1 : 
0;
+     toc->toc_entries[i-1].first_frame_minute = tocentry.entry.addr.msf.minute;
+     toc->toc_entries[i-1].first_frame_second = tocentry.entry.addr.msf.second;
+@@ -661,18 +680,41 @@ static int read_cdrom_toc(int fd, cdrom_
+       (tocentry.entry.addr.msf.minute * CD_SECONDS_PER_MINUTE * 
CD_FRAMES_PER_SECOND) +
+       (tocentry.entry.addr.msf.second * CD_FRAMES_PER_SECOND) +
+        tocentry.entry.addr.msf.frame;
++#elif defined(__NetBSD__)
++    toc->toc_entries[i-1].track_mode = (tocentry.data->control & 0x04) ? 1 : 
0;
++    toc->toc_entries[i-1].first_frame_minute = tocentry.data->addr.msf.minute;
++    toc->toc_entries[i-1].first_frame_second = tocentry.data->addr.msf.second;
++    toc->toc_entries[i-1].first_frame_frame = tocentry.data->addr.msf.frame;
++    toc->toc_entries[i-1].first_frame =
++      (tocentry.data->addr.msf.minute * CD_SECONDS_PER_MINUTE * 
CD_FRAMES_PER_SECOND) +
++      (tocentry.data->addr.msf.second * CD_FRAMES_PER_SECOND) +
++       tocentry.data->addr.msf.frame;
++#endif
+   }
+ 
+   /* fetch the leadout as well */
+   memset(&tocentry, 0, sizeof(tocentry));
+ 
++#if defined(__FreeBSD__)
+   tocentry.track = CD_LEADOUT_TRACK;
+   tocentry.address_format = CD_MSF_FORMAT;
+   if (ioctl(fd, CDIOREADTOCENTRY, &tocentry) == -1) {
+     perror("CDIOREADTOCENTRY");
+     return -1;
+   }
++#elif defined(__NetBSD__)
++  memset(&data, 0, sizeof(data));
++  tocentry.data_len = sizeof(data);
++  tocentry.data = &data;
++  tocentry.starting_track = CD_LEADOUT_TRACK;
++  tocentry.address_format = CD_MSF_FORMAT;
++  if (ioctl(fd, CDIOREADTOCENTRYS, &tocentry) == -1) {
++    perror("CDIOREADTOCENTRYS");
++    return -1;
++  }
++#endif
+ 
++#if defined(__FreeBSD__)
+   toc->leadout_track.track_mode = (tocentry.entry.control & 0x04) ? 1 : 0;
+   toc->leadout_track.first_frame_minute = tocentry.entry.addr.msf.minute;
+   toc->leadout_track.first_frame_second = tocentry.entry.addr.msf.second;
+@@ -681,6 +723,16 @@ static int read_cdrom_toc(int fd, cdrom_
+     (tocentry.entry.addr.msf.minute * CD_SECONDS_PER_MINUTE * 
CD_FRAMES_PER_SECOND) +
+     (tocentry.entry.addr.msf.second * CD_FRAMES_PER_SECOND) +
+      tocentry.entry.addr.msf.frame;
++#elif defined(__NetBSD__)
++  toc->leadout_track.track_mode = (tocentry.data->control & 0x04) ? 1 : 0;
++  toc->leadout_track.first_frame_minute = tocentry.data->addr.msf.minute;
++  toc->leadout_track.first_frame_second = tocentry.data->addr.msf.second;
++  toc->leadout_track.first_frame_frame = tocentry.data->addr.msf.frame;
++  toc->leadout_track.first_frame =
++    (tocentry.data->addr.msf.minute * CD_SECONDS_PER_MINUTE * 
CD_FRAMES_PER_SECOND) +
++    (tocentry.data->addr.msf.second * CD_FRAMES_PER_SECOND) +
++     tocentry.data->addr.msf.frame;
++#endif
+ 
+   return 0;
+ }
+@@ -689,12 +741,12 @@ static int read_cdrom_frames(cdda_input_
+   unsigned char *data) {
+ 
+   int fd = this_gen->fd;
+-#if  __FreeBSD_version < 501106
+-  struct ioc_read_audio cdda;
+-#endif
+ 
+   while( num_frames ) {
++#if defined(__FreeBSD__)
+ #if  __FreeBSD_version < 501106
++    struct ioc_read_audio cdda;
++
+     cdda.address_format = CD_MSF_FORMAT;
+     cdda.address.msf.minute = frame / CD_SECONDS_PER_MINUTE / 
CD_FRAMES_PER_SECOND;
+     cdda.address.msf.second = (frame / CD_FRAMES_PER_SECOND) % 
CD_SECONDS_PER_MINUTE;
+@@ -712,6 +764,33 @@ static int read_cdrom_frames(cdda_input_
+       perror("CDIOCREADAUDIO");
+       return -1;
+     }
++#elif defined(__NetBSD__)
++    scsireq_t req;
++    int nblocks = 1;
++
++    memset(&req, 0, sizeof(req));
++    req.cmd[0] = 0xbe;
++    req.cmd[1] = 0;
++    req.cmd[2] = (frame >> 24) & 0xff;
++    req.cmd[3] = (frame >> 16) & 0xff;
++    req.cmd[4] = (frame >> 8) & 0xff;
++    req.cmd[5] = (frame >> 0) & 0xff;
++    req.cmd[6] = (nblocks >> 16) & 0xff;
++    req.cmd[7] = (nblocks >> 8) & 0xff;
++    req.cmd[8] = (nblocks >> 0) & 0xff;
++    req.cmd[9] = 0x78;
++    req.cmdlen = 10;
++
++    req.datalen = nblocks * CD_RAW_FRAME_SIZE;
++    req.databuf = data;
++    req.timeout = 10000;
++    req.flags = SCCMD_READ;
++
++    if(ioctl(fd, SCIOCCOMMAND, &req) < 0) {
++      perror("SCIOCCOMMAND");
++      return -1;
++    }
++#endif
+     
+     data += CD_RAW_FRAME_SIZE;
+     frame++;




Home | Main Index | Thread Index | Old Index