summaryrefslogtreecommitdiff
path: root/graphics/xine-lib/patches/patch-ae
blob: ac510e6a6021090ca7685be3e80016ed76502b05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
$NetBSD: patch-ae,v 1.2 2003/04/11 09:19:54 rh Exp $

--- src/input/input_vcd.c.orig	2003-04-07 02:17:07.000000000 +1000
+++ src/input/input_vcd.c
@@ -32,6 +32,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
+#include <sys/param.h>
 #include <string.h>
 #ifdef HAVE_LINUX_CDROM_H
 # include <linux/cdrom.h>
@@ -94,7 +95,7 @@ typedef struct {
 #if defined (__linux__) || defined(__sun)
   struct cdrom_tochdr    tochdr;
   struct cdrom_tocentry  tocent[100];
-#elif defined (__FreeBSD__)
+#elif (defined(BSD) && BSD >= 199306)
   struct ioc_toc_header  tochdr;
   struct cd_toc_entry    *tocent;
   off_t                  cur_sec;
@@ -119,7 +120,7 @@ typedef struct {
 
   int                    cur_track;
 
-#if defined (__linux__) || defined(__sun) || defined(__FreeBSD__)
+#if defined (__linux__) || defined(__sun) || (defined(BSD) && BSD >= 199306)
   uint8_t                cur_min, cur_sec, cur_frame;
 #endif
 
@@ -176,7 +177,7 @@ static int input_vcd_read_toc (vcd_input
 
   return 0;
 }
-#elif defined (__FreeBSD__)
+#elif (defined(BSD) && BSD >= 199306)
 static int input_vcd_read_toc (vcd_input_class_t *this, int fd) {
 
   struct ioc_read_toc_entry te;
@@ -388,7 +389,7 @@ static off_t vcd_plugin_read (input_plug
   memcpy (buf, data.data, VCDSECTORSIZE); /* FIXME */
   return VCDSECTORSIZE;
 }
-#elif defined (__FreeBSD__)
+#elif (defined(BSD) && BSD >= 199306)
 static off_t vcd_plugin_read (input_plugin_t *this_gen, 
 				char *buf, off_t nlen) {
   vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
@@ -526,7 +527,7 @@ static buf_element_t *vcd_plugin_read_bl
   memcpy (buf->mem, data.data, VCDSECTORSIZE); /* FIXME */
   return buf;
 }
-#elif defined (__FreeBSD__)
+#elif (defined(BSD) && BSD >= 199306)
 static buf_element_t *vcd_plugin_read_block (input_plugin_t *this_gen, 
 					     fifo_buffer_t *fifo, off_t nlen) {
   
@@ -684,7 +685,7 @@ static off_t vcd_plugin_seek (input_plug
 
   return offset ; /* FIXME */
 }
-#elif defined (__FreeBSD__)
+#elif (defined(BSD) && BSD >= 199306)
 static off_t vcd_plugin_seek (input_plugin_t *this_gen, 
 				off_t offset, int origin) {
 
@@ -758,7 +759,7 @@ static off_t vcd_plugin_get_length (inpu
 
   return (off_t) 0;
 }
-#elif defined (__FreeBSD__)
+#elif (defined(BSD) && BSD >= 199306)
 static off_t vcd_plugin_get_length (input_plugin_t *this_gen) {
   vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen;
   off_t len ;
@@ -886,6 +887,10 @@ static input_plugin_t *open_plugin (inpu
   this->cur_min   = this->cls->tocent[this->cur_track].cdte_addr.msf.minute;
   this->cur_sec   = this->cls->tocent[this->cur_track].cdte_addr.msf.second;
   this->cur_frame = this->cls->tocent[this->cur_track].cdte_addr.msf.frame;
+#elif defined(__NetBSD__)
+  this->cur_min   = this->cls->tocent[this->cur_track+1 - this->cls->tochdr.starting_track].addr.msf.minute;
+  this->cur_sec   = this->cls->tocent[this->cur_track+1 - this->cls->tochdr.starting_track].addr.msf.second;
+  this->cur_frame = this->cls->tocent[this->cur_track+1 - this->cls->tochdr.starting_track].addr.msf.frame;
 #elif defined (__FreeBSD__)
   {
     int bsize = 2352;