annotate libmpdvdkit2/libdvdread_changes.diff @ 18029:9850cdb149f4

Slight grammar and wording fixes.
author corey
date Mon, 03 Apr 2006 04:58:34 +0000
parents f0f54034c7e9
children 50b3c9a53e21
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
1 diff -Naur dvdread.orig/bswap.h dvdread/bswap.h
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
2 --- dvdread.orig/bswap.h 2005-06-23 00:18:54.000000000 +0200
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
3 +++ dvdread/bswap.h 2005-06-23 00:19:10.000000000 +0200
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
4 @@ -20,8 +20,6 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
5 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
6 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
7
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
8 -#include <config.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
9 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
10 #if defined(WORDS_BIGENDIAN)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
11 /* All bigendian systems are fine, just ignore the swaps. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
12 #define B2N_16(x) (void)(x)
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
13 @@ -59,13 +57,57 @@
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
14 #define B2N_32(x) x = be32toh(x)
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
15 #define B2N_64(x) x = be64toh(x)
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
16
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
17 +#elif defined(__DragonFly__)
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
18 +#include <sys/endian.h>
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
19 +#define B2N_16(x) x = be16toh(x)
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
20 +#define B2N_32(x) x = be32toh(x)
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
21 +#define B2N_64(x) x = be64toh(x)
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
22 +
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
23 +#elif defined(ARCH_X86)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
24 +inline static unsigned short bswap_16(unsigned short x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
25 +{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
26 + __asm("xchgb %b0,%h0" :
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
27 + "=q" (x) :
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
28 + "0" (x));
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
29 + return x;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
30 +}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
31 +#define B2N_16(x) x = bswap_16(x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
32 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
33 +inline static unsigned int bswap_32(unsigned int x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
34 +{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
35 + __asm(
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
36 +#if __CPU__ > 386
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
37 + "bswap %0":
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
38 + "=r" (x) :
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
39 +#else
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
40 + "xchgb %b0,%h0\n"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
41 + " rorl $16,%0\n"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
42 + " xchgb %b0,%h0":
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
43 + "=q" (x) :
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
44 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
45 + "0" (x));
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
46 + return x;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
47 +}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
48 +#define B2N_32(x) x = bswap_32(x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
49 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
50 +inline static unsigned long long int bswap_64(unsigned long long int x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
51 +{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
52 + register union { __extension__ uint64_t __ll;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
53 + uint32_t __l[2]; } __x;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
54 + asm("xchgl %0,%1":
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
55 + "=r"(__x.__l[0]),"=r"(__x.__l[1]):
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
56 + "0"(bswap_32((unsigned long)x)),"1"(bswap_32((unsigned long)(x>>32))));
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
57 + return __x.__ll;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
58 +}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
59 +#define B2N_64(x) x = bswap_64(x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
60 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
61 /* This is a slow but portable implementation, it has multiple evaluation
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
62 * problems so beware.
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
63 * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
64 * functionality!
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
65 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
66
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
67 -#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
68 +#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(__CYGWIN__)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
69 #define B2N_16(x) \
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
70 x = ((((x) & 0xff00) >> 8) | \
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
71 (((x) & 0x00ff) << 8))
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
72 diff -Naur dvdread.orig/.cvsignore dvdread/.cvsignore
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
73 diff -Naur dvdread.orig/dvd_input.c dvdread/dvd_input.c
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
74 --- dvdread.orig/dvd_input.c 2005-06-23 00:18:54.000000000 +0200
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
75 +++ dvdread/dvd_input.c 2005-06-23 00:30:23.000000000 +0200
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
76 @@ -37,7 +37,7 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
77
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
78 #ifdef HAVE_DVDCSS_DVDCSS_H
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
79 /* linking to libdvdcss */
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
80 -#include <dvdcss/dvdcss.h>
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
81 +#include "dvdcss.h"
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
82 #define DVDcss_open(a) dvdcss_open((char*)(a))
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
83 #define DVDcss_close dvdcss_close
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
84 #define DVDcss_seek dvdcss_seek
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
85 @@ -74,7 +74,7 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
86 dvd_input_t dev;
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
87
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
88 /* Allocate the handle structure */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
89 - dev = (dvd_input_t) malloc(sizeof(dvd_input_t));
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
90 + dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s));
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
91 if(dev == NULL) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
92 fprintf(stderr, "libdvdread: Could not allocate memory.\n");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
93 return NULL;
17786
f0f54034c7e9 fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents: 17313
diff changeset
94 @@ -158,7 +158,7 @@
f0f54034c7e9 fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents: 17313
diff changeset
95 dvd_input_t dev;
f0f54034c7e9 fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents: 17313
diff changeset
96
f0f54034c7e9 fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents: 17313
diff changeset
97 /* Allocate the library structure */
f0f54034c7e9 fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents: 17313
diff changeset
98 - dev = (dvd_input_t) malloc(sizeof(dvd_input_t));
f0f54034c7e9 fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents: 17313
diff changeset
99 + dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s));
f0f54034c7e9 fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents: 17313
diff changeset
100 if(dev == NULL) {
f0f54034c7e9 fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents: 17313
diff changeset
101 fprintf(stderr, "libdvdread: Could not allocate memory.\n");
f0f54034c7e9 fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents: 17313
diff changeset
102 return NULL;
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
103 @@ -320,8 +320,10 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
104 fprintf(stderr, "DVDCSS_METHOD %s\n", psz_method);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
105 fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
106 */
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
107 + /*
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
108 fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n",
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
109 *dvdcss_version);
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
110 + */
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
111
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
112 /* libdvdcss wrapper functions */
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
113 dvdinput_open = css_open;
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
114 diff -Naur dvdread.orig/dvd_input.h dvdread/dvd_input.h
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
115 diff -Naur dvdread.orig/dvd_reader.c dvdread/dvd_reader.c
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
116 --- dvdread.orig/dvd_reader.c 2005-06-23 00:18:54.000000000 +0200
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
117 +++ dvdread/dvd_reader.c 2005-06-23 00:19:10.000000000 +0200
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
118 @@ -32,24 +32,36 @@
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
119 #include <limits.h>
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
120 #include <dirent.h>
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
121
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
122 -#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__)
17311
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
123 +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DARWIN__) || defined(__DragonFly__)
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
124 #define SYS_BSD 1
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
125 #endif
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
126
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
127 #if defined(__sun)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
128 #include <sys/mnttab.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
129 +#elif defined(hpux)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
130 +#include </usr/conf/h/mnttab.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
131 #elif defined(SYS_BSD)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
132 #include <fstab.h>
15535
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
133 -#elif defined(__linux__)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
134 +#elif defined(__linux__) || defined(__CYGWIN__)
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
135 #include <mntent.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
136 #endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
137
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
138 +#ifdef __MINGW32__
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
139 +#include <sys/timeb.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
140 +static void gettimeofday(struct timeval* t,void* timezone){
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
141 + struct timeb timebuffer;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
142 + ftime( &timebuffer );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
143 + t->tv_sec=timebuffer.time;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
144 + t->tv_usec=1000*timebuffer.millitm;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
145 +}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
146 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
147 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
148 #include "dvd_udf.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
149 #include "dvd_input.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
150 #include "dvd_reader.h"
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
151 #include "md5.h"
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
152
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
153 -#define DEFAULT_UDF_CACHE_LEVEL 1
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
154 +#define DEFAULT_UDF_CACHE_LEVEL 0
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
155
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
156 struct dvd_reader_s {
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
157 /* Basic information. */
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
158 @@ -194,6 +206,13 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
159 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
160
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
161
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
162 +#ifndef HAVE_MPLAYER
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
163 + #include "get_path.c"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
164 +#else
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
165 + extern char * get_path( char * filename );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
166 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
167 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
168 +//extern char * dvdcss_cache_dir;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
169
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
170 /**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
171 * Open a DVD image or block device file.
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
172 @@ -278,11 +297,16 @@
16510
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
173 Darwin /dev/rdisk0, it needs to be the raw device
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
174 BSD/OS /dev/sr0c (if not mounted) or /dev/rsr0c ('c' any letter will do) */
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
175 static char *bsd_block2char( const char *path )
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
176 +#if defined(__FreeBSD__)
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
177 +{
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
178 + return (char *) strdup( path );
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
179 +}
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
180 +#else
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
181 {
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
182 char *new_path;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
183
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
184 /* If it doesn't start with "/dev/" or does start with "/dev/r" exit */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
185 - if( !strncmp( path, "/dev/", 5 ) || strncmp( path, "/dev/r", 6 ) )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
186 + if( strncmp( path, "/dev/", 5 ) || !strncmp( path, "/dev/r", 6 ) )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
187 return (char *) strdup( path );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
188
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
189 /* Replace "/dev/" with "/dev/r" */
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
190 @@ -292,6 +316,7 @@
16510
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
191
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
192 return new_path;
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
193 }
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
194 +#endif /* __FreeBSD__ */
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
195 #endif
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
196
881e136ebf1a add FreeBSD default cd/dvd devices
nexus
parents: 15875
diff changeset
197 dvd_reader_t *DVDOpen( const char *path )
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
198 @@ -303,6 +328,16 @@
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
199 if( path == NULL )
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
200 return 0;
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
201
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
202 +#ifdef WIN32
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
203 + /* Stat doesn't work on devices under mingwin/cygwin. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
204 + if( path[0] && path[1] == ':' && path[2] == '\0' )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
205 + {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
206 + /* Don't try to stat the file */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
207 + fileinfo.st_mode = S_IFBLK;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
208 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
209 + else
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
210 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
211 + {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
212 ret = stat( path, &fileinfo );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
213 if( ret < 0 ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
214 /* If we can't stat the file, give up */
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
215 @@ -310,6 +345,7 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
216 perror("");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
217 return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
218 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
219 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
220
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
221 /* Try to open libdvdcss or fall back to standard functions */
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
222 have_css = dvdinput_setup();
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
223 @@ -335,7 +371,7 @@
15535
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
224 char *path_copy;
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
225 #if defined(SYS_BSD)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
226 struct fstab* fe;
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
227 -#elif defined(__sun) || defined(__linux__)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
228 +#elif defined(__sun) || defined(__linux__) || defined(__CYGWIN__)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
229 FILE *mntfile;
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
230 #endif
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
231
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
232 @@ -350,7 +386,9 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
233 if( cdir >= 0 ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
234 chdir( path_copy );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
235 new_path = getcwd( NULL, PATH_MAX );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
236 +#ifndef __MINGW32__
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
237 fchdir( cdir );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
238 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
239 close( cdir );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
240 if( new_path ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
241 free( path_copy );
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
242 @@ -406,7 +444,7 @@
15535
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
243 }
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
244 fclose( mntfile );
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
245 }
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
246 -#elif defined(__linux__)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
247 +#elif defined(__linux__) || defined(__CYGWIN__)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
248 mntfile = fopen( MOUNTED, "r" );
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
249 if( mntfile ) {
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
250 struct mntent *me;
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
251 @@ -425,6 +463,9 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
252 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
253 fclose( mntfile );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
254 }
15535
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
255 +#elif defined(__MINGW32__)
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
256 + dev_name = strdup(path);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
257 + auth_drive = DVDOpenImageFile( path, have_css );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
258 #endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
259 if( !dev_name ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
260 fprintf( stderr, "libdvdread: Couldn't find device name.\n" );
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
261 @@ -615,8 +656,8 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
262 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
263
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
264 if( dvd->css_state == 1 /* Need key init */ ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
265 - initAllCSSKeys( dvd );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
266 - dvd->css_state = 2;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
267 +// initAllCSSKeys( dvd );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
268 +// dvd->css_state = 2;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
269 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
270 /*
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
271 if( dvdinput_title( dvd_file->dvd->dev, (int)start ) < 0 ) {
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
272 @@ -915,7 +956,7 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
273 return (ssize_t)ret;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
274 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
275
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
276 -int32_t DVDFileSeek( dvd_file_t *dvd_file, int32_t offset )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
277 +int DVDFileSeek( dvd_file_t *dvd_file, int offset )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
278 {
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
279 /* Check arguments. */
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
280 if( dvd_file == NULL || offset < 0 )
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
281 diff -Naur dvdread.orig/dvdread_internal.h dvdread/dvdread_internal.h
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
282 --- dvdread.orig/dvdread_internal.h 2005-06-23 00:18:54.000000000 +0200
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
283 +++ dvdread/dvdread_internal.h 2005-06-23 00:19:10.000000000 +0200
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
284 @@ -2,11 +2,7 @@
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
285 #define DVDREAD_INTERNAL_H
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
286
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
287
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
288 -#define CHECK_VALUE(arg) \
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
289 - if(!(arg)) { \
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
290 - fprintf(stderr, "\n*** libdvdread: CHECK_VALUE failed in %s:%i ***" \
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
291 - "\n*** for %s ***\n\n", \
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
292 - __FILE__, __LINE__, # arg ); \
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
293 - }
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
294 +#define CHECK_VALUE(arg)
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
295 +
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
296
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
297 #endif /* DVDREAD_INTERNAL_H */
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
298 diff -Naur dvdread.orig/dvd_udf.c dvdread/dvd_udf.c
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
299 --- dvdread.orig/dvd_udf.c 2005-06-23 00:18:54.000000000 +0200
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
300 +++ dvdread/dvd_udf.c 2005-06-23 00:19:10.000000000 +0200
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
301 @@ -33,7 +33,9 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
302 #include <stdio.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
303 #include <stdlib.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
304 #include <string.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
305 +#ifndef __MINGW32__
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
306 #include <sys/ioctl.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
307 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
308 #include <sys/types.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
309 #include <sys/stat.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
310 #include <unistd.h>
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
311 diff -Naur dvdread.orig/ifo_print.c dvdread/ifo_print.c
16659
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
312 --- dvdread.orig/ifo_print.c 30 Jun 2005 22:48:26 -0000 1.4
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
313 +++ dvdread/ifo_print.c 3 Oct 2005 14:29:01 -0000 1.5
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
314 @@ -761,14 +761,14 @@
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
315 ifoPrint_USER_OPS(&pgc->prohibited_ops);
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
316
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
317 for(i = 0; i < 8; i++) {
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
318 - if(pgc->audio_control[i] & 0x8000) { /* The 'is present' bit */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
319 + if(pgc->audio_control[i].present) {
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
320 printf("Audio stream %i control: %04x\n",
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
321 i, pgc->audio_control[i]);
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
322 }
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
323 }
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
324
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
325 for(i = 0; i < 32; i++) {
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
326 - if(pgc->subp_control[i] & 0x80000000) { /* The 'is present' bit */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
327 + if(pgc->subp_control[i].present) {
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
328 printf("Subpicture stream %2i control: %08x\n",
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
329 i, pgc->subp_control[i]);
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
330 }
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
331
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
332 diff -Naur dvdread.orig/ifo_print.h dvdread/ifo_print.h
17311
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
333 --- dvdread/ifo_print.h 2002-08-15 22:13:21.000000000 +0200
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
334 +++ /home/diego/src/mplayer/vanilla/libmpdvdkit2/ifo_print.h 2005-12-29 13:13:21.000000000 +0100
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
335 @@ -20,8 +20,8 @@
17311
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
336 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
337 */
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
338
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
339 -#include <dvdread/ifo_types.h>
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
340 -#include <dvdread/dvd_reader.h>
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
341 +#include "ifo_types.h"
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
342 +#include "dvd_reader.h"
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
343
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
344 #ifdef __cplusplus
b1b8ff93dc0c Update with current changes.
diego
parents: 16847
diff changeset
345 extern "C" {
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
346 diff -Naur dvdread.orig/ifo_read.c dvdread/ifo_read.c
16659
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
347 --- dvdread.orig/ifo_read.c 30 Jun 2005 22:48:26 -0000 1.4
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
348 +++ dvdread/ifo_read.c 3 Oct 2005 14:29:01 -0000 1.5
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
349 @@ -638,10 +638,6 @@
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
350 B2N_16(pgc->cell_playback_offset);
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
351 B2N_16(pgc->cell_position_offset);
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
352
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
353 - for(i = 0; i < 8; i++)
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
354 - B2N_16(pgc->audio_control[i]);
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
355 - for(i = 0; i < 32; i++)
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
356 - B2N_32(pgc->subp_control[i]);
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
357 for(i = 0; i < 16; i++)
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
358 B2N_32(pgc->palette[i]);
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
359
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
360 @@ -650,10 +646,10 @@
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
361
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
362 /* verify time (look at print_time) */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
363 for(i = 0; i < 8; i++)
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
364 - if(!pgc->audio_control[i] & 0x8000) /* The 'is present' bit */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
365 + if(!pgc->audio_control[i].present)
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
366 CHECK_ZERO(pgc->audio_control[i]);
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
367 for(i = 0; i < 32; i++)
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
368 - if(!pgc->subp_control[i] & 0x80000000) /* The 'is present' bit */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
369 + if(!pgc->subp_control[i].present)
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
370 CHECK_ZERO(pgc->subp_control[i]);
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
371
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
372 /* Check that time is 0:0:0:0 also if nr_of_programs == 0 */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
373
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
374 diff -Naur dvdread.orig/ifo_read.h dvdread/ifo_read.h
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
375 --- dvdread.orig/ifo_read.h 2005-06-23 00:18:54.000000000 +0200
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
376 +++ dvdread/ifo_read.h 2005-06-23 00:19:10.000000000 +0200
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
377 @@ -20,8 +20,8 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
378 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
379 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
380
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
381 -#include <dvdread/ifo_types.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
382 -#include <dvdread/dvd_reader.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
383 +#include "ifo_types.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
384 +#include "dvd_reader.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
385
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
386 #ifdef __cplusplus
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
387 extern "C" {
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
388 diff -Naur dvdread.orig/ifo_types.h dvdread/ifo_types.h
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
389 --- dvdread.orig/ifo_types.h 2005-06-23 00:18:54.000000000 +0200
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
390 +++ dvdread/ifo_types.h 2005-06-23 00:19:10.000000000 +0200
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
391 @@ -21,7 +21,7 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
392 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
393
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
394 #include <inttypes.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
395 -#include <dvdread/dvd_reader.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
396 +#include "dvd_reader.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
397
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
398
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
399 #undef ATTRIBUTE_PACKED
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
400 @@ -394,6 +394,55 @@
16659
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
401 } ATTRIBUTE_PACKED user_ops_t;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
402
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
403 /**
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
404 + * Subpicture stream mapping for a subtitle
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
405 + */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
406 +typedef struct {
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
407 +#ifdef WORDS_BIGENDIAN
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
408 + unsigned int present : 1;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
409 + unsigned int zero1 : 2;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
410 + unsigned int s_4p3 : 5; /* stream for 4:3 on any display */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
411 +
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
412 + unsigned int zero2 : 3;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
413 + unsigned int s_wide : 5; /* stream for 16:9 on widescreen display */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
414 +
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
415 + unsigned int zero3 : 3;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
416 + unsigned int s_lbox : 5; /* stream for 16:9 on letterboxed 4:3 display */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
417 +
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
418 + unsigned int zero4 : 3;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
419 + unsigned int s_panscan : 5; /* stream for 16:9 with pan&scan data on 4:3 display */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
420 +#else
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
421 + unsigned int s_4p3 : 5; /* stream for 4:3 on any display */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
422 + unsigned int zero1 : 2;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
423 + unsigned int present : 1;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
424 +
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
425 + unsigned int s_wide : 5; /* stream for 16:9 on widescreen display */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
426 + unsigned int zero2 : 3;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
427 +
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
428 + unsigned int s_lbox : 5; /* stream for 16:9 on letterboxed 4:3 display */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
429 + unsigned int zero3 : 3;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
430 +
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
431 + unsigned int s_panscan : 5; /* stream for 16:9 with pan&scan data on 4:3 display */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
432 + unsigned int zero4 : 3;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
433 +#endif
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
434 +} ATTRIBUTE_PACKED subp_mapping_t;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
435 +
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
436 +/**
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
437 + * Audio stream mapping for a soundtrack
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
438 + */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
439 +typedef struct {
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
440 +#ifdef WORDS_BIGENDIAN
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
441 + unsigned int present : 1;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
442 + unsigned int zero1 : 4;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
443 + unsigned int s_audio : 3;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
444 +#else
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
445 + unsigned int s_audio : 3;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
446 + unsigned int zero1 : 4;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
447 + unsigned int present : 1;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
448 +#endif
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
449 + uint8_t zero2;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
450 +} ATTRIBUTE_PACKED audio_mapping_t;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
451 +
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
452 +/**
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
453 * Program Chain Information.
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
454 */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
455 typedef struct {
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
456 @@ -402,8 +451,8 @@
16659
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
457 uint8_t nr_of_cells;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
458 dvd_time_t playback_time;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
459 user_ops_t prohibited_ops;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
460 - uint16_t audio_control[8]; /* New type? */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
461 - uint32_t subp_control[32]; /* New type? */
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
462 + audio_mapping_t audio_control[8];
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
463 + subp_mapping_t subp_control[32];
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
464 uint16_t next_pgc_nr;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
465 uint16_t prev_pgc_nr;
f734c20de10a Add changes from last patch (stream mapping).
reimar
parents: 16510
diff changeset
466 uint16_t goup_pgc_nr;
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
467 diff -Naur dvdread.orig/nav_print.c dvdread/nav_print.c
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
468 diff -Naur dvdread.orig/nav_print.h dvdread/nav_print.h
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
469 --- dvdread.orig/nav_print.h 2005-06-23 00:18:54.000000000 +0200
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
470 +++ dvdread/nav_print.h 2005-06-23 00:19:10.000000000 +0200
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
471 @@ -20,7 +20,7 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
472 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
473 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
474
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
475 -#include <dvdread/nav_types.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
476 +#include "nav_types.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
477
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
478 /**
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
479 * Pretty printing of the NAV packets, PCI and DSI structs.
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
480 diff -Naur dvdread.orig/nav_read.c dvdread/nav_read.c
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
481 diff -Naur dvdread.orig/nav_read.h dvdread/nav_read.h
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
482 --- dvdread.orig/nav_read.h 2005-06-23 00:18:54.000000000 +0200
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
483 +++ dvdread/nav_read.h 2005-06-23 00:19:10.000000000 +0200
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
484 @@ -19,7 +19,7 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
485 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
486 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
487
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
488 -#include <dvdread/nav_types.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
489 +#include "nav_types.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
490
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
491 /**
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
492 * Parsing of NAV data, PCI and DSI parts.
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
493 diff -Naur dvdread.orig/nav_types.h dvdread/nav_types.h
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
494 --- dvdread.orig/nav_types.h 2005-06-23 00:18:54.000000000 +0200
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
495 +++ dvdread/nav_types.h 2005-06-23 00:19:10.000000000 +0200
17313
c395f8f5ceb0 cosmetics: Make the patch apply without offsets.
diego
parents: 17311
diff changeset
496 @@ -30,7 +30,7 @@
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
497 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
498
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
499 #include <inttypes.h>
15875
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
500 -#include <dvdread/ifo_types.h> /* only dvd_time_t, vm_cmd_t and user_ops_t */
50960b929dd0 update mplayer specific libdvdread diff to match v0.9.4
aurel
parents: 15535
diff changeset
501 +#include "ifo_types.h" /* only dvd_time_t, vm_cmd_t and user_ops_t */
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
502
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
503
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
504 #undef ATTRIBUTE_PACKED