Mercurial > libdvdnav.hg
annotate dvdnav_internal.h @ 260:97ad00b13609 src
fixing typos noticed by Jeff Smith
author | mroi |
---|---|
date | Sun, 16 Jan 2005 16:47:05 +0000 |
parents | 39d2fc310eb9 |
children | 99d33725395d |
rev | line source |
---|---|
201
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
1 /* |
250 | 2 * Copyright (C) 2001-2004 Rich Wareham <richwareham@users.sourceforge.net> |
201
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
3 * |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
4 * This file is part of libdvdnav, a DVD navigation library. |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
5 * |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
6 * libdvdnav is free software; you can redistribute it and/or modify |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
7 * it under the terms of the GNU General Public License as published by |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
8 * the Free Software Foundation; either version 2 of the License, or |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
9 * (at your option) any later version. |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
10 * |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
11 * libdvdnav is distributed in the hope that it will be useful, |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
14 * GNU General Public License for more details. |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
15 * |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
16 * You should have received a copy of the GNU General Public License |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
17 * along with this program; if not, write to the Free Software |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
19 * |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
20 * $Id$ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
21 * |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
22 */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
23 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
24 #ifndef DVDNAV_INTERNAL_H_INCLUDED |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
25 #define DVDNAV_INTERNAL_H_INCLUDED |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
26 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
27 #ifdef HAVE_CONFIG_H |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
28 #include "config.h" |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
29 #endif |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
30 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
31 #include <stdlib.h> |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
32 #include <stdio.h> |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
33 #include <unistd.h> |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
34 #include <limits.h> |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
35 #include <string.h> |
230 | 36 |
37 #ifdef WIN32 | |
239
eaa775ba1306
merge the two #ifdef blocks that both check for WIN32 to improve readability
mroi
parents:
230
diff
changeset
|
38 |
230 | 39 /* pthread_mutex_* wrapper for win32 */ |
40 #include <windows.h> | |
41 #include <process.h> | |
42 typedef CRITICAL_SECTION pthread_mutex_t; | |
43 #define pthread_mutex_init(a, b) InitializeCriticalSection(a) | |
44 #define pthread_mutex_lock(a) EnterCriticalSection(a) | |
45 #define pthread_mutex_unlock(a) LeaveCriticalSection(a) | |
46 #define pthread_mutex_destroy(a) | |
201
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
47 |
230 | 48 /* replacement gettimeofday implementation */ |
49 #include <sys/timeb.h> | |
250 | 50 static inline int _private_gettimeofday( struct timeval *tv, void *tz ) |
230 | 51 { |
52 struct timeb t; | |
53 ftime( &t ); | |
54 tv->tv_sec = t.time; | |
55 tv->tv_usec = t.millitm * 1000; | |
56 return 0; | |
57 } | |
250 | 58 #define gettimeofday(TV, TZ) _private_gettimeofday((TV), (TZ)) |
230 | 59 #include <io.h> /* read() */ |
60 #define lseek64 _lseeki64 | |
239
eaa775ba1306
merge the two #ifdef blocks that both check for WIN32 to improve readability
mroi
parents:
230
diff
changeset
|
61 |
eaa775ba1306
merge the two #ifdef blocks that both check for WIN32 to improve readability
mroi
parents:
230
diff
changeset
|
62 #else |
eaa775ba1306
merge the two #ifdef blocks that both check for WIN32 to improve readability
mroi
parents:
230
diff
changeset
|
63 |
eaa775ba1306
merge the two #ifdef blocks that both check for WIN32 to improve readability
mroi
parents:
230
diff
changeset
|
64 #include <pthread.h> |
eaa775ba1306
merge the two #ifdef blocks that both check for WIN32 to improve readability
mroi
parents:
230
diff
changeset
|
65 |
eaa775ba1306
merge the two #ifdef blocks that both check for WIN32 to improve readability
mroi
parents:
230
diff
changeset
|
66 #endif /* WIN32 */ |
201
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
67 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
68 /* Uncomment for VM command tracing */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
69 /* #define TRACE */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
70 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
71 #include "decoder.h" |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
72 #include "dvdnav.h" |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
73 #include "vm.h" |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
74 #include "vmcmd.h" |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
75 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
76 /* where should libdvdnav write its messages (stdout/stderr) */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
77 #define MSG_OUT stdout |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
78 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
79 /* Maximum length of an error string */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
80 #define MAX_ERR_LEN 255 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
81 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
82 /* Use the POSIX PATH_MAX if available */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
83 #ifdef PATH_MAX |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
84 #define MAX_PATH_LEN PATH_MAX |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
85 #else |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
86 #define MAX_PATH_LEN 255 /* Arbitrary */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
87 #endif |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
88 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
89 #ifndef DVD_VIDEO_LB_LEN |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
90 #define DVD_VIDEO_LB_LEN 2048 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
91 #endif |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
92 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
93 typedef struct read_cache_s read_cache_t; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
94 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
95 /* |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
96 * These are defined here because they are |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
97 * not in ifo_types.h, they maybe one day |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
98 */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
99 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
100 #ifndef audio_status_t |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
101 typedef struct { |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
102 #ifdef WORDS_BIGENDIAN |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
103 unsigned int available : 1; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
104 unsigned int zero1 : 4; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
105 unsigned int stream_number : 3; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
106 uint8_t zero2; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
107 #else |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
108 uint8_t zero2; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
109 unsigned int stream_number : 3; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
110 unsigned int zero1 : 4; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
111 unsigned int available : 1; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
112 #endif |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
113 } ATTRIBUTE_PACKED audio_status_t; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
114 #endif |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
115 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
116 #ifndef spu_status_t |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
117 typedef struct { |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
118 #ifdef WORDS_BIGENDIAN |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
119 unsigned int available : 1; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
120 unsigned int zero1 : 2; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
121 unsigned int stream_number_4_3 : 5; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
122 unsigned int zero2 : 3; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
123 unsigned int stream_number_wide : 5; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
124 unsigned int zero3 : 3; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
125 unsigned int stream_number_letterbox : 5; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
126 unsigned int zero4 : 3; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
127 unsigned int stream_number_pan_scan : 5; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
128 #else |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
129 unsigned int stream_number_pan_scan : 5; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
130 unsigned int zero4 : 3; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
131 unsigned int stream_number_letterbox : 5; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
132 unsigned int zero3 : 3; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
133 unsigned int stream_number_wide : 5; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
134 unsigned int zero2 : 3; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
135 unsigned int stream_number_4_3 : 5; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
136 unsigned int zero1 : 2; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
137 unsigned int available : 1; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
138 #endif |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
139 } ATTRIBUTE_PACKED spu_status_t; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
140 #endif |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
141 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
142 typedef struct dvdnav_vobu_s { |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
143 int32_t vobu_start; /* Logical Absolute. MAX needed is 0x300000 */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
144 int32_t vobu_length; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
145 int32_t blockN; /* Relative offset */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
146 int32_t vobu_next; /* Relative offset */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
147 } dvdnav_vobu_t; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
148 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
149 /** The main DVDNAV type **/ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
150 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
151 struct dvdnav_s { |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
152 /* General data */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
153 char path[MAX_PATH_LEN]; /* Path to DVD device/dir */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
154 dvd_file_t *file; /* Currently opened file */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
155 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
156 /* Position data */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
157 vm_position_t position_next; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
158 vm_position_t position_current; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
159 dvdnav_vobu_t vobu; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
160 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
161 /* NAV data */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
162 pci_t pci; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
163 dsi_t dsi; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
164 uint32_t last_cmd_nav_lbn; /* detects when a command is issued on an already left NAV */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
165 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
166 /* Flags */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
167 int skip_still; /* Set when skipping a still */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
168 int sync_wait; /* applications should wait till they are in sync with us */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
169 int sync_wait_skip; /* Set when skipping wait state */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
170 int spu_clut_changed; /* The SPU CLUT changed */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
171 int started; /* vm_start has been called? */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
172 int use_read_ahead; /* 1 - use read-ahead cache, 0 - don't */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
173 int pgc_based; /* positioning works PGC based instead of PG based */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
174 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
175 /* VM */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
176 vm_t *vm; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
177 pthread_mutex_t vm_lock; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
178 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
179 /* Read-ahead cache */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
180 read_cache_t *cache; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
181 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
182 /* Errors */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
183 char err_str[MAX_ERR_LEN]; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
184 }; |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
185 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
186 /** USEFUL MACROS **/ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
187 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
188 #ifdef __GNUC__ |
258 | 189 #define printerrf(format, args...) \ |
190 do { if (this) snprintf(this->err_str, MAX_ERR_LEN, format, ## args); } while (0) | |
201
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
191 #else |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
192 #ifdef _MSC_VER |
258 | 193 #define printerrf(str) \ |
194 do { if (this) snprintf(this->err_str, MAX_ERR_LEN, str); } while (0) | |
201
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
195 #else |
258 | 196 #define printerrf(...) \ |
197 do { if (this) snprintf(this->err_str, MAX_ERR_LEN, __VA_ARGS__); } while (0) | |
201
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
198 #endif /* WIN32 */ |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
199 #endif |
258 | 200 #define printerr(str) \ |
259
39d2fc310eb9
fix the printerr macro again to have \0-terminated strings
mroi
parents:
258
diff
changeset
|
201 do { if (this) strncpy(this->err_str, str, MAX_ERR_LEN - 1); } while (0) |
201
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
202 |
534f17c79e4a
dvdnav_internal.h is an internal header, only used at compile time;
mroi
parents:
diff
changeset
|
203 #endif /* DVDNAV_INTERNAL_H_INCLUDED */ |