[DVDnav-discuss] r1135 - in trunk: libdvdnav/examples/menus.c libdvdnav/msvc/contrib/dirent/dirent.c libdvdnav/msvc/contrib/dirent/dirent.h libdvdnav/msvc/contrib/dlfcn.c libdvdnav/msvc/contrib/getopt.c libdvdnav/msvc/contrib/timer/timer.c libdvdnav/msvc/contrib/timer/timer.h libdvdnav/msvc/include/dlfcn.h libdvdnav/msvc/include/dvdnav_internal.h libdvdnav/msvc/include/inttypes.h libdvdnav/msvc/include/os_types.h libdvdnav/msvc/include/pthreads/pthread.h libdvdnav/msvc/include/pthreads/sched.h libdvdnav/msvc/include/sys/time.h libdvdnav/msvc/include/timer.h libdvdnav/msvc/include/unistd.h libdvdnav/src/dvd_types.h libdvdnav/src/dvdnav.c libdvdnav/src/dvdnav.h libdvdnav/src/dvdnav_events.h libdvdnav/src/dvdnav_internal.h libdvdnav/src/highlight.c libdvdnav/src/navigation.c libdvdnav/src/read_cache.c libdvdnav/src/read_cache.h libdvdnav/src/remap.c libdvdnav/src/remap.h libdvdnav/src/searching.c libdvdnav/src/settings.c libdvdnav/src/vm/decoder.c libdvdnav/src/vm/decoder.h libdvdnav/src/vm/vm.c libdvdnav/src/vm/vm.h libdvdnav/src/vm/vmcmd.c libdvdnav/src/vm/vmcmd.h libdvdread/msvc/contrib/dirent/dirent.c libdvdread/msvc/contrib/dirent/dirent.h libdvdread/msvc/contrib/dlfcn.c libdvdread/msvc/contrib/getopt.c libdvdread/msvc/contrib/timer/timer.c libdvdread/msvc/contrib/timer/timer.h libdvdread/msvc/include/dlfcn.h libdvdread/msvc/include/dvdnav_internal.h libdvdread/msvc/include/inttypes.h libdvdread/msvc/include/os_types.h libdvdread/msvc/include/pthreads/pthread.h libdvdread/msvc/include/pthreads/sched.h libdvdread/msvc/include/sys/time.h libdvdread/msvc/include/timer.h libdvdread/msvc/include/unistd.h libdvdread/src/bswap.h libdvdread/src/dvd_input.c libdvdread/src/dvd_input.h libdvdread/src/dvd_reader.c libdvdread/src/dvd_reader.h libdvdread/src/dvd_udf.c libdvdread/src/dvd_udf.h libdvdread/src/ifo_print.c libdvdread/src/ifo_print.h libdvdread/src/ifo_read.c libdvdread/src/ifo_read.h libdvdread/src/ifo_types.h libdvdread/src/nav_print.c libdvdread/src/nav_print.h libdvdread/src/nav_read.c libdvdread/src/nav_read.h libdvdread/src/nav_types.h
rathann
subversion at mplayerhq.hu
Sat Sep 6 23:55:54 CEST 2008
Author: rathann
Date: Sat Sep 6 23:55:51 2008
New Revision: 1135
Log:
Remove all trailing whitespace,
patch by Erik Hovland *erik$hovland dot org%
Modified:
trunk/libdvdnav/examples/menus.c
trunk/libdvdnav/msvc/contrib/dirent/dirent.c
trunk/libdvdnav/msvc/contrib/dirent/dirent.h
trunk/libdvdnav/msvc/contrib/dlfcn.c
trunk/libdvdnav/msvc/contrib/getopt.c
trunk/libdvdnav/msvc/contrib/timer/timer.c
trunk/libdvdnav/msvc/contrib/timer/timer.h
trunk/libdvdnav/msvc/include/dlfcn.h
trunk/libdvdnav/msvc/include/dvdnav_internal.h
trunk/libdvdnav/msvc/include/inttypes.h
trunk/libdvdnav/msvc/include/os_types.h
trunk/libdvdnav/msvc/include/pthreads/pthread.h
trunk/libdvdnav/msvc/include/pthreads/sched.h
trunk/libdvdnav/msvc/include/sys/time.h
trunk/libdvdnav/msvc/include/timer.h
trunk/libdvdnav/msvc/include/unistd.h
trunk/libdvdnav/src/dvd_types.h
trunk/libdvdnav/src/dvdnav.c
trunk/libdvdnav/src/dvdnav.h
trunk/libdvdnav/src/dvdnav_events.h
trunk/libdvdnav/src/dvdnav_internal.h
trunk/libdvdnav/src/highlight.c
trunk/libdvdnav/src/navigation.c
trunk/libdvdnav/src/read_cache.c
trunk/libdvdnav/src/read_cache.h
trunk/libdvdnav/src/remap.c
trunk/libdvdnav/src/remap.h
trunk/libdvdnav/src/searching.c
trunk/libdvdnav/src/settings.c
trunk/libdvdnav/src/vm/decoder.c
trunk/libdvdnav/src/vm/decoder.h
trunk/libdvdnav/src/vm/vm.c
trunk/libdvdnav/src/vm/vm.h
trunk/libdvdnav/src/vm/vmcmd.c
trunk/libdvdnav/src/vm/vmcmd.h
trunk/libdvdread/msvc/contrib/dirent/dirent.c
trunk/libdvdread/msvc/contrib/dirent/dirent.h
trunk/libdvdread/msvc/contrib/dlfcn.c
trunk/libdvdread/msvc/contrib/getopt.c
trunk/libdvdread/msvc/contrib/timer/timer.c
trunk/libdvdread/msvc/contrib/timer/timer.h
trunk/libdvdread/msvc/include/dlfcn.h
trunk/libdvdread/msvc/include/dvdnav_internal.h
trunk/libdvdread/msvc/include/inttypes.h
trunk/libdvdread/msvc/include/os_types.h
trunk/libdvdread/msvc/include/pthreads/pthread.h
trunk/libdvdread/msvc/include/pthreads/sched.h
trunk/libdvdread/msvc/include/sys/time.h
trunk/libdvdread/msvc/include/timer.h
trunk/libdvdread/msvc/include/unistd.h
trunk/libdvdread/src/bswap.h
trunk/libdvdread/src/dvd_input.c
trunk/libdvdread/src/dvd_input.h
trunk/libdvdread/src/dvd_reader.c
trunk/libdvdread/src/dvd_reader.h
trunk/libdvdread/src/dvd_udf.c
trunk/libdvdread/src/dvd_udf.h
trunk/libdvdread/src/ifo_print.c
trunk/libdvdread/src/ifo_print.h
trunk/libdvdread/src/ifo_read.c
trunk/libdvdread/src/ifo_read.h
trunk/libdvdread/src/ifo_types.h
trunk/libdvdread/src/nav_print.c
trunk/libdvdread/src/nav_print.h
trunk/libdvdread/src/nav_read.c
trunk/libdvdread/src/nav_read.h
trunk/libdvdread/src/nav_types.h
Modified: trunk/libdvdnav/examples/menus.c
==============================================================================
--- trunk/libdvdnav/examples/menus.c (original)
+++ trunk/libdvdnav/examples/menus.c Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2003 by the libdvdnav project
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -50,20 +50,20 @@ int main(int argc, char **argv) {
int finished = 0;
int output_fd = 0;
int dump = 0, tt_dump = 0;
-
+
/* open dvdnav handle */
printf("Opening DVD...\n");
if (dvdnav_open(&dvdnav, "/dev/dvd") != DVDNAV_STATUS_OK) {
printf("Error on dvdnav_open\n");
return 1;
}
-
+
/* set read ahead cache usage */
if (dvdnav_set_readahead_flag(dvdnav, DVD_READ_CACHE) != DVDNAV_STATUS_OK) {
printf("Error on dvdnav_set_readahead_flag: %s\n", dvdnav_err_to_string(dvdnav));
return 2;
}
-
+
/* set the language */
if (dvdnav_menu_language_select(dvdnav, DVD_LANGUAGE) != DVDNAV_STATUS_OK ||
dvdnav_audio_language_select(dvdnav, DVD_LANGUAGE) != DVDNAV_STATUS_OK ||
@@ -71,14 +71,14 @@ int main(int argc, char **argv) {
printf("Error on setting languages: %s\n", dvdnav_err_to_string(dvdnav));
return 2;
}
-
+
/* set the PGC positioning flag to have position information relatively to the
* whole feature instead of just relatively to the current chapter */
if (dvdnav_set_PGC_positioning_flag(dvdnav, 1) != DVDNAV_STATUS_OK) {
printf("Error on dvdnav_set_PGC_positioning_flag: %s\n", dvdnav_err_to_string(dvdnav));
return 2;
}
-
+
/* the read loop which regularly calls dvdnav_get_next_block
* and handles the returned events */
@@ -86,7 +86,7 @@ int main(int argc, char **argv) {
while (!finished) {
int result, event, len;
uint8_t *buf = mem;
-
+
/* the main reading function */
#if DVD_READ_CACHE
result = dvdnav_get_next_cache_block(dvdnav, &buf, &event, &len);
@@ -104,7 +104,7 @@ int main(int argc, char **argv) {
/* We have received a regular block of the currently playing MPEG stream.
* A real player application would now pass this block through demuxing
* and decoding. We simply write it to disc here. */
-
+
if (!output_fd) {
printf("Opening output...\n");
output_fd = open("libdvdnav.mpg", O_CREAT | O_WRONLY, S_IRWXU | S_IRWXG);
@@ -113,7 +113,7 @@ int main(int argc, char **argv) {
return 4;
}
}
-
+
if (dump || tt_dump)
write(output_fd, buf, len);
@@ -121,7 +121,7 @@ int main(int argc, char **argv) {
case DVDNAV_NOP:
/* Nothing to do here. */
break;
- case DVDNAV_STILL_FRAME:
+ case DVDNAV_STILL_FRAME:
/* We have reached a still frame. A real player application would wait
* the amount of time specified by the still's length while still handling
* user input to make menus and other interactive stills work.
@@ -157,7 +157,7 @@ int main(int argc, char **argv) {
/* Player applications should inform their audio decoder to switch channels */
break;
case DVDNAV_HIGHLIGHT:
- /* Player applications should inform their overlay engine to highlight the
+ /* Player applications should inform their overlay engine to highlight the
* given button */
{
dvdnav_highlight_event_t *highlight_event = (dvdnav_highlight_event_t *)buf;
@@ -179,7 +179,7 @@ int main(int argc, char **argv) {
int32_t tt = 0, ptt = 0;
uint32_t pos, len;
char input = '\0';
-
+
dvdnav_current_title_info(dvdnav, &tt, &ptt);
dvdnav_get_position(dvdnav, &pos, &len);
printf("Cell change: Title %d, Chapter %d\n", tt, ptt);
@@ -195,7 +195,7 @@ int main(int argc, char **argv) {
printf("(a)ppend cell to output\n(s)kip cell\nappend until end of (t)itle\n(q)uit\n");
scanf("%c", &input);
}
-
+
switch (input) {
case 'a':
dump = 1;
@@ -216,7 +216,7 @@ int main(int argc, char **argv) {
* engine of the player so that it knows the dimensions of the button areas. */
{
pci_t *pci;
-
+
/* Applications with fifos should not use these functions to retrieve NAV packets,
* they should implement their own NAV handling, because the packet you get from these
* functions will already be ahead in the stream which can cause state inconsistencies.
@@ -224,15 +224,15 @@ int main(int argc, char **argv) {
* and decoding pipeline just like any other data. */
pci = dvdnav_get_current_nav_pci(dvdnav);
dvdnav_get_current_nav_dsi(dvdnav);
-
+
if(pci->hli.hl_gi.btn_ns > 0) {
int button;
-
+
printf("Found %i DVD menu buttons...\n", pci->hli.hl_gi.btn_ns);
for (button = 0; button < pci->hli.hl_gi.btn_ns; button++) {
btni_t *btni = &(pci->hli.btnit[button]);
- printf("Button %i top-left @ (%i,%i), bottom-right @ (%i,%i)\n",
+ printf("Button %i top-left @ (%i,%i), bottom-right @ (%i,%i)\n",
button + 1, btni->x_start, btni->y_start,
btni->x_end, btni->y_end);
}
@@ -269,13 +269,13 @@ int main(int argc, char **argv) {
dvdnav_free_cache_block(dvdnav, buf);
#endif
}
-
+
/* destroy dvdnav handle */
if (dvdnav_close(dvdnav) != DVDNAV_STATUS_OK) {
printf("Error on dvdnav_close: %s\n", dvdnav_err_to_string(dvdnav));
return 5;
}
close(output_fd);
-
+
return 0;
-}
+}
Modified: trunk/libdvdnav/msvc/contrib/dirent/dirent.c
==============================================================================
--- trunk/libdvdnav/msvc/contrib/dirent/dirent.c (original)
+++ trunk/libdvdnav/msvc/contrib/dirent/dirent.c Sat Sep 6 23:55:51 2008
@@ -11,7 +11,7 @@
that this copyright and permissions notice appear in all copies and
derivatives, and that no charge may be made for the software and its
documentation except to cover cost of distribution.
-
+
This software is supplied "as is" without express or implied warranty.
But that said, if there are any problems please get in touch.
Modified: trunk/libdvdnav/msvc/contrib/dirent/dirent.h
==============================================================================
--- trunk/libdvdnav/msvc/contrib/dirent/dirent.h (original)
+++ trunk/libdvdnav/msvc/contrib/dirent/dirent.h Sat Sep 6 23:55:51 2008
@@ -11,7 +11,7 @@
that this copyright and permissions notice appear in all copies and
derivatives, and that no charge may be made for the software and its
documentation except to cover cost of distribution.
-
+
*/
#ifndef DIRENT_INCLUDED
Modified: trunk/libdvdnav/msvc/contrib/dlfcn.c
==============================================================================
--- trunk/libdvdnav/msvc/contrib/dlfcn.c (original)
+++ trunk/libdvdnav/msvc/contrib/dlfcn.c Sat Sep 6 23:55:51 2008
@@ -1,7 +1,7 @@
/*
* $Id$
* $Name$
- *
+ *
* Adopted from Apache DSO code.
* Portions copyright Apache Software Foundation
*
@@ -32,14 +32,14 @@ void *dlopen(const char *module_name, in
p = path;
while (p = strchr(p, '/'))
*p = '\\';
-
- /* First assume the dso/dll's required by -this- dso are sitting in the
+
+ /* First assume the dso/dll's required by -this- dso are sitting in the
* same path or can be found in the usual places. Failing that, let's
* let that dso look in the apache root.
*/
em = SetErrorMode(SEM_FAILCRITICALERRORS);
dsoh = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
- if (!dsoh)
+ if (!dsoh)
{
SetLastError(0); // clear the last error
dsoh = LoadLibraryEx(path, NULL, 0);
@@ -57,23 +57,23 @@ char *dlerror(void)
* mostly a potential problem for isapi modules, since LoadModule
* errors are handled within a single config thread.
*/
-
+
if((nErrorCode = GetLastError()) == 0)
return((char *)0);
SetLastError(0); // clear the last error
len = snprintf(errstr, sizeof(errstr), "(%d) ", nErrorCode);
- len += FormatMessage(
+ len += FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
nErrorCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
(LPTSTR) errstr + len,
sizeof(errstr) - len,
- NULL
+ NULL
);
- /* FormatMessage may have appended a newline (\r\n). So remove it
+ /* FormatMessage may have appended a newline (\r\n). So remove it
* and use ": " instead like the Unix errors. The error may also
* end with a . before the return - if so, trash it.
*/
Modified: trunk/libdvdnav/msvc/contrib/getopt.c
==============================================================================
--- trunk/libdvdnav/msvc/contrib/getopt.c (original)
+++ trunk/libdvdnav/msvc/contrib/getopt.c Sat Sep 6 23:55:51 2008
@@ -23,7 +23,7 @@
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
+
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
#ifndef _NO_PROTO
@@ -200,7 +200,7 @@ ordering;
/* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct;
-
+
#ifdef __GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
@@ -243,7 +243,7 @@ extern int strlen(const char *);
#endif /* __GNUC__ */
#endif /* not __GNU_LIBRARY__ */
-
+
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
@@ -410,7 +410,7 @@ static const char *
return optstring;
}
-
+
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
@@ -935,7 +935,7 @@ int
}
#endif /* Not ELIDE_CODE. */
-
+
#ifdef TEST
/* Compile with -DTEST to make an executable for use in testing
Modified: trunk/libdvdnav/msvc/contrib/timer/timer.c
==============================================================================
--- trunk/libdvdnav/msvc/contrib/timer/timer.c (original)
+++ trunk/libdvdnav/msvc/contrib/timer/timer.c Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000-2001 the xine project
- *
+ *
* This file is part of xine, a unix video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -46,7 +46,7 @@ int gettimeofday( struct timeval *tp, st
if( !startseconds )
startseconds = time( 0 );
- timeGetSystemTime( &mmtime, sizeof( mmtime ) );
+ timeGetSystemTime( &mmtime, sizeof( mmtime ) );
tp->tv_sec = ( mmtime.u.ms / 1000 ) + startseconds;
tp->tv_usec = ( mmtime.u.ms % 1000 ) * 1000;
@@ -56,7 +56,7 @@ int gettimeofday( struct timeval *tp, st
/*
These functions are designed to mimick
- a subset of itimer for use with the
+ a subset of itimer for use with the
alarm signal on win32. This is just
enough for xine to work.
*/
@@ -66,7 +66,7 @@ static HANDLE sigalarm = 0;
int setitimer( int which, struct itimerval * value, struct itimerval *ovalue )
{
long int miliseconds;
-
+
if( !sigalarm )
sigalarm = CreateEvent( 0, FALSE, TRUE, "SIGALARM" );
Modified: trunk/libdvdnav/msvc/contrib/timer/timer.h
==============================================================================
--- trunk/libdvdnav/msvc/contrib/timer/timer.h (original)
+++ trunk/libdvdnav/msvc/contrib/timer/timer.h Sat Sep 6 23:55:51 2008
@@ -10,7 +10,7 @@
// time reference
// ----------------------------------
-//
+//
// 1,000 milliseconds / sec
// 1,000,000 microseconds / sec
// 1,000,000,000 nanoseconds / sec
Modified: trunk/libdvdnav/msvc/include/dlfcn.h
==============================================================================
--- trunk/libdvdnav/msvc/include/dlfcn.h (original)
+++ trunk/libdvdnav/msvc/include/dlfcn.h Sat Sep 6 23:55:51 2008
@@ -3,7 +3,7 @@
/*
* $Id$
* $Name$
- *
+ *
*
*/
extern void *dlopen (const char *file, int mode);
Modified: trunk/libdvdnav/msvc/include/dvdnav_internal.h
==============================================================================
--- trunk/libdvdnav/msvc/include/dvdnav_internal.h (original)
+++ trunk/libdvdnav/msvc/include/dvdnav_internal.h Sat Sep 6 23:55:51 2008
@@ -1,19 +1,19 @@
/* !! DO NO EDIT THIS FILE, it is automatically generated */
-/*
+/*
* Copyright (C) 2001 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -71,7 +71,7 @@ typedef struct read_cache_s read_cache_t
/*
* These are defined here because they are
- * not in ifo_types.h, they maybe one day
+ * not in ifo_types.h, they maybe one day
*/
#ifndef audio_status_t
@@ -84,7 +84,7 @@ typedef struct {
#else
uint8_t zero2;
unsigned int stream_number : 3;
- unsigned int zero1 : 4;
+ unsigned int zero1 : 4;
unsigned int available : 1;
#endif
} ATTRIBUTE_PACKED audio_status_t;
@@ -121,8 +121,8 @@ typedef struct dvdnav_vobu_s {
int32_t vobu_length;
int32_t blockN; /* Relative offset */
int32_t vobu_next; /* Relative offset */
-} dvdnav_vobu_t;
-
+} dvdnav_vobu_t;
+
/** The main DVDNAV type **/
struct dvdnav_s {
@@ -131,26 +131,26 @@ struct dvdnav_s {
dvd_file_t *file; /* Currently opened file */
int open_vtsN; /* The domain and number of the... */
int open_domain; /* ..currently opened VOB */
-
+
/* Position data */
vm_position_t position_next;
vm_position_t position_current;
- dvdnav_vobu_t vobu;
+ dvdnav_vobu_t vobu;
/* NAV data */
pci_t pci;
dsi_t dsi;
uint32_t last_cmd_nav_lbn; /* detects when a command is issued on an already left NAV */
-
+
/* Flags */
int skip_still; /* Set when skipping a still */
int sync_wait; /* applications should wait till they are in sync with us */
int sync_wait_skip; /* Set when skipping wait state */
- int spu_clut_changed; /* The SPU CLUT changed */
+ int spu_clut_changed; /* The SPU CLUT changed */
int started; /* vm_start has been called? */
int use_read_ahead; /* 1 - use read-ahead cache, 0 - don't */
int pgc_based; /* positioning works PGC based instead of PG based */
-
+
/* VM */
vm_t *vm;
pthread_mutex_t vm_lock;
Modified: trunk/libdvdnav/msvc/include/inttypes.h
==============================================================================
--- trunk/libdvdnav/msvc/include/inttypes.h (original)
+++ trunk/libdvdnav/msvc/include/inttypes.h Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000-2001 the xine project
- *
+ *
* This file is part of xine, a unix video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Modified: trunk/libdvdnav/msvc/include/os_types.h
==============================================================================
--- trunk/libdvdnav/msvc/include/os_types.h (original)
+++ trunk/libdvdnav/msvc/include/os_types.h Sat Sep 6 23:55:51 2008
@@ -3,8 +3,8 @@
/*
* $Id$
* $Name$
- *
- * win32 types
+ *
+ * win32 types
* 04 Sept 2001 - Chris Wolf create.
*/
Modified: trunk/libdvdnav/msvc/include/pthreads/pthread.h
==============================================================================
--- trunk/libdvdnav/msvc/include/pthreads/pthread.h (original)
+++ trunk/libdvdnav/msvc/include/pthreads/pthread.h Sat Sep 6 23:55:51 2008
@@ -1,5 +1,5 @@
/* This is the POSIX thread API (POSIX 1003).
- *
+ *
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright (C) 1998
*
@@ -131,7 +131,7 @@ struct timespec {
#define SIG_BLOCK 0
#endif /* SIG_BLOCK */
-#ifndef SIG_UNBLOCK
+#ifndef SIG_UNBLOCK
#define SIG_UNBLOCK 1
#endif /* SIG_UNBLOCK */
@@ -492,7 +492,7 @@ enum
* C++ and C built versions will not.
*/
-/*
+/*
* define defaults for cleanup code
*/
#if !defined( __CLEANUP_SEH ) && !defined( __CLEANUP_CXX ) && !defined( __CLEANUP_C )
@@ -875,7 +875,7 @@ int pthread_getschedparam (pthread_t thr
struct sched_param *param);
int pthread_setconcurrency (int);
-
+
int pthread_getconcurrency (void);
/*
Modified: trunk/libdvdnav/msvc/include/pthreads/sched.h
==============================================================================
--- trunk/libdvdnav/msvc/include/pthreads/sched.h (original)
+++ trunk/libdvdnav/msvc/include/pthreads/sched.h Sat Sep 6 23:55:51 2008
@@ -3,7 +3,7 @@
*
* Purpose:
* Provides an implementation of POSIX realtime extensions
- * as defined in
+ * as defined in
*
* POSIX 1003.1b-1993 (POSIX.1b)
*
Modified: trunk/libdvdnav/msvc/include/sys/time.h
==============================================================================
--- trunk/libdvdnav/msvc/include/sys/time.h (original)
+++ trunk/libdvdnav/msvc/include/sys/time.h Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000-2001 the xine project
- *
+ *
* This file is part of xine, a unix video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Modified: trunk/libdvdnav/msvc/include/timer.h
==============================================================================
--- trunk/libdvdnav/msvc/include/timer.h (original)
+++ trunk/libdvdnav/msvc/include/timer.h Sat Sep 6 23:55:51 2008
@@ -10,7 +10,7 @@
// time reference
// ----------------------------------
-//
+//
// 1,000 milliseconds / sec
// 1,000,000 microseconds / sec
// 1,000,000,000 nanoseconds / sec
Modified: trunk/libdvdnav/msvc/include/unistd.h
==============================================================================
--- trunk/libdvdnav/msvc/include/unistd.h (original)
+++ trunk/libdvdnav/msvc/include/unistd.h Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000-2001 the xine project
- *
+ *
* This file is part of xine, a unix video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -21,7 +21,7 @@
* by Matthew Grooms <elon at altavista.com>
*
* unistd.h - This is mostly a catch all header that maps standard unix
- * libc calls to the equivelent win32 functions.
+ * libc calls to the equivelent win32 functions.
*
*/
Modified: trunk/libdvdnav/src/dvd_types.h
==============================================================================
--- trunk/libdvdnav/src/dvd_types.h (original)
+++ trunk/libdvdnav/src/dvd_types.h Sat Sep 6 23:55:51 2008
@@ -3,17 +3,17 @@
*
* This file is part of libdvdnav, a DVD navigation library. It is a modified
* file originally part of the Ogle DVD player project.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -51,7 +51,7 @@ typedef enum {
* (see dvdnav_get_highlight_area())
*/
typedef struct {
- uint32_t palette; /* The CLUT entries for the highlight palette
+ uint32_t palette; /* The CLUT entries for the highlight palette
(4-bits per entry -> 4 entries) */
uint16_t sx,sy,ex,ey; /* The start/end x,y positions */
uint32_t pts; /* Highlight PTS to match with SPU */
@@ -76,15 +76,15 @@ typedef enum {
/* User operation permissions */
typedef enum {
- UOP_FLAG_TitleOrTimePlay = 0x00000001,
- UOP_FLAG_ChapterSearchOrPlay = 0x00000002,
- UOP_FLAG_TitlePlay = 0x00000004,
- UOP_FLAG_Stop = 0x00000008,
+ UOP_FLAG_TitleOrTimePlay = 0x00000001,
+ UOP_FLAG_ChapterSearchOrPlay = 0x00000002,
+ UOP_FLAG_TitlePlay = 0x00000004,
+ UOP_FLAG_Stop = 0x00000008,
UOP_FLAG_GoUp = 0x00000010,
- UOP_FLAG_TimeOrChapterSearch = 0x00000020,
- UOP_FLAG_PrevOrTopPGSearch = 0x00000040,
- UOP_FLAG_NextPGSearch = 0x00000080,
- UOP_FLAG_ForwardScan = 0x00000100,
+ UOP_FLAG_TimeOrChapterSearch = 0x00000020,
+ UOP_FLAG_PrevOrTopPGSearch = 0x00000040,
+ UOP_FLAG_NextPGSearch = 0x00000080,
+ UOP_FLAG_ForwardScan = 0x00000100,
UOP_FLAG_BackwardScan = 0x00000200,
UOP_FLAG_TitleMenuCall = 0x00000400,
UOP_FLAG_RootMenuCall = 0x00000800,
@@ -100,7 +100,7 @@ typedef enum {
UOP_FLAG_SubPicStreamChange = 0x00200000,
UOP_FLAG_AngleChange = 0x00400000,
UOP_FLAG_KaraokeAudioPresModeChange = 0x00800000,
- UOP_FLAG_VideoPresModeChange = 0x01000000
+ UOP_FLAG_VideoPresModeChange = 0x01000000
} DVDUOP_t;
/* Parental Level */
@@ -127,7 +127,7 @@ typedef uint16_t DVDRegister_t;
typedef enum {
DVDFalse = 0,
DVDTrue = 1
-} DVDBool_t;
+} DVDBool_t;
typedef DVDRegister_t DVDGPRMArray_t[16];
typedef DVDRegister_t DVDSPRMArray_t[24];
@@ -148,10 +148,10 @@ typedef struct {
} DVDTimecode_t;
/* Subpicture stream number (0-31,62,63) */
-typedef int DVDSubpictureStream_t;
+typedef int DVDSubpictureStream_t;
/* Audio stream number (0-7, 15(none)) */
-typedef int DVDAudioStream_t;
+typedef int DVDAudioStream_t;
/* The audio application mode */
typedef enum {
@@ -196,7 +196,7 @@ typedef enum {
DVD_SUBPICTURE_LANG_EXT_NormalDirectorsComments = 13,
DVD_SUBPICTURE_LANG_EXT_BigDirectorsComments = 14,
DVD_SUBPICTURE_LANG_EXT_ChildrensDirectorsComments = 15,
-} DVDSubpictureLangExt_t;
+} DVDSubpictureLangExt_t;
/* Karaoke Downmix mode */
typedef enum {
@@ -222,7 +222,7 @@ typedef enum {
DVD_DISPLAY_MODE_ContentDefault = 0,
DVD_DISPLAY_MODE_16x9 = 1,
DVD_DISPLAY_MODE_4x3PanScan = 2,
- DVD_DISPLAY_MODE_4x3Letterboxed = 3
+ DVD_DISPLAY_MODE_4x3Letterboxed = 3
} DVDDisplayMode_t;
/* Audio attributes */
Modified: trunk/libdvdnav/src/dvdnav.c
==============================================================================
--- trunk/libdvdnav/src/dvdnav.c (original)
+++ trunk/libdvdnav/src/dvdnav.c Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -72,14 +72,14 @@ static dvdnav_status_t dvdnav_clear(dvdn
dvdnav_read_cache_clear(this->cache);
pthread_mutex_unlock(&this->vm_lock);
-
+
return DVDNAV_STATUS_OK;
}
dvdnav_status_t dvdnav_open(dvdnav_t** dest, const char *path) {
dvdnav_t *this;
struct timeval time;
-
+
/* Create a new structure */
fprintf(MSG_OUT, "libdvdnav: Using dvdnav version %s\n", VERSION);
@@ -88,7 +88,7 @@ dvdnav_status_t dvdnav_open(dvdnav_t** d
if(!this)
return DVDNAV_STATUS_ERR;
memset(this, 0, (sizeof(dvdnav_t) ) ); /* Make sure this structure is clean */
-
+
pthread_mutex_init(&this->vm_lock, NULL);
/* Initialise the error string */
printerr("");
@@ -115,7 +115,7 @@ dvdnav_status_t dvdnav_open(dvdnav_t** d
/* Pre-open and close a file so that the CSS-keys are cached. */
this->file = DVDOpenFile(vm_get_dvd_reader(this->vm), 0, DVD_READ_MENU_VOBS);
-
+
/* Start the read-ahead cache. */
this->cache = dvdnav_read_cache_new(this);
@@ -123,9 +123,9 @@ dvdnav_status_t dvdnav_open(dvdnav_t** d
* gives a different start value each time a DVD is played. */
gettimeofday(&time, NULL);
srand(time.tv_usec);
-
+
dvdnav_clear(this);
-
+
(*dest) = this;
return DVDNAV_STATUS_OK;
}
@@ -137,13 +137,13 @@ dvdnav_status_t dvdnav_close(dvdnav_t *t
#endif
if (this->file) {
- pthread_mutex_lock(&this->vm_lock);
+ pthread_mutex_lock(&this->vm_lock);
DVDCloseFile(this->file);
#ifdef LOG_DEBUG
fprintf(MSG_OUT, "libdvdnav: close:file closing\n");
#endif
this->file = NULL;
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
}
/* Free the VM */
@@ -159,7 +159,7 @@ dvdnav_status_t dvdnav_close(dvdnav_t *t
dvdnav_read_cache_free(this->cache);
else
free(this);
-
+
return DVDNAV_STATUS_OK;
}
@@ -170,14 +170,14 @@ dvdnav_status_t dvdnav_reset(dvdnav_t *t
fprintf(MSG_OUT, "libdvdnav: reset:called\n");
#endif
- pthread_mutex_lock(&this->vm_lock);
+ pthread_mutex_lock(&this->vm_lock);
#ifdef LOG_DEBUG
fprintf(MSG_OUT, "libdvdnav: reseting vm\n");
#endif
if(!vm_reset(this->vm, NULL)) {
printerr("Error restarting the VM.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
#ifdef LOG_DEBUG
@@ -185,7 +185,7 @@ dvdnav_status_t dvdnav_reset(dvdnav_t *t
#endif
result = dvdnav_clear(this);
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return result;
}
@@ -196,10 +196,10 @@ dvdnav_status_t dvdnav_path(dvdnav_t *th
}
const char* dvdnav_err_to_string(dvdnav_t *this) {
-
+
if(!this)
return "Hey! You gave me a NULL pointer you naughty person!";
-
+
return this->err_str;
}
@@ -207,22 +207,22 @@ const char* dvdnav_err_to_string(dvdnav_
int64_t dvdnav_convert_time(dvd_time_t *time) {
int64_t result;
int64_t frames;
-
+
result = (time->hour >> 4 ) * 10 * 60 * 60 * 90000;
result += (time->hour & 0x0f) * 60 * 60 * 90000;
result += (time->minute >> 4 ) * 10 * 60 * 90000;
result += (time->minute & 0x0f) * 60 * 90000;
result += (time->second >> 4 ) * 10 * 90000;
result += (time->second & 0x0f) * 90000;
-
+
frames = ((time->frame_u & 0x30) >> 4) * 10;
frames += ((time->frame_u & 0x0f) ) ;
-
+
if (time->frame_u & 0x80)
result += frames * 3000;
else
result += frames * 3600;
-
+
return result;
}
@@ -289,22 +289,22 @@ static int32_t dvdnav_decode_packet(dvdn
nPacketLen = p[4] << 8 | p[5];
p += 6;
navRead_DSI(nav_dsi, p+1);
- }
+ }
return 1;
}
return 0;
}
-/* DSI is used for most angle stuff.
+/* DSI is used for most angle stuff.
* PCI is used for only non-seemless angle stuff
- */
+ */
static int32_t dvdnav_get_vobu(dvdnav_t *this, dsi_t *nav_dsi, pci_t *nav_pci, dvdnav_vobu_t *vobu) {
uint32_t next;
int32_t angle, num_angle;
vobu->vobu_start = nav_dsi->dsi_gi.nv_pck_lbn; /* Absolute offset from start of disk */
vobu->vobu_length = nav_dsi->dsi_gi.vobu_ea; /* Relative offset from vobu_start */
-
+
/*
* If we're not at the end of this cell, we can determine the next
* VOBU to display using the VOBU_SRI information section of the
@@ -316,7 +316,7 @@ static int32_t dvdnav_get_vobu(dvdnav_t
* DVDs are about 6 Gigs, which is only up to 0x300000 blocks
* Should really assert if bit 31 != 1
*/
-
+
#if 0
/* Old code -- may still be useful one day */
if(nav_dsi->vobu_sri.next_vobu != SRI_END_OF_CELL ) {
@@ -328,22 +328,22 @@ static int32_t dvdnav_get_vobu(dvdnav_t
/* Relative offset from vobu_start */
vobu->vobu_next = ( nav_dsi->vobu_sri.next_vobu & 0x3fffffff );
#endif
-
+
vm_get_angle_info(this->vm, &angle, &num_angle);
/* FIMXE: The angle reset doesn't work for some reason for the moment */
#if 0
if((num_angle < angle) && (angle != 1)) {
fprintf(MSG_OUT, "libdvdnav: angle ends!\n");
-
+
/* This is to switch back to angle one when we
* finish with angles. */
dvdnav_angle_change(this, 1);
- }
+ }
#endif
if(num_angle != 0) {
-
+
if((next = nav_pci->nsml_agli.nsml_agl_dsta[angle-1]) != 0) {
if((next & 0x3fffffff) != 0) {
if(next & 0x80000000)
@@ -353,7 +353,7 @@ static int32_t dvdnav_get_vobu(dvdnav_t
}
} else if((next = nav_dsi->sml_agli.data[angle-1].address) != 0) {
vobu->vobu_length = nav_dsi->sml_pbi.ilvu_ea;
-
+
if((next & 0x80000000) && (next != 0x7fffffff))
vobu->vobu_next = - (int32_t)(next & 0x3fffffff);
else
@@ -379,7 +379,7 @@ dvdnav_status_t dvdnav_get_next_block(dv
int32_t *event, int32_t *len) {
unsigned char *block;
dvdnav_status_t status;
-
+
block = buf;
status = dvdnav_get_next_cache_block(this, &block, event, len);
if (status == DVDNAV_STATUS_OK && block != buf) {
@@ -406,14 +406,14 @@ int64_t dvdnav_get_current_time(dvdnav_t
return tm;
}
-
+
dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *this, uint8_t **buf,
int32_t *event, int32_t *len) {
dvd_state_t *state;
int32_t result;
pthread_mutex_lock(&this->vm_lock);
-
+
if(!this->started) {
/* Start the VM */
if (!vm_start(this->vm)) {
@@ -427,18 +427,18 @@ dvdnav_status_t dvdnav_get_next_cache_bl
state = &(this->vm->state);
(*event) = DVDNAV_NOP;
(*len) = 0;
-
+
/* Check the STOP flag */
if(this->vm->stopped) {
vm_stop(this->vm);
(*event) = DVDNAV_STOP;
this->started = 0;
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
vm_position_get(this->vm, &this->position_next);
-
+
#ifdef LOG_DEBUG
fprintf(MSG_OUT, "libdvdnav: POS-NEXT ");
vm_position_print(this->vm, &this->position_next);
@@ -454,7 +454,7 @@ dvdnav_status_t dvdnav_get_next_cache_bl
#endif
if (this->position_next.hop_channel - this->position_current.hop_channel >= HOP_SEEK) {
int32_t num_angles = 0, current;
-
+
/* we seeked -> check for multiple angles */
vm_get_angle_info(this->vm, ¤t, &num_angles);
if (num_angles > 1) {
@@ -465,13 +465,13 @@ dvdnav_status_t dvdnav_get_next_cache_bl
result = dvdnav_read_cache_block(this->cache, block, 1, buf);
if(result <= 0) {
printerr("Error reading NAV packet.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
/* Decode nav into pci and dsi. Then get next VOBU info. */
if(!dvdnav_decode_packet(this, *buf, &this->dsi, &this->pci)) {
printerr("Expected NAV packet but none found.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
dvdnav_get_vobu(this, &this->dsi, &this->pci, &this->vobu);
@@ -492,7 +492,7 @@ dvdnav_status_t dvdnav_get_next_cache_bl
this->vobu.vobu_length = 0;
this->vobu.blockN = 0;
this->sync_wait = 0;
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
@@ -508,10 +508,10 @@ dvdnav_status_t dvdnav_get_next_cache_bl
hevent->display = 1;
hevent->buttonN = this->position_next.button;
this->position_current.button = this->position_next.button;
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
-
+
/* Check the WAIT flag */
if(this->sync_wait) {
(*event) = DVDNAV_WAIT;
@@ -524,12 +524,12 @@ dvdnav_status_t dvdnav_get_next_cache_bl
}
/* Check to see if we need to change the currently opened VOB */
- if((this->position_current.vts != this->position_next.vts) ||
+ if((this->position_current.vts != this->position_next.vts) ||
(this->position_current.domain != this->position_next.domain)) {
dvd_read_domain_t domain;
int32_t vtsN;
dvdnav_vts_change_event_t *vts_event = (dvdnav_vts_change_event_t *)*buf;
-
+
if(this->file) {
DVDCloseFile(this->file);
this->file = NULL;
@@ -537,7 +537,7 @@ dvdnav_status_t dvdnav_get_next_cache_bl
vts_event->old_vtsN = this->position_current.vts;
vts_event->old_domain = this->position_current.domain;
-
+
/* Use the DOMAIN to find whether to open menu or title VOBs */
switch(this->position_next.domain) {
case FP_DOMAIN:
@@ -547,29 +547,29 @@ dvdnav_status_t dvdnav_get_next_cache_bl
break;
case VTSM_DOMAIN:
domain = DVD_READ_MENU_VOBS;
- vtsN = this->position_next.vts;
+ vtsN = this->position_next.vts;
break;
case VTS_DOMAIN:
domain = DVD_READ_TITLE_VOBS;
- vtsN = this->position_next.vts;
+ vtsN = this->position_next.vts;
break;
default:
printerr("Unknown domain when changing VTS.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
-
- this->position_current.vts = this->position_next.vts;
+
+ this->position_current.vts = this->position_next.vts;
this->position_current.domain = this->position_next.domain;
dvdnav_read_cache_clear(this->cache);
this->file = DVDOpenFile(vm_get_dvd_reader(this->vm), vtsN, domain);
- vts_event->new_vtsN = this->position_next.vts;
- vts_event->new_domain = this->position_next.domain;
+ vts_event->new_vtsN = this->position_next.vts;
+ vts_event->new_domain = this->position_next.domain;
/* If couldn't open the file for some reason, moan */
if(this->file == NULL) {
printerrf("Error opening vtsN=%i, domain=%i.", vtsN, domain);
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
@@ -584,26 +584,26 @@ dvdnav_status_t dvdnav_get_next_cache_bl
this->position_current.cell = -1; /* Force an update */
this->position_current.spu_channel = -1; /* Force an update */
this->position_current.audio_channel = -1; /* Force an update */;
-
- pthread_mutex_unlock(&this->vm_lock);
+
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
- /* Check if the cell changed */
+ /* Check if the cell changed */
if( (this->position_current.cell != this->position_next.cell) ||
(this->position_current.cell_restart != this->position_next.cell_restart) ||
(this->position_current.cell_start != this->position_next.cell_start) ) {
dvdnav_cell_change_event_t *cell_event = (dvdnav_cell_change_event_t *)*buf;
int32_t first_cell_nr, last_cell_nr, i;
dvd_state_t *state = &this->vm->state;
-
+
this->cur_cell_time = 0;
(*event) = DVDNAV_CELL_CHANGE;
#ifdef LOG_DEBUG
fprintf(MSG_OUT, "libdvdnav: CELL_CHANGE\n");
#endif
(*len) = sizeof(dvdnav_cell_change_event_t);
-
+
cell_event->cellN = state->cellN;
cell_event->pgN = state->pgN;
cell_event->cell_length =
@@ -636,23 +636,23 @@ dvdnav_status_t dvdnav_get_next_cache_bl
this->position_current.cell_restart = this->position_next.cell_restart;
this->position_current.cell_start = this->position_next.cell_start;
this->position_current.block = this->position_next.block;
-
+
/* vobu info is used for mid cell resumes */
this->vobu.vobu_start = this->position_next.cell_start + this->position_next.block;
this->vobu.vobu_next = 0;
/* Make blockN == vobu_length to do expected_nav */
this->vobu.vobu_length = 0;
this->vobu.blockN = 0;
-
+
/* update the spu palette at least on PGC changes */
this->spu_clut_changed = 1;
this->position_current.spu_channel = -1; /* Force an update */
this->position_current.audio_channel = -1; /* Force an update */
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
-
+
/* has the CLUT changed? */
if(this->spu_clut_changed) {
(*event) = DVDNAV_SPU_CLUT_CHANGE;
@@ -662,11 +662,11 @@ dvdnav_status_t dvdnav_get_next_cache_bl
(*len) = 16 * sizeof(uint32_t);
memcpy(*buf, &(state->pgc->palette), 16 * sizeof(uint32_t));
this->spu_clut_changed = 0;
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
- /* has the SPU channel changed? */
+ /* has the SPU channel changed? */
if(this->position_current.spu_channel != this->position_next.spu_channel) {
dvdnav_spu_stream_change_event_t *stream_change = (dvdnav_spu_stream_change_event_t *)*buf;
@@ -685,14 +685,14 @@ dvdnav_status_t dvdnav_get_next_cache_bl
fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_pan_scan=%d\n",stream_change->physical_pan_scan);
fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE returning DVDNAV_STATUS_OK\n");
#endif
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
- /* has the audio channel changed? */
+ /* has the audio channel changed? */
if(this->position_current.audio_channel != this->position_next.audio_channel) {
dvdnav_audio_stream_change_event_t *stream_change = (dvdnav_audio_stream_change_event_t *)*buf;
-
+
(*event) = DVDNAV_AUDIO_STREAM_CHANGE;
#ifdef LOG_DEBUG
fprintf(MSG_OUT, "libdvdnav: AUDIO_STREAM_CHANGE\n");
@@ -704,10 +704,10 @@ dvdnav_status_t dvdnav_get_next_cache_bl
#ifdef LOG_DEBUG
fprintf(MSG_OUT, "libdvdnav: AUDIO_STREAM_CHANGE stream_id=%d returning DVDNAV_STATUS_OK\n",stream_change->physical);
#endif
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
-
+
/* Check the STILLFRAME flag */
if(this->position_current.still != 0) {
dvdnav_still_event_t *still_event = (dvdnav_still_event_t *)*buf;
@@ -718,7 +718,7 @@ dvdnav_status_t dvdnav_get_next_cache_bl
#endif
(*len) = sizeof(dvdnav_still_event_t);
still_event->length = this->position_current.still;
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
@@ -750,11 +750,11 @@ dvdnav_status_t dvdnav_get_next_cache_bl
/* handle related state changes in next iteration */
(*event) = DVDNAV_NOP;
(*len) = 0;
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
- /* Perform remapping jump if necessary (this is always a
+ /* Perform remapping jump if necessary (this is always a
* VOBU boundary). */
if (this->vm->map) {
this->vobu.vobu_next = remap_block( this->vm->map,
@@ -768,13 +768,13 @@ dvdnav_status_t dvdnav_get_next_cache_bl
if(result <= 0) {
printerr("Error reading NAV packet.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
/* Decode nav into pci and dsi. Then get next VOBU info. */
if(!dvdnav_decode_packet(this, *buf, &this->dsi, &this->pci)) {
printerr("Expected NAV packet but none found.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
/* We need to update the vm state->blockN with which VOBU we are in.
@@ -782,32 +782,32 @@ dvdnav_status_t dvdnav_get_next_cache_bl
*/
this->vm->state.blockN = this->vobu.vobu_start - this->position_current.cell_start;
- dvdnav_get_vobu(this, &this->dsi, &this->pci, &this->vobu);
+ dvdnav_get_vobu(this, &this->dsi, &this->pci, &this->vobu);
this->vobu.blockN = 0;
/* Give the cache a hint about the size of next VOBU.
* This improves pre-caching, because the VOBU will almost certainly be read entirely.
*/
dvdnav_pre_cache_blocks(this->cache, this->vobu.vobu_start+1, this->vobu.vobu_length+1);
-
+
/* release NAV menu filter, when we reach the same NAV packet again */
if (this->last_cmd_nav_lbn == this->pci.pci_gi.nv_pck_lbn)
this->last_cmd_nav_lbn = SRI_END_OF_CELL;
-
+
/* Successfully got a NAV packet */
(*event) = DVDNAV_NAV_PACKET;
#ifdef LOG_DEBUG
fprintf(MSG_OUT, "libdvdnav: NAV_PACKET\n");
#endif
- (*len) = 2048;
+ (*len) = 2048;
this->cur_cell_time = dvdnav_convert_time(&this->dsi.dsi_gi.c_eltm);
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
-
+
/* If we've got here, it must just be a normal block. */
if(!this->file) {
printerr("Attempting to read without opening file.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
@@ -815,13 +815,13 @@ dvdnav_status_t dvdnav_get_next_cache_bl
result = dvdnav_read_cache_block(this->cache, this->vobu.vobu_start + this->vobu.blockN, 1, buf);
if(result <= 0) {
printerr("Error reading from DVD.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
(*event) = DVDNAV_BLOCK_OK;
(*len) = 2048;
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
@@ -841,56 +841,56 @@ uint8_t dvdnav_get_video_aspect(dvdnav_t
pthread_mutex_lock(&this->vm_lock);
retval = (uint8_t)vm_get_video_aspect(this->vm);
pthread_mutex_unlock(&this->vm_lock);
-
+
return retval;
}
uint8_t dvdnav_get_video_scale_permission(dvdnav_t *this) {
uint8_t retval;
-
+
if(!this->started) {
printerr("Virtual DVD machine not started.");
return -1;
}
-
+
pthread_mutex_lock(&this->vm_lock);
retval = (uint8_t)vm_get_video_scale_permission(this->vm);
pthread_mutex_unlock(&this->vm_lock);
-
+
return retval;
}
uint16_t dvdnav_audio_stream_to_lang(dvdnav_t *this, uint8_t stream) {
audio_attr_t attr;
-
+
if(!this->started) {
printerr("Virtual DVD machine not started.");
return -1;
}
-
- pthread_mutex_lock(&this->vm_lock);
+
+ pthread_mutex_lock(&this->vm_lock);
attr = vm_get_audio_attr(this->vm, stream);
- pthread_mutex_unlock(&this->vm_lock);
-
+ pthread_mutex_unlock(&this->vm_lock);
+
if(attr.lang_type != 1)
return 0xffff;
-
+
return attr.lang_code;
}
uint16_t dvdnav_audio_stream_format(dvdnav_t *this, uint8_t stream) {
audio_attr_t attr;
uint16_t format;
-
+
if(!this->started) {
printerr("Virtual DVD machine not started.");
return -1; /* 0xffff */
}
-
- pthread_mutex_lock(&this->vm_lock);
+
+ pthread_mutex_lock(&this->vm_lock);
attr = vm_get_audio_attr(this->vm, stream);
- pthread_mutex_unlock(&this->vm_lock);
-
+ pthread_mutex_unlock(&this->vm_lock);
+
switch(attr.audio_format) {
case 0:
format = DVDNAV_FORMAT_AC3;
@@ -908,11 +908,11 @@ uint16_t dvdnav_audio_stream_format(dvdn
case 7:
format = DVDNAV_FORMAT_SDDS;
break;
- default:
+ default:
format = 0xffff;
break;
}
-
+
return format;
}
@@ -933,38 +933,38 @@ uint16_t dvdnav_audio_stream_channels(dv
uint16_t dvdnav_spu_stream_to_lang(dvdnav_t *this, uint8_t stream) {
subp_attr_t attr;
-
+
if(!this->started) {
printerr("Virtual DVD machine not started.");
return -1;
}
-
- pthread_mutex_lock(&this->vm_lock);
+
+ pthread_mutex_lock(&this->vm_lock);
attr = vm_get_subp_attr(this->vm, stream);
- pthread_mutex_unlock(&this->vm_lock);
-
+ pthread_mutex_unlock(&this->vm_lock);
+
if(attr.type != 1)
return 0xffff;
-
+
return attr.lang_code;
}
int8_t dvdnav_get_audio_logical_stream(dvdnav_t *this, uint8_t audio_num) {
int8_t retval;
-
+
if(!this->started) {
printerr("Virtual DVD machine not started.");
return -1;
}
-
+
pthread_mutex_lock(&this->vm_lock);
if (!this->vm->state.pgc) {
printerr("No current PGC.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return -1;
}
retval = vm_get_audio_stream(this->vm, audio_num);
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return retval;
}
@@ -977,7 +977,7 @@ dvdnav_status_t dvdnav_get_audio_attr(dv
pthread_mutex_lock(&this->vm_lock);
if (!this->vm->state.pgc) {
printerr("No current PGC.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return -1;
}
*audio_attr=vm_get_audio_attr(this->vm, audio_num);
@@ -997,7 +997,7 @@ int8_t dvdnav_get_spu_logical_stream(dvd
pthread_mutex_lock(&this->vm_lock);
if (!this->vm->state.pgc) {
printerr("No current PGC.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return -1;
}
retval = vm_get_subp_stream(this->vm, subp_num, 0);
@@ -1014,7 +1014,7 @@ dvdnav_status_t dvdnav_get_spu_attr(dvdn
pthread_mutex_lock(&this->vm_lock);
if (!this->vm->state.pgc) {
printerr("No current PGC.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return -1;
}
*subp_attr=vm_get_subp_attr(this->vm, audio_num);
@@ -1029,16 +1029,16 @@ int8_t dvdnav_get_active_audio_stream(dv
printerr("Virtual DVD machine not started.");
return -1;
}
-
- pthread_mutex_lock(&this->vm_lock);
+
+ pthread_mutex_lock(&this->vm_lock);
if (!this->vm->state.pgc) {
printerr("No current PGC.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return -1;
}
retval = vm_get_audio_active_stream(this->vm);
- pthread_mutex_unlock(&this->vm_lock);
-
+ pthread_mutex_unlock(&this->vm_lock);
+
return retval;
}
@@ -1049,31 +1049,31 @@ int8_t dvdnav_get_active_spu_stream(dvdn
printerr("Virtual DVD machine not started.");
return -1;
}
-
- pthread_mutex_lock(&this->vm_lock);
+
+ pthread_mutex_lock(&this->vm_lock);
if (!this->vm->state.pgc) {
printerr("No current PGC.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return -1;
}
retval = vm_get_subp_active_stream(this->vm, 0);
- pthread_mutex_unlock(&this->vm_lock);
-
+ pthread_mutex_unlock(&this->vm_lock);
+
return retval;
}
static int8_t dvdnav_is_domain(dvdnav_t *this, domain_t domain) {
int8_t retval;
-
+
if(!this->started) {
printerr("Virtual DVD machine not started.");
return -1;
}
-
+
pthread_mutex_lock(&this->vm_lock);
retval = (this->vm->state.domain == domain);
pthread_mutex_unlock(&this->vm_lock);
-
+
return retval;
}
@@ -1090,14 +1090,14 @@ int8_t dvdnav_is_domain_vtsm(dvdnav_t *t
return dvdnav_is_domain(this, VTSM_DOMAIN);
}
/* Video Title domain (playing movie). */
-int8_t dvdnav_is_domain_vts(dvdnav_t *this) {
+int8_t dvdnav_is_domain_vts(dvdnav_t *this) {
return dvdnav_is_domain(this, VTS_DOMAIN);
}
/* Generally delegate angle information handling to VM */
dvdnav_status_t dvdnav_angle_change(dvdnav_t *this, int32_t angle) {
int32_t num, current;
-
+
pthread_mutex_lock(&this->vm_lock);
vm_get_angle_info(this->vm, ¤t, &num);
/* Set angle SPRM if valid */
@@ -1138,29 +1138,29 @@ uint32_t dvdnav_get_next_still_flag(dvdn
}
user_ops_t dvdnav_get_restrictions(dvdnav_t* this) {
- /*
- * user_ops_t is a structure of 32 bits. We want to compute
- * the union of two of those bitfields so to make this quicker
+ /*
+ * user_ops_t is a structure of 32 bits. We want to compute
+ * the union of two of those bitfields so to make this quicker
* than performing 32 ORs, we will access them as 32bits words.
*/
union {
user_ops_t ops_struct;
uint32_t ops_int;
} ops;
-
+
ops.ops_int = 0;
-
+
if(!this->started) {
printerr("Virtual DVD machine not started.");
return ops.ops_struct;
}
-
- pthread_mutex_lock(&this->vm_lock);
+
+ pthread_mutex_lock(&this->vm_lock);
ops.ops_int |= *(uint32_t*)&this->pci.pci_gi.vobu_uop_ctl;
-
+
if(this->vm && this->vm->state.pgc)
ops.ops_int |= *(uint32_t*)&this->vm->state.pgc->prohibited_ops;
- pthread_mutex_unlock(&this->vm_lock);
-
+ pthread_mutex_unlock(&this->vm_lock);
+
return ops.ops_struct;
}
Modified: trunk/libdvdnav/src/dvdnav.h
==============================================================================
--- trunk/libdvdnav/src/dvdnav.h (original)
+++ trunk/libdvdnav/src/dvdnav.h Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2001 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -95,7 +95,7 @@ typedef int32_t dvdnav_status_t;
dvdnav_status_t dvdnav_open(dvdnav_t **dest, const char *path);
/*
- * Closes a dvdnav_t previously opened with dvdnav_open(), freeing any
+ * Closes a dvdnav_t previously opened with dvdnav_open(), freeing any
* memory associated with it.
*/
dvdnav_status_t dvdnav_close(dvdnav_t *self);
@@ -131,7 +131,7 @@ const char* dvdnav_err_to_string(dvdnav_
* Sets the region mask (bit 0 set implies region 1, bit 1 set implies
* region 2, etc) of the virtual machine. Generally you will only need to set
* this if you are playing RCE discs which query the virtual machine as to its
- * region setting.
+ * region setting.
*
* This has _nothing_ to do with the region setting of the DVD drive.
*/
@@ -185,12 +185,12 @@ dvdnav_status_t dvdnav_get_PGC_positioni
*********************************************************************/
/*
- * These functions are used to poll the playback enginge and actually get data
+ * These functions are used to poll the playback enginge and actually get data
* off the DVD.
*/
/*
- * Attempts to get the next block off the DVD and copies it into the buffer 'buf'.
+ * Attempts to get the next block off the DVD and copies it into the buffer 'buf'.
* If there is any special actions that may need to be performed, the value
* pointed to by 'event' gets set accordingly.
*
@@ -327,7 +327,7 @@ dvdnav_status_t dvdnav_current_title_inf
/*
* Return the current position (in blocks) within the current
* title and the length (in blocks) of said title.
- *
+ *
* Current implementation is wrong and likely to behave unpredictably!
* Use is discouraged!
*/
@@ -362,7 +362,7 @@ dvdnav_status_t dvdnav_part_search(dvdna
* 'origin' can be one of SEEK_SET, SEEK_CUR, SEEK_END as defined in
* fcntl.h.
*/
-dvdnav_status_t dvdnav_sector_search(dvdnav_t *self,
+dvdnav_status_t dvdnav_sector_search(dvdnav_t *self,
uint64_t offset, int32_t origin);
/*
@@ -377,7 +377,7 @@ int64_t dvdnav_get_current_time(dvdnav_t
*
* Currently unimplemented!
*/
-dvdnav_status_t dvdnav_time_search(dvdnav_t *self,
+dvdnav_status_t dvdnav_time_search(dvdnav_t *self,
uint64_t time);
/*
@@ -431,7 +431,7 @@ dvdnav_status_t dvdnav_get_position(dvdn
*/
/*
- * Get the currently highlighted button
+ * Get the currently highlighted button
* number (1..36) or 0 if no button is highlighted.
*/
dvdnav_status_t dvdnav_get_current_highlight(dvdnav_t *self, int32_t *button);
@@ -503,7 +503,7 @@ dvdnav_status_t dvdnav_mouse_activate(dv
* languages *
*********************************************************************/
-/*
+/*
* The language codes expected by these functions are two character
* codes as defined in ISO639.
*/
@@ -545,7 +545,7 @@ dvdnav_status_t dvdnav_get_title_string(
* Get video aspect code.
* The aspect code does only change on VTS boundaries.
* See the DVDNAV_VTS_CHANGE event.
- *
+ *
* 0 -- 4:3, 2 -- 16:9
*/
uint8_t dvdnav_get_video_aspect(dvdnav_t *self);
@@ -578,7 +578,7 @@ uint16_t dvdnav_audio_stream_format(dvdn
uint16_t dvdnav_audio_stream_channels(dvdnav_t *self, uint8_t stream);
/*
- * Converts a *logical* subpicture stream id into country code
+ * Converts a *logical* subpicture stream id into country code
* (returns 0xffff if no such stream).
*/
uint16_t dvdnav_spu_stream_to_lang(dvdnav_t *self, uint8_t stream);
@@ -615,9 +615,9 @@ int8_t dvdnav_get_active_audio_stream(dv
*/
int8_t dvdnav_get_active_spu_stream(dvdnav_t *self);
-/*
+/*
* Get the set of user operations that are currently prohibited.
- * There are potentially new restrictions right after
+ * There are potentially new restrictions right after
* DVDNAV_CHANNEL_HOP and DVDNAV_NAV_PACKET.
*/
user_ops_t dvdnav_get_restrictions(dvdnav_t *self);
Modified: trunk/libdvdnav/src/dvdnav_events.h
==============================================================================
--- trunk/libdvdnav/src/dvdnav_events.h (original)
+++ trunk/libdvdnav/src/dvdnav_events.h Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2001 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -22,7 +22,7 @@
*/
/*
- * This header defines events and event types
+ * This header defines events and event types
*/
#ifndef DVDNAV_EVENTS_H_INCLUDED
@@ -87,7 +87,7 @@ typedef struct {
* Use this, if you blend the SPU on an anamorphic image after
* unsqueezing it the pan&scan way. */
int physical_pan_scan;
-
+
/* The logical (DVD) stream number. */
int logical;
} dvdnav_spu_stream_change_event_t;
@@ -194,7 +194,7 @@ typedef struct {
int display;
/* FIXME: these fields are currently not set */
- uint32_t palette; /* The CLUT entries for the highlight palette
+ uint32_t palette; /* The CLUT entries for the highlight palette
(4-bits per entry -> 4 entries) */
uint16_t sx,sy,ex,ey; /* The start/end x,y positions */
uint32_t pts; /* Highlight PTS to match with SPU */
Modified: trunk/libdvdnav/src/dvdnav_internal.h
==============================================================================
--- trunk/libdvdnav/src/dvdnav_internal.h (original)
+++ trunk/libdvdnav/src/dvdnav_internal.h Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2001-2004 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -83,7 +83,7 @@ typedef struct read_cache_s read_cache_t
/*
* These are defined here because they are
- * not in ifo_types.h, they maybe one day
+ * not in ifo_types.h, they maybe one day
*/
#ifndef audio_status_t
@@ -96,7 +96,7 @@ typedef struct {
#else
uint8_t zero2;
unsigned int stream_number : 3;
- unsigned int zero1 : 4;
+ unsigned int zero1 : 4;
unsigned int available : 1;
#endif
} ATTRIBUTE_PACKED audio_status_t;
@@ -133,35 +133,35 @@ typedef struct dvdnav_vobu_s {
int32_t vobu_length;
int32_t blockN; /* Relative offset */
int32_t vobu_next; /* Relative offset */
-} dvdnav_vobu_t;
-
+} dvdnav_vobu_t;
+
/** The main DVDNAV type **/
struct dvdnav_s {
/* General data */
char path[MAX_PATH_LEN]; /* Path to DVD device/dir */
dvd_file_t *file; /* Currently opened file */
-
+
/* Position data */
vm_position_t position_next;
vm_position_t position_current;
- dvdnav_vobu_t vobu;
+ dvdnav_vobu_t vobu;
/* NAV data */
pci_t pci;
dsi_t dsi;
uint32_t last_cmd_nav_lbn; /* detects when a command is issued on an already left NAV */
-
+
/* Flags */
int skip_still; /* Set when skipping a still */
int sync_wait; /* applications should wait till they are in sync with us */
int sync_wait_skip; /* Set when skipping wait state */
- int spu_clut_changed; /* The SPU CLUT changed */
+ int spu_clut_changed; /* The SPU CLUT changed */
int started; /* vm_start has been called? */
int use_read_ahead; /* 1 - use read-ahead cache, 0 - don't */
int pgc_based; /* positioning works PGC based instead of PG based */
int cur_cell_time; /* time expired since the beginning of the current cell, read from the dsi */
-
+
/* VM */
vm_t *vm;
pthread_mutex_t vm_lock;
Modified: trunk/libdvdnav/src/highlight.c
==============================================================================
--- trunk/libdvdnav/src/highlight.c (original)
+++ trunk/libdvdnav/src/highlight.c Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -221,7 +221,7 @@ dvdnav_status_t dvdnav_get_current_highl
/* Simply return the appropriate value based on the SPRM */
if(((*button) = this->position_current.button) == -1)
(*button) = this->vm->state.HL_BTNN_REG >> 10;
-
+
return DVDNAV_STATUS_OK;
}
@@ -241,7 +241,7 @@ static btni_t *get_current_button(dvdnav
#ifdef BUTTON_TESTING
nav_print_PCI(pci);
#endif
-
+
return &(pci->hli.btnit[button-1]);
}
@@ -253,7 +253,7 @@ static dvdnav_status_t button_auto_actio
dvdnav_status_t dvdnav_upper_button_select(dvdnav_t *this, pci_t *pci) {
btni_t *button_ptr;
-
+
if(!(button_ptr = get_current_button(this, pci)))
return DVDNAV_STATUS_ERR;
@@ -263,7 +263,7 @@ dvdnav_status_t dvdnav_upper_button_sele
dvdnav_status_t dvdnav_lower_button_select(dvdnav_t *this, pci_t *pci) {
btni_t *button_ptr;
-
+
if(!(button_ptr = get_current_button(this, pci)))
return DVDNAV_STATUS_ERR;
@@ -273,7 +273,7 @@ dvdnav_status_t dvdnav_lower_button_sele
dvdnav_status_t dvdnav_right_button_select(dvdnav_t *this, pci_t *pci) {
btni_t *button_ptr;
-
+
if(!(button_ptr = get_current_button(this, pci)))
return DVDNAV_STATUS_ERR;
@@ -283,7 +283,7 @@ dvdnav_status_t dvdnav_right_button_sele
dvdnav_status_t dvdnav_left_button_select(dvdnav_t *this, pci_t *pci) {
btni_t *button_ptr;
-
+
if(!(button_ptr = get_current_button(this, pci)))
return DVDNAV_STATUS_ERR;
@@ -291,14 +291,14 @@ dvdnav_status_t dvdnav_left_button_selec
return button_auto_action(this, pci);
}
-dvdnav_status_t dvdnav_get_highlight_area(pci_t *nav_pci , int32_t button, int32_t mode,
+dvdnav_status_t dvdnav_get_highlight_area(pci_t *nav_pci , int32_t button, int32_t mode,
dvdnav_highlight_area_t *highlight) {
btni_t *button_ptr;
#ifdef BUTTON_TESTING
fprintf(MSG_OUT, "libdvdnav: Button get_highlight_area %i\n", button);
#endif
-
+
if(!nav_pci->hli.hl_gi.hli_ss)
return DVDNAV_STATUS_ERR;
if((button <= 0) || (button > nav_pci->hli.hl_gi.btn_ns))
@@ -341,7 +341,7 @@ dvdnav_status_t dvdnav_button_activate(d
printerr("This NAV has already been left.");
return DVDNAV_STATUS_ERR;
}
- pthread_mutex_lock(&this->vm_lock);
+ pthread_mutex_lock(&this->vm_lock);
button = this->vm->state.HL_BTNN_REG >> 10;
@@ -366,10 +366,10 @@ dvdnav_status_t dvdnav_button_activate(d
printerr("");
return DVDNAV_STATUS_OK;
}
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
-
+
button_ptr = get_current_button(this, pci);
/* Finally, make the VM execute the appropriate code and probably
* scedule a jump */
@@ -382,8 +382,8 @@ dvdnav_status_t dvdnav_button_activate(d
this->position_current.still = 0;
this->last_cmd_nav_lbn = pci->pci_gi.nv_pck_lbn;
}
-
- pthread_mutex_unlock(&this->vm_lock);
+
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
@@ -407,7 +407,7 @@ dvdnav_status_t dvdnav_button_activate_c
this->sync_wait = 0;
pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
-}
+}
dvdnav_status_t dvdnav_button_select(dvdnav_t *this, pci_t *pci, int32_t button) {
if(!pci->hli.hl_gi.hli_ss) {
@@ -418,23 +418,23 @@ dvdnav_status_t dvdnav_button_select(dvd
printerr("This NAV has already been left.");
return DVDNAV_STATUS_ERR;
}
-
+
#ifdef BUTTON_TESTING
- fprintf(MSG_OUT, "libdvdnav: Button select %i\n", button);
+ fprintf(MSG_OUT, "libdvdnav: Button select %i\n", button);
#endif
-
+
if((button <= 0) || (button > pci->hli.hl_gi.btn_ns)) {
printerr("Button does not exist.");
return DVDNAV_STATUS_ERR;
}
-
+
this->vm->state.HL_BTNN_REG = (button << 10);
this->position_current.button = -1; /* Force Highligh change */
return DVDNAV_STATUS_OK;
}
-dvdnav_status_t dvdnav_button_select_and_activate(dvdnav_t *this, pci_t *pci,
+dvdnav_status_t dvdnav_button_select_and_activate(dvdnav_t *this, pci_t *pci,
int32_t button) {
/* A trivial function */
if(dvdnav_button_select(this, pci, button) != DVDNAV_STATUS_ERR)
@@ -460,7 +460,7 @@ dvdnav_status_t dvdnav_mouse_select(dvdn
best = 0;
dist = 0x08000000; /* >> than (720*720)+(567*567); */
-
+
/* Loop through all buttons */
for(button = 1; button <= pci->hli.hl_gi.btn_ns; button++) {
btni_t *button_ptr = &(pci->hli.btnit[button-1]);
Modified: trunk/libdvdnav/src/navigation.c
==============================================================================
--- trunk/libdvdnav/src/navigation.c (original)
+++ trunk/libdvdnav/src/navigation.c Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -86,7 +86,7 @@ dvdnav_status_t dvdnav_get_number_of_par
dvdnav_status_t dvdnav_current_title_info(dvdnav_t *this, int32_t *title, int32_t *part) {
int32_t retval;
-
+
pthread_mutex_lock(&this->vm_lock);
if (!this->vm->vtsi || !this->vm->vmgi) {
printerr("Bad VM state.");
Modified: trunk/libdvdnav/src/read_cache.c
==============================================================================
--- trunk/libdvdnav/src/read_cache.c (original)
+++ trunk/libdvdnav/src/read_cache.c Sat Sep 6 23:55:51 2008
@@ -260,7 +260,7 @@ int dvdnav_read_cache_block(read_cache_t
if (use >= 0) {
read_cache_chunk_t *chunk;
-
+
/* Increment read-ahead size if sector follows the last sector */
if (sector == (self->last_sector + 1)) {
if (self->read_ahead_incr < READ_AHEAD_SIZE_MAX)
Modified: trunk/libdvdnav/src/read_cache.h
==============================================================================
--- trunk/libdvdnav/src/read_cache.h (original)
+++ trunk/libdvdnav/src/read_cache.h Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -28,7 +28,7 @@
/* typedef struct read_cache_s read_cache_t; */
/* EXPERIMENTAL: Setting the following to 1 will use an experimental multi-threaded
- * read-ahead cache.
+ * read-ahead cache.
*/
#define _MULTITHREAD_ 0
Modified: trunk/libdvdnav/src/remap.c
==============================================================================
--- trunk/libdvdnav/src/remap.c (original)
+++ trunk/libdvdnav/src/remap.c Sat Sep 6 23:55:51 2008
@@ -26,7 +26,7 @@
#include <string.h>
#include <stdio.h>
-#ifndef _MSC_VER
+#ifndef _MSC_VER
#include <sys/param.h>
#include <sys/fcntl.h>
#else
@@ -98,7 +98,7 @@ static int compare_block( block_t *a, bl
} else if (a->start_block > b->end_block) {
/*
* if a->start_block == b->end_block then the two regions
- * aren't strictly overlapping, but they should be merged
+ * aren't strictly overlapping, but they should be merged
* anyway since there are zero blocks between them
*/
return 1;
@@ -154,7 +154,7 @@ static void remap_add_node( remap_t *map
}
}
-static int parseblock(char *buf, int *dom, int *tt, int *pg,
+static int parseblock(char *buf, int *dom, int *tt, int *pg,
unsigned long *start, unsigned long *end) {
long tmp;
char *tok;
@@ -184,7 +184,7 @@ static int parseblock(char *buf, int *do
case 4:
*end = tmp;
break;
- }
+ }
st++;
tok = strtok( NULL, " ");
}
@@ -223,7 +223,7 @@ remap_t* remap_loadmap( char *title) {
if (strncasecmp( buf, "debug", 5) == 0) {
map->debug = 1;
} else {
- res = parseblock( buf,
+ res = parseblock( buf,
&tmp.domain, &tmp.title, &tmp.program, &tmp.start_block, &tmp.end_block);
if (res != 5) {
fprintf(MSG_OUT, "libdvdnav: Ignoring map line (%d): %s\n", res, buf);
@@ -241,9 +241,9 @@ remap_t* remap_loadmap( char *title) {
return map;
}
-unsigned long remap_block(
- remap_t *map, int domain, int title, int program,
- unsigned long cblock, unsigned long offset)
+unsigned long remap_block(
+ remap_t *map, int domain, int title, int program,
+ unsigned long cblock, unsigned long offset)
{
block_t key;
block_t *b;
@@ -258,7 +258,7 @@ unsigned long remap_block(
key.program = program;
key.start_block = key.end_block = cblock + offset;
b = findblock( map, &key);
-
+
if (b) {
if (map->debug) {
fprintf(MSG_OUT, "libdvdnav: Redirected to %lx\n", b->end_block);
Modified: trunk/libdvdnav/src/remap.h
==============================================================================
--- trunk/libdvdnav/src/remap.h (original)
+++ trunk/libdvdnav/src/remap.h Sat Sep 6 23:55:51 2008
@@ -1,16 +1,16 @@
-/*
+/*
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -26,8 +26,8 @@ typedef struct remap_s remap_t;
remap_t* remap_loadmap( char *title);
-unsigned long remap_block(
- remap_t *map, int domain, int title, int program,
+unsigned long remap_block(
+ remap_t *map, int domain, int title, int program,
unsigned long cblock, unsigned long offset);
#endif
Modified: trunk/libdvdnav/src/searching.c
==============================================================================
--- trunk/libdvdnav/src/searching.c (original)
+++ trunk/libdvdnav/src/searching.c Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -104,7 +104,7 @@ static dvdnav_status_t dvdnav_scan_admap
only the cell times */
dvdnav_status_t dvdnav_time_search(dvdnav_t *this,
uint64_t time) {
-
+
uint64_t target = time;
uint64_t length = 0;
uint32_t first_cell_nr, last_cell_nr, cell_nr;
@@ -116,7 +116,7 @@ dvdnav_status_t dvdnav_time_search(dvdna
printerr("Cannot seek in a still frame.");
return DVDNAV_STATUS_ERR;
}
-
+
pthread_mutex_lock(&this->vm_lock);
state = &(this->vm->state);
if(!state->pgc) {
@@ -125,8 +125,8 @@ dvdnav_status_t dvdnav_time_search(dvdna
return DVDNAV_STATUS_ERR;
}
-
- this->cur_cell_time = 0;
+
+ this->cur_cell_time = 0;
if (this->pgc_based) {
first_cell_nr = 1;
last_cell_nr = state->pgc->nr_of_cells;
@@ -152,7 +152,7 @@ dvdnav_status_t dvdnav_time_search(dvdna
/* FIXME: there must be a better way than interpolation */
target = target * (cell->last_sector - cell->first_sector + 1) / length;
target += cell->first_sector;
-
+
found = 1;
break;
}
@@ -166,7 +166,7 @@ dvdnav_status_t dvdnav_time_search(dvdna
#endif
if (dvdnav_scan_admap(this, state->domain, target, &vobu) == DVDNAV_STATUS_OK) {
uint32_t start = state->pgc->cell_playback[cell_nr-1].first_sector;
-
+
if (vm_jump_cell_block(this->vm, cell_nr, vobu - start)) {
#ifdef LOG_DEBUG
fprintf(MSG_OUT, "libdvdnav: After cellN=%u blockN=%u target=%x vobu=%x start=%x\n" ,
@@ -178,7 +178,7 @@ dvdnav_status_t dvdnav_time_search(dvdna
}
}
}
-
+
fprintf(MSG_OUT, "libdvdnav: Error when seeking\n");
printerr("Error when seeking.");
pthread_mutex_unlock(&this->vm_lock);
@@ -199,12 +199,12 @@ dvdnav_status_t dvdnav_sector_search(dvd
printerr("Cannot seek in a still frame.");
return DVDNAV_STATUS_ERR;
}
-
+
result = dvdnav_get_position(this, &target, &length);
if(!result) {
return DVDNAV_STATUS_ERR;
}
-
+
pthread_mutex_lock(&this->vm_lock);
state = &(this->vm->state);
if(!state->pgc) {
@@ -213,7 +213,7 @@ dvdnav_status_t dvdnav_sector_search(dvd
return DVDNAV_STATUS_ERR;
}
#ifdef LOG_DEBUG
- fprintf(MSG_OUT, "libdvdnav: seeking to offset=%lu pos=%u length=%u\n", offset, target, length);
+ fprintf(MSG_OUT, "libdvdnav: seeking to offset=%lu pos=%u length=%u\n", offset, target, length);
fprintf(MSG_OUT, "libdvdnav: Before cellN=%u blockN=%u\n", state->cellN, state->blockN);
#endif
@@ -248,7 +248,7 @@ dvdnav_status_t dvdnav_sector_search(dvd
pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
-
+
this->cur_cell_time = 0;
if (this->pgc_based) {
first_cell_nr = 1;
@@ -287,7 +287,7 @@ dvdnav_status_t dvdnav_sector_search(dvd
#endif
if (dvdnav_scan_admap(this, state->domain, target, &vobu) == DVDNAV_STATUS_OK) {
int32_t start = state->pgc->cell_playback[cell_nr-1].first_sector;
-
+
if (vm_jump_cell_block(this->vm, cell_nr, vobu - start)) {
#ifdef LOG_DEBUG
fprintf(MSG_OUT, "libdvdnav: After cellN=%u blockN=%u target=%x vobu=%x start=%x\n" ,
@@ -299,9 +299,9 @@ dvdnav_status_t dvdnav_sector_search(dvd
}
}
}
-
+
fprintf(MSG_OUT, "libdvdnav: Error when seeking\n");
- fprintf(MSG_OUT, "libdvdnav: FIXME: Implement seeking to location %u\n", target);
+ fprintf(MSG_OUT, "libdvdnav: FIXME: Implement seeking to location %u\n", target);
printerr("Error when seeking.");
pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
@@ -309,7 +309,7 @@ dvdnav_status_t dvdnav_sector_search(dvd
dvdnav_status_t dvdnav_part_search(dvdnav_t *this, int32_t part) {
int32_t title, old_part;
-
+
if (dvdnav_current_title_info(this, &title, &old_part) == DVDNAV_STATUS_OK)
return dvdnav_part_play(this, title, part);
return DVDNAV_STATUS_ERR;
@@ -415,14 +415,14 @@ dvdnav_status_t dvdnav_next_pg_search(dv
dvdnav_status_t dvdnav_menu_call(dvdnav_t *this, DVDMenuID_t menu) {
vm_t *try_vm;
-
+
pthread_mutex_lock(&this->vm_lock);
if(!this->vm->state.pgc) {
printerr("No current PGC.");
pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
-
+
this->cur_cell_time = 0;
/* make a copy of current VM and try to navigate the copy to the menu */
try_vm = vm_new_copy(this->vm);
@@ -434,24 +434,24 @@ dvdnav_status_t dvdnav_menu_call(dvdnav_
vm_free_copy(try_vm);
this->position_current.still = 0;
this->vm->hop_channel++;
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
}
}
if (menu == DVD_MENU_Escape) menu = DVD_MENU_Root;
-
+
if (vm_jump_menu(try_vm, menu) && !try_vm->stopped) {
/* merge changes on success */
vm_merge(this->vm, try_vm);
vm_free_copy(try_vm);
this->position_current.still = 0;
this->vm->hop_channel++;
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_OK;
} else {
vm_free_copy(try_vm);
printerr("No such menu or menu not reachable.");
- pthread_mutex_unlock(&this->vm_lock);
+ pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
}
@@ -511,7 +511,7 @@ dvdnav_status_t dvdnav_get_position(dvdn
}
*len += cell->last_sector - cell->first_sector + 1;
}
-
+
assert((signed)*pos != -1);
pthread_mutex_unlock(&this->vm_lock);
@@ -543,10 +543,10 @@ dvdnav_status_t dvdnav_get_position_in_t
first_cell = &(state->pgc->cell_playback[first_cell_nr-1]);
last_cell_nr = state->pgc->nr_of_cells;
last_cell = &(state->pgc->cell_playback[last_cell_nr-1]);
-
+
*pos = cur_sector - first_cell->first_sector;
*len = last_cell->last_sector - first_cell->first_sector;
-
+
return DVDNAV_STATUS_OK;
}
@@ -577,15 +577,15 @@ uint32_t dvdnav_describe_title_chapters(
printerr("Couldn't open IFO for chosen title, exit.");
goto fail;
}
-
+
ptitle = &this->vm->vmgi->tt_srpt->title[title-1];
parts = ptitle->nr_of_ptts;
ptt = ifo->vts_ptt_srpt->title[ptitle->vts_ttn-1].ptt;
-
+
tmp = calloc(1, sizeof(uint64_t)*parts);
if(!tmp)
goto fail;
-
+
length = 0;
for(i=0; i<parts; i++) {
uint32_t cellnr, endcellnr;
@@ -594,13 +594,13 @@ uint32_t dvdnav_describe_title_chapters(
printerr("WRONG part number.");
goto fail;
}
-
+
cellnr = pgc->program_map[ptt[i].pgn-1];
if(ptt[i].pgn < pgc->nr_of_programs)
endcellnr = pgc->program_map[ptt[i].pgn];
else
endcellnr = 0;
-
+
do {
cell = &pgc->cell_playback[cellnr-1];
if(!(cell->block_type == BLOCK_TYPE_ANGLE_BLOCK &&
Modified: trunk/libdvdnav/src/settings.c
==============================================================================
--- trunk/libdvdnav/src/settings.c (original)
+++ trunk/libdvdnav/src/settings.c Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -67,7 +67,7 @@ static dvdnav_status_t set_language_regi
printerr("Passed illegal language code.");
return DVDNAV_STATUS_ERR;
}
-
+
pthread_mutex_lock(&this->vm_lock);
this->vm->state.registers.SPRM[reg] = (code[0] << 8) | code[1];
pthread_mutex_unlock(&this->vm_lock);
Modified: trunk/libdvdnav/src/vm/decoder.c
==============================================================================
--- trunk/libdvdnav/src/vm/decoder.c (original)
+++ trunk/libdvdnav/src/vm/decoder.c Sat Sep 6 23:55:51 2008
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2000, 2001 Martin Norbäck, Håkan Hjort
* 2002-2004 the dvdnav project
- *
+ *
* This file is part of libdvdnav, a DVD navigation library. It is modified
* from a file originally part of the Ogle DVD player.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -49,7 +49,7 @@ uint32_t vm_getbits(command_t *command,
uint64_t bit_mask = 0;
uint64_t examining = 0;
int32_t bits;
-
+
if (count == 0) return 0;
if ( ((start - count) < -1) ||
@@ -79,19 +79,19 @@ static uint16_t get_GPRM(registers_t* re
gettimeofday(¤t_time, NULL);
time_offset.tv_sec = current_time.tv_sec - registers->GPRM_time[reg].tv_sec;
time_offset.tv_usec = current_time.tv_usec - registers->GPRM_time[reg].tv_usec;
- if (time_offset.tv_usec < 0) {
- time_offset.tv_sec--;
+ if (time_offset.tv_usec < 0) {
+ time_offset.tv_sec--;
time_offset.tv_usec += 1000000;
}
result = (uint16_t) (time_offset.tv_sec & 0xffff);
registers->GPRM[reg]=result;
- return result;
+ return result;
} else {
/* Register mode */
return registers->GPRM[reg];
}
-
+
}
static void set_GPRM(registers_t* registers, uint8_t reg, uint16_t value) {
@@ -134,7 +134,7 @@ static uint16_t eval_reg_or_data(command
xBBB_BBBB, if immediate use all 7 bits for data else use
lower four bits for the general purpose register number. */
/* Evaluates gprm or data depending on bit, data is in byte n */
-static uint16_t eval_reg_or_data_2(command_t* command,
+static uint16_t eval_reg_or_data_2(command_t* command,
int32_t imm, int32_t start) {
if(imm) /* immediate */
return vm_getbits(command, (start - 1), 7);
@@ -143,7 +143,7 @@ static uint16_t eval_reg_or_data_2(comma
}
-/* Compare data using operation, return result from comparison.
+/* Compare data using operation, return result from comparison.
Helper function for the different if functions. */
static int32_t eval_compare(uint8_t operation, uint16_t data1, uint16_t data2) {
switch(operation) {
@@ -172,7 +172,7 @@ static int32_t eval_compare(uint8_t oper
static int32_t eval_if_version_1(command_t* command) {
uint8_t op = vm_getbits(command, 54, 3);
if(op) {
- return eval_compare(op, eval_reg(command, vm_getbits(command, 39, 8)),
+ return eval_compare(op, eval_reg(command, vm_getbits(command, 39, 8)),
eval_reg_or_data(command, vm_getbits(command, 55, 1), 31));
}
return 1;
@@ -183,7 +183,7 @@ static int32_t eval_if_version_1(command
static int32_t eval_if_version_2(command_t* command) {
uint8_t op = vm_getbits(command, 54, 3);
if(op) {
- return eval_compare(op, eval_reg(command, vm_getbits(command, 15, 8)),
+ return eval_compare(op, eval_reg(command, vm_getbits(command, 15, 8)),
eval_reg(command, vm_getbits(command, 7, 8)));
}
return 1;
@@ -194,19 +194,19 @@ static int32_t eval_if_version_2(command
static int32_t eval_if_version_3(command_t* command) {
uint8_t op = vm_getbits(command, 54, 3);
if(op) {
- return eval_compare(op, eval_reg(command, vm_getbits(command, 47, 8)),
+ return eval_compare(op, eval_reg(command, vm_getbits(command, 47, 8)),
eval_reg_or_data(command, vm_getbits(command, 55, 1), 15));
}
return 1;
}
/* Evaluate if version 4.
- Has comparison data in byte 1 and 4-5 (immediate or register)
+ Has comparison data in byte 1 and 4-5 (immediate or register)
The register in byte 1 is only the lowe nibble (4 bits) */
static int32_t eval_if_version_4(command_t* command) {
uint8_t op = vm_getbits(command, 54, 3);
if(op) {
- return eval_compare(op, eval_reg(command, vm_getbits(command, 51, 4)),
+ return eval_compare(op, eval_reg(command, vm_getbits(command, 51, 4)),
eval_reg_or_data(command, vm_getbits(command, 55, 1), 31));
}
return 1;
@@ -216,7 +216,7 @@ static int32_t eval_if_version_4(command
0 if no new row and 256 if Break. */
static int32_t eval_special_instruction(command_t* command, int32_t cond) {
int32_t line, level;
-
+
switch(vm_getbits(command, 51, 4)) {
case 0: /* NOP */
line = 0;
@@ -229,7 +229,7 @@ static int32_t eval_special_instruction(
line = 256;
return cond ? 256 : 0;
case 3: /* Set temporary parental level and goto */
- line = vm_getbits(command, 7, 8);
+ line = vm_getbits(command, 7, 8);
level = vm_getbits(command, 11, 4);
if(cond) {
/* This always succeeds now, if we want real parental protection */
@@ -247,7 +247,7 @@ static int32_t eval_special_instruction(
static int32_t eval_link_subins(command_t* command, int32_t cond, link_t *return_values) {
uint16_t button = vm_getbits(command, 15, 6);
uint8_t linkop = vm_getbits(command, 4, 5);
-
+
if(linkop > 0x10)
return 0; /* Unknown Link by Sub-Instruction command */
@@ -263,7 +263,7 @@ static int32_t eval_link_subins(command_
Actual link instruction is in return_values parameter */
static int32_t eval_link_instruction(command_t* command, int32_t cond, link_t *return_values) {
uint8_t op = vm_getbits(command, 51, 4);
-
+
switch(op) {
case 1:
return eval_link_subins(command, cond, return_values);
@@ -295,7 +295,7 @@ static int32_t eval_link_instruction(com
returns 1 if jump or 0 if no jump
actual jump instruction is in return_values parameter */
static int32_t eval_jump_instruction(command_t* command, int32_t cond, link_t *return_values) {
-
+
switch(vm_getbits(command, 51, 4)) {
case 1:
return_values->command = Exit;
@@ -361,12 +361,12 @@ static int32_t eval_jump_instruction(com
return 0;
}
-/* Evaluate a set sytem register instruction
+/* Evaluate a set sytem register instruction
May contain a link so return the same as eval_link */
static int32_t eval_system_set(command_t* command, int32_t cond, link_t *return_values) {
int32_t i;
uint16_t data, data2;
-
+
switch(vm_getbits(command, 59, 4)) {
case 1: /* Set system reg 1 &| 2 &| 3 (Audio, Subp. Angle) */
for(i = 1; i <= 3; i++) {
@@ -418,7 +418,7 @@ static int32_t eval_system_set(command_t
*/
static void eval_set_op(command_t* command, int32_t op, int32_t reg, int32_t reg2, int32_t data) {
static const int32_t shortmax = 0xffff;
- int32_t tmp;
+ int32_t tmp;
switch(op) {
case 1:
set_GPRM(command->registers, reg, data);
@@ -589,11 +589,11 @@ static int32_t eval_command(uint8_t *byt
}
/* Evaluate a set of commands in the given register set (which is modified) */
-int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands,
+int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands,
registers_t *registers, link_t *return_values) {
int32_t i = 0;
int32_t total = 0;
-
+
#ifdef TRACE
/* DEBUG */
fprintf(MSG_OUT, "libdvdnav: Registers before transaction\n");
@@ -605,25 +605,25 @@ int32_t vmEval_CMD(vm_cmd_t commands[],
fprintf(MSG_OUT, "libdvdnav: Single stepping commands\n");
#endif
- i = 0;
+ i = 0;
while(i < num_commands && total < 100000) {
int32_t line;
-
+
#ifdef TRACE
vm_print_cmd(i, &commands[i]);
#endif
line = eval_command(&commands[i].bytes[0], registers, return_values);
-
+
if (line < 0) { /* Link command */
#ifdef TRACE
fprintf(MSG_OUT, "libdvdnav: Registers after transaction\n");
vm_print_registers( registers );
- fprintf(MSG_OUT, "libdvdnav: eval: Doing Link/Jump/Call\n");
+ fprintf(MSG_OUT, "libdvdnav: eval: Doing Link/Jump/Call\n");
#endif
return 1;
}
-
+
if (line > 0) /* Goto command */
i = line - 1;
else /* Just continue on the next line */
@@ -631,7 +631,7 @@ int32_t vmEval_CMD(vm_cmd_t commands[],
total++;
}
-
+
memset(return_values, 0, sizeof(link_t));
#ifdef TRACE
fprintf(MSG_OUT, "libdvdnav: Registers after transaction\n");
@@ -710,7 +710,7 @@ static char *linkcmd2str(link_cmd_t cmd)
void vm_print_link(link_t value) {
char *cmd = linkcmd2str(value.command);
-
+
switch(value.command) {
case LinkNoLink:
case LinkTopC:
@@ -748,7 +748,7 @@ void vm_print_link(link_t value) {
fprintf(MSG_OUT, "libdvdnav: %s %d:%d\n", cmd, value.data1, value.data2);
break;
case JumpSS_VTSM:
- fprintf(MSG_OUT, "libdvdnav: %s vts %d title %d menu %d\n",
+ fprintf(MSG_OUT, "libdvdnav: %s vts %d title %d menu %d\n",
cmd, value.data1, value.data2, value.data3);
break;
case CallSS_FP:
Modified: trunk/libdvdnav/src/vm/decoder.h
==============================================================================
--- trunk/libdvdnav/src/vm/decoder.h (original)
+++ trunk/libdvdnav/src/vm/decoder.h Sat Sep 6 23:55:51 2008
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2000, 2001 Martin Norbäck, Håkan Hjort
- *
+ *
* This file is part of libdvdnav, a DVD navigation library. It is modified
* from a file originally part of the Ogle DVD player.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -95,7 +95,7 @@ typedef struct {
/* the big VM function, executing the given commands and writing
* the link where to continue, the return value indicates if a jump
* has been performed */
-int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands,
+int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands,
registers_t *registers, link_t *return_values);
/* extracts some bits from the command */
Modified: trunk/libdvdnav/src/vm/vm.c
==============================================================================
--- trunk/libdvdnav/src/vm/vm.c (original)
+++ trunk/libdvdnav/src/vm/vm.c Sat Sep 6 23:55:51 2008
@@ -2,20 +2,20 @@
* Copyright (C) 2000, 2001 Håkan Hjort
* Copyright (C) 2001 Rich Wareham <richwareham at users.sourceforge.net>
* 2002-2004 the dvdnav project
- *
+ *
* This file is part of libdvdnav, a DVD navigation library. It is modified
* from a file originally part of the Ogle DVD player.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -114,7 +114,7 @@ static void vm_print_current_domain_stat
fprintf(MSG_OUT, "libdvdnav: Video Manager Menu Domain: -\n");
break;
- case FP_DOMAIN:
+ case FP_DOMAIN:
fprintf(MSG_OUT, "libdvdnav: First Play Domain: -\n");
break;
@@ -122,7 +122,7 @@ static void vm_print_current_domain_stat
fprintf(MSG_OUT, "libdvdnav: Unknown Domain: -\n");
break;
}
- fprintf(MSG_OUT, "libdvdnav: VTS:%d PGC:%d PG:%u CELL:%u BLOCK:%u VTS_TTN:%u TTN:%u TT_PGCN:%u\n",
+ fprintf(MSG_OUT, "libdvdnav: VTS:%d PGC:%d PG:%u CELL:%u BLOCK:%u VTS_TTN:%u TTN:%u TT_PGCN:%u\n",
(vm->state).vtsN,
get_PGCN(vm),
(vm->state).pgN,
@@ -144,10 +144,10 @@ static void dvd_read_name(char *name, co
/* Read DVD name */
fd = open(device, O_RDONLY);
- if (fd > 0) {
+ if (fd > 0) {
off = lseek( fd, 32 * (off_t) DVD_VIDEO_LB_LEN, SEEK_SET );
if( off == ( 32 * (off_t) DVD_VIDEO_LB_LEN ) ) {
- off = read( fd, data, DVD_VIDEO_LB_LEN );
+ off = read( fd, data, DVD_VIDEO_LB_LEN );
close(fd);
if (off == ( (off_t) DVD_VIDEO_LB_LEN )) {
fprintf(MSG_OUT, "libdvdnav: DVD Title: ");
@@ -168,7 +168,7 @@ static void dvd_read_name(char *name, co
fprintf(MSG_OUT, "%c", data[i]);
} else {
fprintf(MSG_OUT, " ");
- }
+ }
}
fprintf(MSG_OUT, "\nlibdvdnav: DVD Title (Alternative): ");
for(i=89; i < 128; i++ ) {
@@ -196,10 +196,10 @@ static int ifoOpenNewVTSI(vm_t *vm, dvd_
if((vm->state).vtsN == vtsN) {
return 1; /* We alread have it */
}
-
+
if(vm->vtsi != NULL)
ifoClose(vm->vtsi);
-
+
vm->vtsi = ifoOpenVTSI(dvd, vtsN);
if(vm->vtsi == NULL) {
fprintf(MSG_OUT, "libdvdnav: ifoOpenVTSI failed\n");
@@ -226,7 +226,7 @@ static int ifoOpenNewVTSI(vm_t *vm, dvd_
return 0;
}
(vm->state).vtsN = vtsN;
-
+
return 1;
}
@@ -285,7 +285,7 @@ void vm_stop(vm_t *vm) {
}
vm->stopped = 1;
}
-
+
int vm_reset(vm_t *vm, const char *dvdroot) {
/* Setup State */
memset((vm->state).registers.SPRM, 0, sizeof((vm->state).registers.SPRM));
@@ -308,7 +308,7 @@ int vm_reset(vm_t *vm, const char *dvdro
(vm->state).registers.SPRM[18] = ('e'<<8)|'n'; /* Initial Language Code for Spu */
(vm->state).registers.SPRM[20] = 0x1; /* Player Regional Code Mask. Region free! */
(vm->state).registers.SPRM[14] = 0x100; /* Try Pan&Scan */
-
+
(vm->state).pgN = 0;
(vm->state).cellN = 0;
(vm->state).cell_restart = 0;
@@ -317,9 +317,9 @@ int vm_reset(vm_t *vm, const char *dvdro
(vm->state).rsm_vtsN = 0;
(vm->state).rsm_cellN = 0;
(vm->state).rsm_blockN = 0;
-
+
(vm->state).vtsN = -1;
-
+
if (vm->dvd && dvdroot) {
/* a new dvd device has been requested */
vm_stop(vm);
@@ -383,11 +383,11 @@ vm_t *vm_new_copy(vm_t *source) {
int vtsN;
int pgcN = get_PGCN(source);
int pgN = (source->state).pgN;
-
+
assert(pgcN);
-
+
memcpy(target, source, sizeof(vm_t));
-
+
/* open a new vtsi handle, because the copy might switch to another VTS */
target->vtsi = NULL;
vtsN = (target->state).vtsN;
@@ -395,13 +395,13 @@ vm_t *vm_new_copy(vm_t *source) {
(target->state).vtsN = 0;
if (!ifoOpenNewVTSI(target, target->dvd, vtsN))
assert(0);
-
+
/* restore pgc pointer into the new vtsi */
if (!set_PGCN(target, pgcN))
assert(0);
(target->state).pgN = pgN;
}
-
+
return target;
}
@@ -423,8 +423,8 @@ void vm_free_copy(vm_t *vm) {
void vm_position_get(vm_t *vm, vm_position_t *position) {
position->button = (vm->state).HL_BTNN_REG >> 10;
- position->vts = (vm->state).vtsN;
- position->domain = (vm->state).domain;
+ position->vts = (vm->state).vtsN;
+ position->domain = (vm->state).domain;
position->spu_channel = (vm->state).SPST_REG;
position->audio_channel = (vm->state).AST_REG;
position->angle_channel = (vm->state).AGL_REG;
@@ -494,7 +494,7 @@ int vm_jump_cell_block(vm_t *vm, int cel
int vm_jump_title_part(vm_t *vm, int title, int part) {
link_t link;
-
+
if(!set_PTT(vm, title, part))
return 0;
/* Some DVDs do not want us to jump directly into a title and have
@@ -551,7 +551,7 @@ int vm_jump_up(vm_t *vm) {
int vm_jump_menu(vm_t *vm, DVDMenuID_t menuid) {
domain_t old_domain = (vm->state).domain;
-
+
switch ((vm->state).domain) {
case VTS_DOMAIN:
set_RSMinfo(vm, 0, (vm->state).blockN);
@@ -581,7 +581,7 @@ int vm_jump_menu(vm_t *vm, DVDMenuID_t m
case FP_DOMAIN: /* FIXME XXX $$$ What should we do here? */
break;
}
-
+
return 0;
}
@@ -597,7 +597,7 @@ int vm_jump_resume(vm_t *vm) {
int vm_exec_cmd(vm_t *vm, vm_cmd_t *cmd) {
link_t link_values;
-
+
if(vmEval_CMD(cmd, 1, &(vm->state).registers, &link_values))
return process_command(vm, link_values);
else
@@ -647,7 +647,7 @@ int vm_get_current_title_part(vm_t *vm,
}
vts_ttn++;
part++;
-
+
if (!found) {
fprintf(MSG_OUT, "libdvdnav: chapter NOT FOUND!\n");
return 0;
@@ -677,17 +677,17 @@ int vm_get_audio_stream(vm_t *vm, int au
if((vm->state).domain != VTS_DOMAIN)
audioN = 0;
-
+
if(audioN < 8) {
- /* Is there any control info for this logical stream */
+ /* Is there any control info for this logical stream */
if((vm->state).pgc->audio_control[audioN] & (1<<15)) {
- streamN = ((vm->state).pgc->audio_control[audioN] >> 8) & 0x07;
+ streamN = ((vm->state).pgc->audio_control[audioN] >> 8) & 0x07;
}
}
-
+
if((vm->state).domain != VTS_DOMAIN && streamN == -1)
streamN = 0;
-
+
/* FIXME: Should also check in vtsi/vmgi status what kind of stream
* it is (ac3/lpcm/dts/sdds...) to find the right (sub)stream id */
return streamN;
@@ -702,15 +702,15 @@ int vm_get_audio_stream(vm_t *vm, int au
int vm_get_subp_stream(vm_t *vm, int subpN, int mode) {
int streamN = -1;
int source_aspect = vm_get_video_aspect(vm);
-
+
if((vm->state).domain != VTS_DOMAIN)
subpN = 0;
-
+
if(subpN < 32) { /* a valid logical stream */
- /* Is this logical stream present */
+ /* Is this logical stream present */
if((vm->state).pgc->subp_control[subpN] & (1<<31)) {
- if(source_aspect == 0) /* 4:3 */
- streamN = ((vm->state).pgc->subp_control[subpN] >> 24) & 0x1f;
+ if(source_aspect == 0) /* 4:3 */
+ streamN = ((vm->state).pgc->subp_control[subpN] >> 24) & 0x1f;
if(source_aspect == 3) /* 16:9 */
switch (mode) {
case 0:
@@ -724,7 +724,7 @@ int vm_get_subp_stream(vm_t *vm, int sub
}
}
}
-
+
if((vm->state).domain != VTS_DOMAIN && streamN == -1)
streamN = 0;
@@ -737,7 +737,7 @@ int vm_get_audio_active_stream(vm_t *vm)
int streamN;
audioN = (vm->state).AST_REG ;
streamN = vm_get_audio_stream(vm, audioN);
-
+
/* If no such stream, then select the first one that exists. */
if(streamN == -1) {
for(audioN = 0; audioN < 8; audioN++) {
@@ -756,7 +756,7 @@ int vm_get_subp_active_stream(vm_t *vm,
int streamN;
subpN = (vm->state).SPST_REG & ~0x40;
streamN = vm_get_subp_stream(vm, subpN, mode);
-
+
/* If no such stream, then select the first one that exists. */
if(streamN == -1) {
for(subpN = 0; subpN < 32; subpN++) {
@@ -777,16 +777,16 @@ int vm_get_subp_active_stream(vm_t *vm,
void vm_get_angle_info(vm_t *vm, int *current, int *num_avail) {
*num_avail = 1;
*current = 1;
-
+
if((vm->state).domain == VTS_DOMAIN) {
title_info_t *title;
/* TTN_REG does not allways point to the correct title.. */
if((vm->state).TTN_REG > vm->vmgi->tt_srpt->nr_of_srpts)
return;
title = &vm->vmgi->tt_srpt->title[(vm->state).TTN_REG - 1];
- if(title->title_set_nr != (vm->state).vtsN ||
+ if(title->title_set_nr != (vm->state).vtsN ||
title->vts_ttn != (vm->state).VTS_TTN_REG)
- return;
+ return;
*num_avail = title->nr_of_angles;
*current = (vm->state).AGL_REG;
}
@@ -834,8 +834,8 @@ void vm_get_subp_info(vm_t *vm, int *cur
/* currently unused */
void vm_get_video_res(vm_t *vm, int *width, int *height) {
video_attr_t attr = vm_get_video_attr(vm);
-
- if(attr.video_format != 0)
+
+ if(attr.video_format != 0)
*height = 576;
else
*height = 480;
@@ -859,11 +859,11 @@ void vm_get_video_res(vm_t *vm, int *wid
int vm_get_video_aspect(vm_t *vm) {
int aspect = vm_get_video_attr(vm).display_aspect_ratio;
-
+
assert(aspect == 0 || aspect == 3);
(vm->state).registers.SPRM[14] &= ~(0x3 << 10);
(vm->state).registers.SPRM[14] |= aspect << 10;
-
+
return aspect;
}
@@ -918,7 +918,7 @@ subp_attr_t vm_get_subp_attr(vm_t *vm, i
static link_t play_PGC(vm_t *vm) {
link_t link_values;
-
+
#ifdef TRACE
fprintf(MSG_OUT, "libdvdnav: play_PGC:");
if((vm->state).domain != FP_DOMAIN) {
@@ -936,14 +936,14 @@ static link_t play_PGC(vm_t *vm) {
(vm->state).cellN = 0;
(vm->state).blockN = 0;
- /* eval -> updates the state and returns either
+ /* eval -> updates the state and returns either
- some kind of jump (Jump(TT/SS/VTS_TTN/CallSS/link C/PG/PGC/PTTN)
- just play video i.e first PG
(This is what happens if you fall of the end of the pre_cmds)
- or an error (are there more cases?) */
if((vm->state).pgc->command_tbl && (vm->state).pgc->command_tbl->nr_of_pre) {
- if(vmEval_CMD((vm->state).pgc->command_tbl->pre_cmds,
- (vm->state).pgc->command_tbl->nr_of_pre,
+ if(vmEval_CMD((vm->state).pgc->command_tbl->pre_cmds,
+ (vm->state).pgc->command_tbl->nr_of_pre,
&(vm->state).registers, &link_values)) {
/* link_values contains the 'jump' return value */
return link_values;
@@ -954,11 +954,11 @@ static link_t play_PGC(vm_t *vm) {
}
}
return play_PG(vm);
-}
+}
-static link_t play_PGC_PG(vm_t *vm, int pgN) {
+static link_t play_PGC_PG(vm_t *vm, int pgN) {
link_t link_values;
-
+
#ifdef TRACE
fprintf(MSG_OUT, "libdvdnav: play_PGC_PG:");
if((vm->state).domain != FP_DOMAIN) {
@@ -976,14 +976,14 @@ static link_t play_PGC_PG(vm_t *vm, int
(vm->state).cellN = 0;
(vm->state).blockN = 0;
- /* eval -> updates the state and returns either
+ /* eval -> updates the state and returns either
- some kind of jump (Jump(TT/SS/VTS_TTN/CallSS/link C/PG/PGC/PTTN)
- just play video i.e first PG
(This is what happens if you fall of the end of the pre_cmds)
- or an error (are there more cases?) */
if((vm->state).pgc->command_tbl && (vm->state).pgc->command_tbl->nr_of_pre) {
- if(vmEval_CMD((vm->state).pgc->command_tbl->pre_cmds,
- (vm->state).pgc->command_tbl->nr_of_pre,
+ if(vmEval_CMD((vm->state).pgc->command_tbl->pre_cmds,
+ (vm->state).pgc->command_tbl->nr_of_pre,
&(vm->state).registers, &link_values)) {
/* link_values contains the 'jump' return value */
return link_values;
@@ -994,7 +994,7 @@ static link_t play_PGC_PG(vm_t *vm, int
}
}
return play_PG(vm);
-}
+}
static link_t play_PGC_post(vm_t *vm) {
link_t link_values;
@@ -1002,19 +1002,19 @@ static link_t play_PGC_post(vm_t *vm) {
#ifdef TRACE
fprintf(MSG_OUT, "libdvdnav: play_PGC_post:\n");
#endif
-
- /* eval -> updates the state and returns either
+
+ /* eval -> updates the state and returns either
- some kind of jump (Jump(TT/SS/VTS_TTN/CallSS/link C/PG/PGC/PTTN)
- just go to next PGC
(This is what happens if you fall of the end of the post_cmds)
- or an error (are there more cases?) */
if((vm->state).pgc->command_tbl && (vm->state).pgc->command_tbl->nr_of_post &&
vmEval_CMD((vm->state).pgc->command_tbl->post_cmds,
- (vm->state).pgc->command_tbl->nr_of_post,
+ (vm->state).pgc->command_tbl->nr_of_post,
&(vm->state).registers, &link_values)) {
return link_values;
}
-
+
#ifdef TRACE
fprintf(MSG_OUT, "libdvdnav: ** Fell of the end of the pgc, continuing in NextPGC\n");
#endif
@@ -1030,19 +1030,19 @@ static link_t play_PG(vm_t *vm) {
#ifdef TRACE
fprintf(MSG_OUT, "libdvdnav: play_PG: (vm->state).pgN (%i)\n", (vm->state).pgN);
#endif
-
+
assert((vm->state).pgN > 0);
if((vm->state).pgN > (vm->state).pgc->nr_of_programs) {
#ifdef TRACE
- fprintf(MSG_OUT, "libdvdnav: play_PG: (vm->state).pgN (%i) > pgc->nr_of_programs (%i)\n",
+ fprintf(MSG_OUT, "libdvdnav: play_PG: (vm->state).pgN (%i) > pgc->nr_of_programs (%i)\n",
(vm->state).pgN, (vm->state).pgc->nr_of_programs );
#endif
- assert((vm->state).pgN == (vm->state).pgc->nr_of_programs + 1);
+ assert((vm->state).pgN == (vm->state).pgc->nr_of_programs + 1);
return play_PGC_post(vm);
}
-
+
(vm->state).cellN = (vm->state).pgc->program_map[(vm->state).pgN - 1];
-
+
return play_Cell(vm);
}
@@ -1052,17 +1052,17 @@ static link_t play_Cell(vm_t *vm) {
#ifdef TRACE
fprintf(MSG_OUT, "libdvdnav: play_Cell: (vm->state).cellN (%i)\n", (vm->state).cellN);
#endif
-
+
assert((vm->state).cellN > 0);
if((vm->state).cellN > (vm->state).pgc->nr_of_cells) {
#ifdef TRACE
- fprintf(MSG_OUT, "libdvdnav: (vm->state).cellN (%i) > pgc->nr_of_cells (%i)\n",
+ fprintf(MSG_OUT, "libdvdnav: (vm->state).cellN (%i) > pgc->nr_of_cells (%i)\n",
(vm->state).cellN, (vm->state).pgc->nr_of_cells );
#endif
- assert((vm->state).cellN == (vm->state).pgc->nr_of_cells + 1);
+ assert((vm->state).cellN == (vm->state).pgc->nr_of_cells + 1);
return play_PGC_post(vm);
}
-
+
/* Multi angle/Interleaved */
switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode) {
case 0: /* Normal */
@@ -1104,7 +1104,7 @@ static link_t play_Cell(vm_t *vm) {
default:
fprintf(MSG_OUT, "libdvdnav: Cell is in block but did not enter at first cell!\n");
}
-
+
/* Updates (vm->state).pgN and PTTN_REG */
if(!set_PGN(vm)) {
/* Should not happen */
@@ -1121,19 +1121,19 @@ static link_t play_Cell(vm_t *vm) {
static link_t play_Cell_post(vm_t *vm) {
cell_playback_t *cell;
-
+
#ifdef TRACE
fprintf(MSG_OUT, "libdvdnav: play_Cell_post: (vm->state).cellN (%i)\n", (vm->state).cellN);
#endif
-
+
cell = &(vm->state).pgc->cell_playback[(vm->state).cellN - 1];
-
+
/* Still time is already taken care of before we get called. */
-
+
/* Deal with a Cell command, if any */
if(cell->cell_cmd_nr != 0) {
link_t link_values;
-
+
/* These asserts are now not needed.
* Some DVDs have no cell commands listed in the PGC,
* but the Cell itself points to a cell command that does not exist.
@@ -1162,7 +1162,7 @@ static link_t play_Cell_post(vm_t *vm) {
#endif
}
}
-
+
/* Where to continue after playing the cell... */
/* Multi angle/Interleaved */
switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode) {
@@ -1196,8 +1196,8 @@ static link_t play_Cell_post(vm_t *vm) {
}
break;
}
-
- /* Figure out the correct pgN for the new cell */
+
+ /* Figure out the correct pgN for the new cell */
if(!set_PGN(vm)) {
#ifdef TRACE
fprintf(MSG_OUT, "libdvdnav: last cell in this PGC\n");
@@ -1211,18 +1211,18 @@ static link_t play_Cell_post(vm_t *vm) {
/* link processing */
static int process_command(vm_t *vm, link_t link_values) {
-
+
while(link_values.command != PlayThis) {
-
+
#ifdef TRACE
fprintf(MSG_OUT, "libdvdnav: Before printout starts:\n");
vm_print_link(link_values);
- fprintf(MSG_OUT, "libdvdnav: Link values %i %i %i %i\n", link_values.command,
+ fprintf(MSG_OUT, "libdvdnav: Link values %i %i %i %i\n", link_values.command,
link_values.data1, link_values.data2, link_values.data3);
vm_print_current_domain_state(vm);
fprintf(MSG_OUT, "libdvdnav: Before printout ends.\n");
#endif
-
+
switch(link_values.command) {
case LinkNoLink:
/* BUTTON number:data1 */
@@ -1254,7 +1254,7 @@ static int process_command(vm_t *vm, lin
(vm->state).cellN -= 1;
link_values = play_Cell(vm);
break;
-
+
case LinkTopPG:
/* Link to Top of current Program */
/* BUTTON number:data1 */
@@ -1332,34 +1332,34 @@ static int process_command(vm_t *vm, lin
{
/* Link to Resume point */
int i;
-
+
/* Check and see if there is any rsm info!! */
if (!(vm->state).rsm_vtsN) {
fprintf(MSG_OUT, "libdvdnav: trying to resume without any resume info set\n");
link_values.command = Exit;
break;
}
-
+
(vm->state).domain = VTS_DOMAIN;
if (!ifoOpenNewVTSI(vm, vm->dvd, (vm->state).rsm_vtsN))
assert(0);
set_PGCN(vm, (vm->state).rsm_pgcN);
-
- /* These should never be set in SystemSpace and/or MenuSpace */
+
+ /* These should never be set in SystemSpace and/or MenuSpace */
/* (vm->state).TTN_REG = rsm_tt; ?? */
/* (vm->state).TT_PGCN_REG = (vm->state).rsm_pgcN; ?? */
for(i = 0; i < 5; i++) {
(vm->state).registers.SPRM[4 + i] = (vm->state).rsm_regs[i];
}
-
+
if(link_values.data1 != 0)
(vm->state).HL_BTNN_REG = link_values.data1 << 10;
-
+
if((vm->state).rsm_cellN == 0) {
assert((vm->state).cellN); /* Checking if this ever happens */
(vm->state).pgN = 1;
link_values = play_PG(vm);
- } else {
+ } else {
/* (vm->state).pgN = ?? this gets the right value in set_PGN() below */
(vm->state).cellN = (vm->state).rsm_cellN;
link_values.command = PlayThis;
@@ -1409,11 +1409,11 @@ static int process_command(vm_t *vm, lin
(vm->state).cellN = link_values.data1;
link_values = play_Cell(vm);
break;
-
+
case Exit:
vm->stopped = 1;
return 0;
-
+
case JumpTT:
/* Jump to VTS Title Domain */
/* Only allowed from the First Play domain(PGC) */
@@ -1448,7 +1448,7 @@ static int process_command(vm_t *vm, lin
assert(0);
link_values = play_PGC_PG(vm, (vm->state).pgN);
break;
-
+
case JumpSS_FP:
/* Jump to First Play Domain */
/* Only allowed from the VTS Menu Domain(VTSM) */
@@ -1475,7 +1475,7 @@ static int process_command(vm_t *vm, lin
/* Stop SPRM9 Timer and any GPRM counters */
/* ifoOpenNewVTSI:data1 */
/* VTS_TTN_REG:data2 */
- /* get_MENU:data3 */
+ /* get_MENU:data3 */
if(link_values.data1 != 0) {
if (link_values.data1 != (vm->state).vtsN) {
/* the normal case */
@@ -1514,7 +1514,7 @@ static int process_command(vm_t *vm, lin
assert(0);
link_values = play_PGC(vm);
break;
-
+
case CallSS_FP:
/* set_RSMinfo:data1 */
assert((vm->state).domain == VTS_DOMAIN); /* ?? */
@@ -1524,18 +1524,18 @@ static int process_command(vm_t *vm, lin
link_values = play_PGC(vm);
break;
case CallSS_VMGM_MENU:
- /* set_MENU:data1 */
+ /* set_MENU:data1 */
/* set_RSMinfo:data2 */
assert((vm->state).domain == VTS_DOMAIN); /* ?? */
/* Must be called before domain is changed */
- set_RSMinfo(vm, link_values.data2, /* We dont have block info */ 0);
+ set_RSMinfo(vm, link_values.data2, /* We dont have block info */ 0);
(vm->state).domain = VMGM_DOMAIN;
if(!set_MENU(vm, link_values.data1))
assert(0);
link_values = play_PGC(vm);
break;
case CallSS_VTSM:
- /* set_MENU:data1 */
+ /* set_MENU:data1 */
/* set_RSMinfo:data2 */
assert((vm->state).domain == VTS_DOMAIN); /* ?? */
/* Must be called before domain is changed */
@@ -1567,7 +1567,7 @@ static int process_command(vm_t *vm, lin
vm_print_current_domain_state(vm);
fprintf(MSG_OUT, "libdvdnav: After printout ends.\n");
#endif
-
+
}
(vm->state).blockN = link_values.data1 | (link_values.data2 << 16);
return 1;
@@ -1576,7 +1576,7 @@ static int process_command(vm_t *vm, lin
/* Set functions */
-static int set_TT(vm_t *vm, int tt) {
+static int set_TT(vm_t *vm, int tt) {
return set_PTT(vm, tt, 1);
}
@@ -1592,21 +1592,21 @@ static int set_VTS_TT(vm_t *vm, int vtsN
static int set_VTS_PTT(vm_t *vm, int vtsN, int vts_ttn, int part) {
int pgcN, pgN, res;
-
+
(vm->state).domain = VTS_DOMAIN;
if (vtsN != (vm->state).vtsN)
if (!ifoOpenNewVTSI(vm, vm->dvd, vtsN)) /* Also sets (vm->state).vtsN */
return 0;
-
+
if ((vts_ttn < 1) || (vts_ttn > vm->vtsi->vts_ptt_srpt->nr_of_srpts) ||
(part < 1) || (part > vm->vtsi->vts_ptt_srpt->title[vts_ttn - 1].nr_of_ptts) ) {
return 0;
}
-
+
pgcN = vm->vtsi->vts_ptt_srpt->title[vts_ttn - 1].ptt[part - 1].pgcn;
pgN = vm->vtsi->vts_ptt_srpt->title[vts_ttn - 1].ptt[part - 1].pgn;
-
+
(vm->state).TT_PGCN_REG = pgcN;
(vm->state).PTTN_REG = part;
(vm->state).TTN_REG = get_TT(vm, vtsN, vts_ttn);
@@ -1614,13 +1614,13 @@ static int set_VTS_PTT(vm_t *vm, int vts
(vm->state).VTS_TTN_REG = vts_ttn;
(vm->state).vtsN = vtsN; /* Not sure about this one. We can get to it easily from TTN_REG */
/* Any other registers? */
-
+
res = set_PGCN(vm, pgcN); /* This clobber's state.pgN (sets it to 1), but we don't want clobbering here. */
(vm->state).pgN = pgN;
return res;
}
-static int set_FP_PGC(vm_t *vm) {
+static int set_FP_PGC(vm_t *vm) {
(vm->state).domain = FP_DOMAIN;
if (!vm->vmgi->first_play_pgc) {
return set_PGCN(vm, 1);
@@ -1638,7 +1638,7 @@ static int set_MENU(vm_t *vm, int menu)
static int set_PGCN(vm_t *vm, int pgcN) {
pgcit_t *pgcit;
-
+
pgcit = get_PGCIT(vm);
assert(pgcit != NULL); /* ?? Make this return -1 instead */
@@ -1648,31 +1648,31 @@ static int set_PGCN(vm_t *vm, int pgcN)
#endif
return 0;
}
-
+
(vm->state).pgc = pgcit->pgci_srp[pgcN - 1].pgc;
(vm->state).pgcN = pgcN;
(vm->state).pgN = 1;
-
+
if((vm->state).domain == VTS_DOMAIN)
(vm->state).TT_PGCN_REG = pgcN;
return 1;
}
-/* Figure out the correct pgN from the cell and update (vm->state). */
+/* Figure out the correct pgN from the cell and update (vm->state). */
static int set_PGN(vm_t *vm) {
int new_pgN = 0;
-
- while(new_pgN < (vm->state).pgc->nr_of_programs
+
+ while(new_pgN < (vm->state).pgc->nr_of_programs
&& (vm->state).cellN >= (vm->state).pgc->program_map[new_pgN])
new_pgN++;
-
+
if(new_pgN == (vm->state).pgc->nr_of_programs) /* We are at the last program */
if((vm->state).cellN > (vm->state).pgc->nr_of_cells)
return 0; /* We are past the last cell */
-
+
(vm->state).pgN = new_pgN;
-
+
if((vm->state).domain == VTS_DOMAIN) {
playback_type_t *pb_ty;
if((vm->state).TTN_REG > vm->vmgi->tt_srpt->nr_of_srpts)
@@ -1693,7 +1693,7 @@ static int set_PGN(vm_t *vm) {
/* Must be called before domain is changed (set_PGCN()) */
static void set_RSMinfo(vm_t *vm, int cellN, int blockN) {
int i;
-
+
if(cellN) {
(vm->state).rsm_cellN = cellN;
(vm->state).rsm_blockN = blockN;
@@ -1703,9 +1703,9 @@ static void set_RSMinfo(vm_t *vm, int ce
}
(vm->state).rsm_vtsN = (vm->state).vtsN;
(vm->state).rsm_pgcN = get_PGCN(vm);
-
+
/* assert((vm->state).rsm_pgcN == (vm->state).TT_PGCN_REG); for VTS_DOMAIN */
-
+
for(i = 0; i < 5; i++) {
(vm->state).rsm_regs[i] = (vm->state).registers.SPRM[4 + i];
}
@@ -1723,7 +1723,7 @@ static int get_TT(vm_t *vm, int vtsN, in
int tt=0;
for(i = 1; i <= vm->vmgi->tt_srpt->nr_of_srpts; i++) {
- if( vm->vmgi->tt_srpt->title[i - 1].title_set_nr == vtsN &&
+ if( vm->vmgi->tt_srpt->title[i - 1].title_set_nr == vtsN &&
vm->vmgi->tt_srpt->title[i - 1].vts_ttn == vts_ttn) {
tt=i;
break;
@@ -1738,7 +1738,7 @@ static int get_TT(vm_t *vm, int vtsN, in
static int get_ID(vm_t *vm, int id) {
int pgcN, i;
pgcit_t *pgcit;
-
+
/* Relies on state to get the correct pgcit. */
pgcit = get_PGCIT(vm);
assert(pgcit != NULL);
@@ -1777,7 +1777,7 @@ static int get_PGCN(vm_t *vm) {
int pgcN = 1;
pgcit = get_PGCIT(vm);
-
+
if (pgcit) {
while(pgcN <= pgcit->nr_of_pgci_srp) {
if(pgcit->pgci_srp[pgcN - 1].pgc == (vm->state).pgc) {
@@ -1787,19 +1787,19 @@ static int get_PGCN(vm_t *vm) {
pgcN++;
}
}
- fprintf(MSG_OUT, "libdvdnav: get_PGCN failed. Was trying to find pgcN in domain %d\n",
+ fprintf(MSG_OUT, "libdvdnav: get_PGCN failed. Was trying to find pgcN in domain %d\n",
(vm->state).domain);
return 0; /* error */
}
static pgcit_t* get_MENU_PGCIT(vm_t *vm, ifo_handle_t *h, uint16_t lang) {
int i;
-
+
if(h == NULL || h->pgci_ut == NULL) {
fprintf(MSG_OUT, "libdvdnav: *** pgci_ut handle is NULL ***\n");
return NULL; /* error? */
}
-
+
i = 0;
while(i < h->pgci_ut->nr_of_lus
&& h->pgci_ut->lu[i].lang_code != lang)
@@ -1818,14 +1818,14 @@ static pgcit_t* get_MENU_PGCIT(vm_t *vm,
fprintf(MSG_OUT, "\n");
i = 0; /* error? */
}
-
+
return h->pgci_ut->lu[i].pgcit;
}
/* Uses state to decide what to return */
static pgcit_t* get_PGCIT(vm_t *vm) {
pgcit_t *pgcit = NULL;
-
+
switch ((vm->state).domain) {
case VTS_DOMAIN:
if(!vm->vtsi) return NULL;
@@ -1842,11 +1842,11 @@ static pgcit_t* get_PGCIT(vm_t *vm) {
default:
abort();
}
-
+
return pgcit;
}
-//return the ifo_handle_t describing required title, used to
+//return the ifo_handle_t describing required title, used to
//identify chapters
ifo_handle_t *vm_get_title_ifo(vm_t *vm, uint32_t title)
{
Modified: trunk/libdvdnav/src/vm/vm.h
==============================================================================
--- trunk/libdvdnav/src/vm/vm.h (original)
+++ trunk/libdvdnav/src/vm/vm.h Sat Sep 6 23:55:51 2008
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2000, 2001 Håkan Hjort
* Copyright (C) 2001 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library. It is modified
* from a file originally part of the Ogle DVD player.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -33,14 +33,14 @@ typedef enum {
VTS_DOMAIN = 2,
VMGM_DOMAIN = 4,
VTSM_DOMAIN = 8
-} domain_t;
+} domain_t;
/**
* State: SPRM, GPRM, Domain, pgc, pgN, cellN, ?
*/
typedef struct {
registers_t registers;
-
+
domain_t domain;
int vtsN; /* 0 is vmgm? */
pgc_t *pgc; /* either this or 'int pgcN' is enough? */
@@ -49,7 +49,7 @@ typedef struct {
int cellN;
int32_t cell_restart; /* get cell to restart */
int blockN;
-
+
/* Resume info */
int rsm_vtsN;
int rsm_blockN; /* of nav_packet */
Modified: trunk/libdvdnav/src/vm/vmcmd.c
==============================================================================
--- trunk/libdvdnav/src/vm/vmcmd.c (original)
+++ trunk/libdvdnav/src/vm/vmcmd.c Sat Sep 6 23:55:51 2008
@@ -1,20 +1,20 @@
/*
* Copyright (C) 2000, 2001 Martin Norbäck, Håkan Hjort
* 2002-2004 the dvdnav project
- *
+ *
* This file is part of libdvdnav, a DVD navigation library. It is modified
* from a file originally part of the Ogle DVD player.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -160,7 +160,7 @@ static void print_set_op(uint8_t op) {
static void print_reg_or_data(command_t* command, int immediate, int start) {
if(immediate) {
uint32_t i = vm_getbits(command, start, 16);
-
+
fprintf(MSG_OUT, "0x%x", i);
if(isprint(i & 0xff) && isprint((i>>8) & 0xff))
fprintf(MSG_OUT, " (\"%c%c\")", (char)((i>>8) & 0xff), (char)(i & 0xff));
@@ -179,7 +179,7 @@ static void print_reg_or_data_2(command_
static void print_reg_or_data_3(command_t* command, int immediate, int start) {
if(immediate) {
uint32_t i = vm_getbits(command, start, 16);
-
+
fprintf(MSG_OUT, "0x%x", i);
if(isprint(i & 0xff) && isprint((i>>8) & 0xff))
fprintf(MSG_OUT, " (\"%c%c\")", (char)((i>>8) & 0xff), (char)(i & 0xff));
@@ -191,7 +191,7 @@ static void print_reg_or_data_3(command_
static void print_if_version_1(command_t* command) {
uint8_t op = vm_getbits(command, 54, 3);
-
+
if(op) {
fprintf(MSG_OUT, "if (");
print_g_reg(vm_getbits(command,39,8));
@@ -203,7 +203,7 @@ static void print_if_version_1(command_t
static void print_if_version_2(command_t* command) {
uint8_t op = vm_getbits(command, 54, 3);
-
+
if(op) {
fprintf(MSG_OUT, "if (");
print_reg(vm_getbits(command, 15, 8));
@@ -215,7 +215,7 @@ static void print_if_version_2(command_t
static void print_if_version_3(command_t* command) {
uint8_t op = vm_getbits(command, 54, 3);
-
+
if(op) {
fprintf(MSG_OUT, "if (");
print_g_reg(vm_getbits(command, 43, 4));
@@ -240,7 +240,7 @@ static void print_if_version_4(command_t
static void print_if_version_5(command_t* command) {
uint8_t op = vm_getbits(command, 54, 3);
int set_immediate = vm_getbits(command, 60, 1);
-
+
if(op) {
if (set_immediate) {
fprintf(MSG_OUT, "if (");
@@ -260,7 +260,7 @@ static void print_if_version_5(command_t
static void print_special_instruction(command_t* command) {
uint8_t op = vm_getbits(command, 51, 4);
-
+
switch(op) {
case 0: /* NOP */
fprintf(MSG_OUT, "Nop");
@@ -272,11 +272,11 @@ static void print_special_instruction(co
fprintf(MSG_OUT, "Break");
break;
case 3: /* Parental level */
- fprintf(MSG_OUT, "SetTmpPML %" PRIu8 ", Goto %" PRIu8,
+ fprintf(MSG_OUT, "SetTmpPML %" PRIu8 ", Goto %" PRIu8,
vm_getbits(command, 11, 4), vm_getbits(command, 7, 8));
break;
default:
- fprintf(MSG_OUT, "WARNING: Unknown special instruction (%i)",
+ fprintf(MSG_OUT, "WARNING: Unknown special instruction (%i)",
vm_getbits(command, 51, 4));
}
}
@@ -284,7 +284,7 @@ static void print_special_instruction(co
static void print_linksub_instruction(command_t* command) {
uint32_t linkop = vm_getbits(command, 7, 8);
uint32_t button = vm_getbits(command, 15, 6);
-
+
if(linkop < sizeof(link_table)/sizeof(link_table[0]))
fprintf(MSG_OUT, "%s (button %" PRIu8 ")", link_table[linkop], button);
else
@@ -293,10 +293,10 @@ static void print_linksub_instruction(co
static void print_link_instruction(command_t* command, int optional) {
uint8_t op = vm_getbits(command, 51, 4);
-
+
if(optional && op)
fprintf(MSG_OUT, ", ");
-
+
switch(op) {
case 0:
if(!optional)
@@ -309,15 +309,15 @@ static void print_link_instruction(comma
fprintf(MSG_OUT, "LinkPGCN %" PRIu16, vm_getbits(command, 14, 15));
break;
case 5:
- fprintf(MSG_OUT, "LinkPTT %" PRIu16 " (button %" PRIu8 ")",
+ fprintf(MSG_OUT, "LinkPTT %" PRIu16 " (button %" PRIu8 ")",
vm_getbits(command, 9, 10), vm_getbits(command, 15, 6));
break;
case 6:
- fprintf(MSG_OUT, "LinkPGN %" PRIu8 " (button %" PRIu8 ")",
+ fprintf(MSG_OUT, "LinkPGN %" PRIu8 " (button %" PRIu8 ")",
vm_getbits(command, 6, 7), vm_getbits(command, 15, 6));
break;
case 7:
- fprintf(MSG_OUT, "LinkCN %" PRIu8 " (button %" PRIu8 ")",
+ fprintf(MSG_OUT, "LinkCN %" PRIu8 " (button %" PRIu8 ")",
vm_getbits(command, 7, 8), vm_getbits(command, 15, 6));
break;
default:
@@ -337,7 +337,7 @@ static void print_jump_instruction(comma
fprintf(MSG_OUT, "JumpVTS_TT %" PRIu8, vm_getbits(command, 22, 7));
break;
case 5:
- fprintf(MSG_OUT, "JumpVTS_PTT %" PRIu8 ":%" PRIu16,
+ fprintf(MSG_OUT, "JumpVTS_PTT %" PRIu8 ":%" PRIu16,
vm_getbits(command, 22, 7), vm_getbits(command, 41, 10));
break;
case 6:
@@ -349,7 +349,7 @@ static void print_jump_instruction(comma
fprintf(MSG_OUT, "JumpSS VMGM (menu %" PRIu8 ")", vm_getbits(command, 19, 4));
break;
case 2:
- fprintf(MSG_OUT, "JumpSS VTSM (vts %" PRIu8 ", title %" PRIu8
+ fprintf(MSG_OUT, "JumpSS VTSM (vts %" PRIu8 ", title %" PRIu8
", menu %" PRIu8 ")", vm_getbits(command, 30, 7), vm_getbits(command, 38, 7), vm_getbits(command, 19, 4));
break;
case 3:
@@ -364,15 +364,15 @@ static void print_jump_instruction(comma
vm_getbits(command, 31, 8));
break;
case 1:
- fprintf(MSG_OUT, "CallSS VMGM (menu %" PRIu8
+ fprintf(MSG_OUT, "CallSS VMGM (menu %" PRIu8
", rsm_cell %" PRIu8 ")", vm_getbits(command, 19, 4), vm_getbits(command, 31, 8));
break;
case 2:
- fprintf(MSG_OUT, "CallSS VTSM (menu %" PRIu8
+ fprintf(MSG_OUT, "CallSS VTSM (menu %" PRIu8
", rsm_cell %" PRIu8 ")", vm_getbits(command, 19, 4), vm_getbits(command, 31, 8));
break;
case 3:
- fprintf(MSG_OUT, "CallSS VMGM (pgc %" PRIu8 ", rsm_cell %" PRIu8 ")",
+ fprintf(MSG_OUT, "CallSS VMGM (pgc %" PRIu8 ", rsm_cell %" PRIu8 ")",
vm_getbits(command, 46, 15), vm_getbits(command, 31, 8));
break;
}
@@ -386,7 +386,7 @@ static void print_system_set(command_t*
int i;
/* FIXME: What about SPRM11 ? Karaoke */
/* Surely there must be some system set command for that ? */
-
+
switch(vm_getbits(command, 59, 4)) {
case 1: /* Set system reg 1 &| 2 &| 3 (Audio, Subp. Angle) */
for(i = 1; i <= 3; i++) {
@@ -424,14 +424,14 @@ static void print_system_set(command_t*
fprintf(MSG_OUT, " = g[%" PRIu8 "]", vm_getbits(command, 19, 4));
break;
default:
- fprintf(MSG_OUT, "WARNING: Unknown system set instruction (%i)",
+ fprintf(MSG_OUT, "WARNING: Unknown system set instruction (%i)",
vm_getbits(command, 59, 4));
}
}
static void print_set_version_1(command_t* command) {
uint8_t set_op = vm_getbits(command, 59, 4);
-
+
if(set_op) {
print_g_reg(vm_getbits(command, 35, 4));
print_set_op(set_op);
@@ -443,7 +443,7 @@ static void print_set_version_1(command_
static void print_set_version_2(command_t* command) {
uint8_t set_op = vm_getbits(command, 59, 4);
-
+
if(set_op) {
print_g_reg(vm_getbits(command, 51, 4));
print_set_op(set_op);
@@ -455,7 +455,7 @@ static void print_set_version_2(command_
static void print_set_version_3(command_t* command) {
uint8_t set_op = vm_getbits(command, 59, 4);
-
+
if(set_op) {
print_g_reg(vm_getbits(command, 51, 4));
print_set_op(set_op);
@@ -476,7 +476,7 @@ void vm_print_mnemonic(vm_cmd_t *vm_comm
( (uint64_t) vm_command->bytes[5] << 16 ) |
( (uint64_t) vm_command->bytes[6] << 8 ) |
(uint64_t) vm_command->bytes[7] ;
- command.examined = 0;
+ command.examined = 0;
switch(vm_getbits(&command,63,3)) { /* three first bits */
case 0: /* Special instructions */
@@ -527,7 +527,7 @@ void vm_print_mnemonic(vm_cmd_t *vm_comm
fprintf(MSG_OUT, "WARNING: Unknown instruction type (%i)", vm_getbits(&command, 63, 3));
}
/* Check if there still are bits set that were not examined */
-
+
if(command.instruction & ~ command.examined) {
fprintf(MSG_OUT, " libdvdnav: vmcmd.c: [WARNING, unknown bits:");
fprintf(MSG_OUT, " %08"PRIx64, (command.instruction & ~ command.examined) );
Modified: trunk/libdvdnav/src/vm/vmcmd.h
==============================================================================
--- trunk/libdvdnav/src/vm/vmcmd.h (original)
+++ trunk/libdvdnav/src/vm/vmcmd.h Sat Sep 6 23:55:51 2008
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2000, 2001 Martin Norbäck, Håkan Hjort
- *
+ *
* This file is part of libdvdnav, a DVD navigation library. It is modified
* from a file originally part of the Ogle DVD player.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Modified: trunk/libdvdread/msvc/contrib/dirent/dirent.c
==============================================================================
--- trunk/libdvdread/msvc/contrib/dirent/dirent.c (original)
+++ trunk/libdvdread/msvc/contrib/dirent/dirent.c Sat Sep 6 23:55:51 2008
@@ -11,7 +11,7 @@
that this copyright and permissions notice appear in all copies and
derivatives, and that no charge may be made for the software and its
documentation except to cover cost of distribution.
-
+
This software is supplied "as is" without express or implied warranty.
But that said, if there are any problems please get in touch.
Modified: trunk/libdvdread/msvc/contrib/dirent/dirent.h
==============================================================================
--- trunk/libdvdread/msvc/contrib/dirent/dirent.h (original)
+++ trunk/libdvdread/msvc/contrib/dirent/dirent.h Sat Sep 6 23:55:51 2008
@@ -11,7 +11,7 @@
that this copyright and permissions notice appear in all copies and
derivatives, and that no charge may be made for the software and its
documentation except to cover cost of distribution.
-
+
*/
#ifndef DIRENT_INCLUDED
Modified: trunk/libdvdread/msvc/contrib/dlfcn.c
==============================================================================
--- trunk/libdvdread/msvc/contrib/dlfcn.c (original)
+++ trunk/libdvdread/msvc/contrib/dlfcn.c Sat Sep 6 23:55:51 2008
@@ -1,7 +1,7 @@
/*
* $Id$
* $Name$
- *
+ *
* Adopted from Apache DSO code.
* Portions copyright Apache Software Foundation
*
@@ -32,14 +32,14 @@ void *dlopen(const char *module_name, in
p = path;
while (p = strchr(p, '/'))
*p = '\\';
-
- /* First assume the dso/dll's required by -this- dso are sitting in the
+
+ /* First assume the dso/dll's required by -this- dso are sitting in the
* same path or can be found in the usual places. Failing that, let's
* let that dso look in the apache root.
*/
em = SetErrorMode(SEM_FAILCRITICALERRORS);
dsoh = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
- if (!dsoh)
+ if (!dsoh)
{
SetLastError(0); // clear the last error
dsoh = LoadLibraryEx(path, NULL, 0);
@@ -57,23 +57,23 @@ char *dlerror(void)
* mostly a potential problem for isapi modules, since LoadModule
* errors are handled within a single config thread.
*/
-
+
if((nErrorCode = GetLastError()) == 0)
return((char *)0);
SetLastError(0); // clear the last error
len = snprintf(errstr, sizeof(errstr), "(%d) ", nErrorCode);
- len += FormatMessage(
+ len += FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
nErrorCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
(LPTSTR) errstr + len,
sizeof(errstr) - len,
- NULL
+ NULL
);
- /* FormatMessage may have appended a newline (\r\n). So remove it
+ /* FormatMessage may have appended a newline (\r\n). So remove it
* and use ": " instead like the Unix errors. The error may also
* end with a . before the return - if so, trash it.
*/
Modified: trunk/libdvdread/msvc/contrib/getopt.c
==============================================================================
--- trunk/libdvdread/msvc/contrib/getopt.c (original)
+++ trunk/libdvdread/msvc/contrib/getopt.c Sat Sep 6 23:55:51 2008
@@ -23,7 +23,7 @@
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
+
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
#ifndef _NO_PROTO
@@ -200,7 +200,7 @@ ordering;
/* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct;
-
+
#ifdef __GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
@@ -243,7 +243,7 @@ extern int strlen(const char *);
#endif /* __GNUC__ */
#endif /* not __GNU_LIBRARY__ */
-
+
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
@@ -410,7 +410,7 @@ static const char *
return optstring;
}
-
+
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
@@ -935,7 +935,7 @@ int
}
#endif /* Not ELIDE_CODE. */
-
+
#ifdef TEST
/* Compile with -DTEST to make an executable for use in testing
Modified: trunk/libdvdread/msvc/contrib/timer/timer.c
==============================================================================
--- trunk/libdvdread/msvc/contrib/timer/timer.c (original)
+++ trunk/libdvdread/msvc/contrib/timer/timer.c Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000-2001 the xine project
- *
+ *
* This file is part of xine, a unix video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -46,7 +46,7 @@ int gettimeofday( struct timeval *tp, st
if( !startseconds )
startseconds = time( 0 );
- timeGetSystemTime( &mmtime, sizeof( mmtime ) );
+ timeGetSystemTime( &mmtime, sizeof( mmtime ) );
tp->tv_sec = ( mmtime.u.ms / 1000 ) + startseconds;
tp->tv_usec = ( mmtime.u.ms % 1000 ) * 1000;
@@ -56,7 +56,7 @@ int gettimeofday( struct timeval *tp, st
/*
These functions are designed to mimick
- a subset of itimer for use with the
+ a subset of itimer for use with the
alarm signal on win32. This is just
enough for xine to work.
*/
@@ -66,7 +66,7 @@ static HANDLE sigalarm = 0;
int setitimer( int which, struct itimerval * value, struct itimerval *ovalue )
{
long int miliseconds;
-
+
if( !sigalarm )
sigalarm = CreateEvent( 0, FALSE, TRUE, "SIGALARM" );
Modified: trunk/libdvdread/msvc/contrib/timer/timer.h
==============================================================================
--- trunk/libdvdread/msvc/contrib/timer/timer.h (original)
+++ trunk/libdvdread/msvc/contrib/timer/timer.h Sat Sep 6 23:55:51 2008
@@ -10,7 +10,7 @@
// time reference
// ----------------------------------
-//
+//
// 1,000 milliseconds / sec
// 1,000,000 microseconds / sec
// 1,000,000,000 nanoseconds / sec
Modified: trunk/libdvdread/msvc/include/dlfcn.h
==============================================================================
--- trunk/libdvdread/msvc/include/dlfcn.h (original)
+++ trunk/libdvdread/msvc/include/dlfcn.h Sat Sep 6 23:55:51 2008
@@ -3,7 +3,7 @@
/*
* $Id$
* $Name$
- *
+ *
*
*/
extern void *dlopen (const char *file, int mode);
Modified: trunk/libdvdread/msvc/include/dvdnav_internal.h
==============================================================================
--- trunk/libdvdread/msvc/include/dvdnav_internal.h (original)
+++ trunk/libdvdread/msvc/include/dvdnav_internal.h Sat Sep 6 23:55:51 2008
@@ -1,19 +1,19 @@
/* !! DO NO EDIT THIS FILE, it is automatically generated */
-/*
+/*
* Copyright (C) 2001 Rich Wareham <richwareham at users.sourceforge.net>
- *
+ *
* This file is part of libdvdnav, a DVD navigation library.
- *
+ *
* libdvdnav is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* libdvdnav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -71,7 +71,7 @@ typedef struct read_cache_s read_cache_t
/*
* These are defined here because they are
- * not in ifo_types.h, they maybe one day
+ * not in ifo_types.h, they maybe one day
*/
#ifndef audio_status_t
@@ -84,7 +84,7 @@ typedef struct {
#else
uint8_t zero2;
unsigned int stream_number : 3;
- unsigned int zero1 : 4;
+ unsigned int zero1 : 4;
unsigned int available : 1;
#endif
} ATTRIBUTE_PACKED audio_status_t;
@@ -121,8 +121,8 @@ typedef struct dvdnav_vobu_s {
int32_t vobu_length;
int32_t blockN; /* Relative offset */
int32_t vobu_next; /* Relative offset */
-} dvdnav_vobu_t;
-
+} dvdnav_vobu_t;
+
/** The main DVDNAV type **/
struct dvdnav_s {
@@ -131,26 +131,26 @@ struct dvdnav_s {
dvd_file_t *file; /* Currently opened file */
int open_vtsN; /* The domain and number of the... */
int open_domain; /* ..currently opened VOB */
-
+
/* Position data */
vm_position_t position_next;
vm_position_t position_current;
- dvdnav_vobu_t vobu;
+ dvdnav_vobu_t vobu;
/* NAV data */
pci_t pci;
dsi_t dsi;
uint32_t last_cmd_nav_lbn; /* detects when a command is issued on an already left NAV */
-
+
/* Flags */
int skip_still; /* Set when skipping a still */
int sync_wait; /* applications should wait till they are in sync with us */
int sync_wait_skip; /* Set when skipping wait state */
- int spu_clut_changed; /* The SPU CLUT changed */
+ int spu_clut_changed; /* The SPU CLUT changed */
int started; /* vm_start has been called? */
int use_read_ahead; /* 1 - use read-ahead cache, 0 - don't */
int pgc_based; /* positioning works PGC based instead of PG based */
-
+
/* VM */
vm_t *vm;
pthread_mutex_t vm_lock;
Modified: trunk/libdvdread/msvc/include/inttypes.h
==============================================================================
--- trunk/libdvdread/msvc/include/inttypes.h (original)
+++ trunk/libdvdread/msvc/include/inttypes.h Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000-2001 the xine project
- *
+ *
* This file is part of xine, a unix video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Modified: trunk/libdvdread/msvc/include/os_types.h
==============================================================================
--- trunk/libdvdread/msvc/include/os_types.h (original)
+++ trunk/libdvdread/msvc/include/os_types.h Sat Sep 6 23:55:51 2008
@@ -3,8 +3,8 @@
/*
* $Id$
* $Name$
- *
- * win32 types
+ *
+ * win32 types
* 04 Sept 2001 - Chris Wolf create.
*/
Modified: trunk/libdvdread/msvc/include/pthreads/pthread.h
==============================================================================
--- trunk/libdvdread/msvc/include/pthreads/pthread.h (original)
+++ trunk/libdvdread/msvc/include/pthreads/pthread.h Sat Sep 6 23:55:51 2008
@@ -1,5 +1,5 @@
/* This is the POSIX thread API (POSIX 1003).
- *
+ *
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright (C) 1998
*
@@ -131,7 +131,7 @@ struct timespec {
#define SIG_BLOCK 0
#endif /* SIG_BLOCK */
-#ifndef SIG_UNBLOCK
+#ifndef SIG_UNBLOCK
#define SIG_UNBLOCK 1
#endif /* SIG_UNBLOCK */
@@ -492,7 +492,7 @@ enum
* C++ and C built versions will not.
*/
-/*
+/*
* define defaults for cleanup code
*/
#if !defined( __CLEANUP_SEH ) && !defined( __CLEANUP_CXX ) && !defined( __CLEANUP_C )
@@ -875,7 +875,7 @@ int pthread_getschedparam (pthread_t thr
struct sched_param *param);
int pthread_setconcurrency (int);
-
+
int pthread_getconcurrency (void);
/*
Modified: trunk/libdvdread/msvc/include/pthreads/sched.h
==============================================================================
--- trunk/libdvdread/msvc/include/pthreads/sched.h (original)
+++ trunk/libdvdread/msvc/include/pthreads/sched.h Sat Sep 6 23:55:51 2008
@@ -3,7 +3,7 @@
*
* Purpose:
* Provides an implementation of POSIX realtime extensions
- * as defined in
+ * as defined in
*
* POSIX 1003.1b-1993 (POSIX.1b)
*
Modified: trunk/libdvdread/msvc/include/sys/time.h
==============================================================================
--- trunk/libdvdread/msvc/include/sys/time.h (original)
+++ trunk/libdvdread/msvc/include/sys/time.h Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000-2001 the xine project
- *
+ *
* This file is part of xine, a unix video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Modified: trunk/libdvdread/msvc/include/timer.h
==============================================================================
--- trunk/libdvdread/msvc/include/timer.h (original)
+++ trunk/libdvdread/msvc/include/timer.h Sat Sep 6 23:55:51 2008
@@ -10,7 +10,7 @@
// time reference
// ----------------------------------
-//
+//
// 1,000 milliseconds / sec
// 1,000,000 microseconds / sec
// 1,000,000,000 nanoseconds / sec
Modified: trunk/libdvdread/msvc/include/unistd.h
==============================================================================
--- trunk/libdvdread/msvc/include/unistd.h (original)
+++ trunk/libdvdread/msvc/include/unistd.h Sat Sep 6 23:55:51 2008
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000-2001 the xine project
- *
+ *
* This file is part of xine, a unix video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -21,7 +21,7 @@
* by Matthew Grooms <elon at altavista.com>
*
* unistd.h - This is mostly a catch all header that maps standard unix
- * libc calls to the equivelent win32 functions.
+ * libc calls to the equivelent win32 functions.
*
*/
Modified: trunk/libdvdread/src/bswap.h
==============================================================================
--- trunk/libdvdread/src/bswap.h (original)
+++ trunk/libdvdread/src/bswap.h Sat Sep 6 23:55:51 2008
@@ -23,12 +23,12 @@
#include <config.h>
#if defined(WORDS_BIGENDIAN)
-/* All bigendian systems are fine, just ignore the swaps. */
+/* All bigendian systems are fine, just ignore the swaps. */
#define B2N_16(x) (void)(x)
#define B2N_32(x) (void)(x)
#define B2N_64(x) (void)(x)
-#else
+#else
/* For __FreeBSD_version */
#if defined(HAVE_SYS_PARAM_H)
@@ -65,10 +65,10 @@
#define B2N_32(x) x = be32toh(x)
#define B2N_64(x) x = be64toh(x)
-/* This is a slow but portable implementation, it has multiple evaluation
+/* This is a slow but portable implementation, it has multiple evaluation
* problems so beware.
- * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such
- * functionality!
+ * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such
+ * functionality!
*/
#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__CYGWIN__) || defined(__BEOS__)
Modified: trunk/libdvdread/src/dvd_input.c
==============================================================================
--- trunk/libdvdread/src/dvd_input.c (original)
+++ trunk/libdvdread/src/dvd_input.c Sat Sep 6 23:55:51 2008
@@ -6,7 +6,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -32,7 +32,7 @@
dvd_input_t (*dvdinput_open) (const char *);
int (*dvdinput_close) (dvd_input_t);
int (*dvdinput_seek) (dvd_input_t, int);
-int (*dvdinput_title) (dvd_input_t, int);
+int (*dvdinput_title) (dvd_input_t, int);
int (*dvdinput_read) (dvd_input_t, void *, int, int);
char * (*dvdinput_error) (dvd_input_t);
@@ -59,7 +59,7 @@ typedef struct dvdcss_s *dvdcss_handle;
static dvdcss_handle (*DVDcss_open) (const char *);
static int (*DVDcss_close) (dvdcss_handle);
static int (*DVDcss_seek) (dvdcss_handle, int, int);
-static int (*DVDcss_title) (dvdcss_handle, int);
+static int (*DVDcss_title) (dvdcss_handle, int);
static int (*DVDcss_read) (dvdcss_handle, void *, int, int);
static char * (*DVDcss_error) (dvdcss_handle);
#endif
@@ -68,7 +68,7 @@ static char * (*DVDcss_error) (dv
struct dvd_input_s {
/* libdvdcss handle */
dvdcss_handle dvdcss;
-
+
/* dummy file input */
int fd;
};
@@ -80,14 +80,14 @@ struct dvd_input_s {
static dvd_input_t css_open(const char *target)
{
dvd_input_t dev;
-
+
/* Allocate the handle structure */
dev = (dvd_input_t) malloc(sizeof(*dev));
if(dev == NULL) {
fprintf(stderr, "libdvdread: Could not allocate memory.\n");
return NULL;
}
-
+
/* Really open it with libdvdcss */
dev->dvdcss = DVDcss_open(target);
if(dev->dvdcss == 0) {
@@ -95,7 +95,7 @@ static dvd_input_t css_open(const char *
free(dev);
return NULL;
}
-
+
return dev;
}
@@ -155,14 +155,14 @@ static int css_close(dvd_input_t dev)
static dvd_input_t file_open(const char *target)
{
dvd_input_t dev;
-
+
/* Allocate the library structure */
dev = (dvd_input_t) malloc(sizeof(*dev));
if(dev == NULL) {
fprintf(stderr, "libdvdread: Could not allocate memory.\n");
return NULL;
}
-
+
/* Open the device */
#ifndef WIN32
dev->fd = open(target, O_RDONLY);
@@ -174,7 +174,7 @@ static dvd_input_t file_open(const char
free(dev);
return NULL;
}
-
+
return dev;
}
@@ -217,20 +217,20 @@ static int file_read(dvd_input_t dev, vo
{
size_t len;
ssize_t ret;
-
+
len = (size_t)blocks * DVD_VIDEO_LB_LEN;
-
+
while(len > 0) {
-
+
ret = read(dev->fd, buffer, len);
-
+
if(ret < 0) {
/* One of the reads failed, too bad. We won't even bother
* returning the reads that went OK, and as in the POSIX spec
* the file position is left unspecified after a failure. */
return ret;
}
-
+
if(ret == 0) {
/* Nothing more to read. Return all of the whole blocks, if any.
* Adjust the file position back to the previous block boundary. */
@@ -240,7 +240,7 @@ static int file_read(dvd_input_t dev, vo
/* should have pos % 2048 == 0 */
return (int) (bytes / DVD_VIDEO_LB_LEN);
}
-
+
len -= ret;
}
@@ -309,11 +309,11 @@ int dvdinput_setup(void)
dlsym(dvdcss_library, U_S "dvdcss_read");
DVDcss_error = (char* (*)(dvdcss_handle))
dlsym(dvdcss_library, U_S "dvdcss_error");
-
+
dvdcss_version = (char **)dlsym(dvdcss_library, U_S "dvdcss_interface_2");
if(dlsym(dvdcss_library, U_S "dvdcss_crack")) {
- fprintf(stderr,
+ fprintf(stderr,
"libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n"
"libdvdread: You should get the latest version from "
"http://www.videolan.org/\n" );
@@ -327,7 +327,7 @@ int dvdinput_setup(void)
}
}
#endif /* HAVE_DVDCSS_DVDCSS_H */
-
+
if(dvdcss_library != NULL) {
/*
char *psz_method = getenv( "DVDCSS_METHOD" );
@@ -337,7 +337,7 @@ int dvdinput_setup(void)
*/
fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n",
dvdcss_version ? *dvdcss_version : "");
-
+
/* libdvdcss wrapper functions */
dvdinput_open = css_open;
dvdinput_close = css_close;
@@ -346,7 +346,7 @@ int dvdinput_setup(void)
dvdinput_read = css_read;
dvdinput_error = css_error;
return 1;
-
+
} else {
fprintf(stderr, "libdvdread: Encrypted DVD support unavailable.\n");
Modified: trunk/libdvdread/src/dvd_input.h
==============================================================================
--- trunk/libdvdread/src/dvd_input.h (original)
+++ trunk/libdvdread/src/dvd_input.h Sat Sep 6 23:55:51 2008
@@ -9,7 +9,7 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -36,7 +36,7 @@ typedef struct dvd_input_s *dvd_input_t;
extern dvd_input_t (*dvdinput_open) (const char *);
extern int (*dvdinput_close) (dvd_input_t);
extern int (*dvdinput_seek) (dvd_input_t, int);
-extern int (*dvdinput_title) (dvd_input_t, int);
+extern int (*dvdinput_title) (dvd_input_t, int);
extern int (*dvdinput_read) (dvd_input_t, void *, int, int);
extern char * (*dvdinput_error) (dvd_input_t);
Modified: trunk/libdvdread/src/dvd_reader.c
==============================================================================
--- trunk/libdvdread/src/dvd_reader.c (original)
+++ trunk/libdvdread/src/dvd_reader.c Sat Sep 6 23:55:51 2008
@@ -50,7 +50,7 @@ static inline int _private_gettimeofday(
#include <io.h> /* read() */
#define lseek64 _lseeki64
#endif
-
+
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__)
#define SYS_BSD 1
#endif
@@ -73,8 +73,8 @@ static inline int _private_gettimeofday(
struct dvd_reader_s {
/* Basic information. */
int isImageFile;
-
- /* Hack for keeping track of the css status.
+
+ /* Hack for keeping track of the css status.
* 0: no css, 1: perhaps (need init of keys), 2: have done init */
int css_state;
int css_title; /* Last title that we have called dvdinpute_title for. */
@@ -84,7 +84,7 @@ struct dvd_reader_s {
/* Information required for a directory path drive. */
char *path_root;
-
+
/* Filesystem cache */
int udfcache_level; /* 0 - turned off, 1 - on */
void *udfcache;
@@ -95,7 +95,7 @@ struct dvd_reader_s {
struct dvd_file_s {
/* Basic information. */
dvd_reader_t *dvd;
-
+
/* Hack for selecting the right css title. */
int css_title;
@@ -112,7 +112,7 @@ struct dvd_file_s {
};
int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number,
- size_t block_count, unsigned char *data,
+ size_t block_count, unsigned char *data,
int encrypted );
/**
@@ -123,7 +123,7 @@ int UDFReadBlocksRaw( dvd_reader_t *devi
int DVDUDFCacheLevel(dvd_reader_t *device, int level)
{
struct dvd_reader_s *dev = (struct dvd_reader_s *)device;
-
+
if(level > 0) {
level = 1;
} else if(level < 0) {
@@ -131,14 +131,14 @@ int DVDUDFCacheLevel(dvd_reader_t *devic
}
dev->udfcache_level = level;
-
+
return level;
}
void *GetUDFCacheHandle(dvd_reader_t *device)
{
struct dvd_reader_s *dev = (struct dvd_reader_s *)device;
-
+
return dev->udfcache;
}
@@ -159,18 +159,18 @@ static int initAllCSSKeys( dvd_reader_t
char filename[ MAX_UDF_FILE_NAME_LEN ];
uint32_t start, len;
int title;
-
+
char *nokeys_str = getenv("DVDREAD_NOKEYS");
if(nokeys_str != NULL)
return 0;
-
+
fprintf( stderr, "\n" );
fprintf( stderr, "libdvdread: Attempting to retrieve all CSS keys\n" );
fprintf( stderr, "libdvdread: This can take a _long_ time, "
"please be patient\n\n" );
-
+
gettimeofday(&all_s, NULL);
-
+
for( title = 0; title < 100; title++ ) {
gettimeofday( &t_s, NULL );
if( title == 0 ) {
@@ -181,40 +181,40 @@ static int initAllCSSKeys( dvd_reader_t
start = UDFFindFile( dvd, filename, &len );
if( start != 0 && len != 0 ) {
/* Perform CSS key cracking for this title. */
- fprintf( stderr, "libdvdread: Get key for %s at 0x%08x\n",
+ fprintf( stderr, "libdvdread: Get key for %s at 0x%08x\n",
filename, start );
if( dvdinput_title( dvd->dev, (int)start ) < 0 ) {
fprintf( stderr, "libdvdread: Error cracking CSS key for %s (0x%08x)\n", filename, start);
}
gettimeofday( &t_e, NULL );
- fprintf( stderr, "libdvdread: Elapsed time %ld\n",
+ fprintf( stderr, "libdvdread: Elapsed time %ld\n",
(long int) t_e.tv_sec - t_s.tv_sec );
}
-
+
if( title == 0 ) continue;
-
+
gettimeofday( &t_s, NULL );
sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, 1 );
start = UDFFindFile( dvd, filename, &len );
if( start == 0 || len == 0 ) break;
-
+
/* Perform CSS key cracking for this title. */
- fprintf( stderr, "libdvdread: Get key for %s at 0x%08x\n",
+ fprintf( stderr, "libdvdread: Get key for %s at 0x%08x\n",
filename, start );
if( dvdinput_title( dvd->dev, (int)start ) < 0 ) {
fprintf( stderr, "libdvdread: Error cracking CSS key for %s (0x%08x)!!\n", filename, start);
}
gettimeofday( &t_e, NULL );
- fprintf( stderr, "libdvdread: Elapsed time %ld\n",
+ fprintf( stderr, "libdvdread: Elapsed time %ld\n",
(long int) t_e.tv_sec - t_s.tv_sec );
}
title--;
-
+
fprintf( stderr, "libdvdread: Found %d VTS's\n", title );
gettimeofday(&all_e, NULL);
- fprintf( stderr, "libdvdread: Elapsed time %ld\n",
+ fprintf( stderr, "libdvdread: Elapsed time %ld\n",
(long int) all_e.tv_sec - all_s.tv_sec );
-
+
return 0;
}
@@ -227,7 +227,7 @@ static dvd_reader_t *DVDOpenImageFile( c
{
dvd_reader_t *dvd;
dvd_input_t dev;
-
+
dev = dvdinput_open( location );
if( !dev ) {
fprintf( stderr, "libdvdread: Can't open %s for reading\n", location );
@@ -242,7 +242,7 @@ static dvd_reader_t *DVDOpenImageFile( c
dvd->isImageFile = 1;
dvd->dev = dev;
dvd->path_root = NULL;
-
+
dvd->udfcache_level = DEFAULT_UDF_CACHE_LEVEL;
dvd->udfcache = NULL;
@@ -250,11 +250,11 @@ static dvd_reader_t *DVDOpenImageFile( c
/* Only if DVDCSS_METHOD = title, a bit if it's disc or if
* DVDCSS_METHOD = key but region missmatch. Unfortunaly we
* don't have that information. */
-
+
dvd->css_state = 1; /* Need key init. */
}
dvd->css_title = 0;
-
+
return dvd;
}
@@ -274,7 +274,7 @@ static dvd_reader_t *DVDOpenPath( const
dvd->udfcache_level = DEFAULT_UDF_CACHE_LEVEL;
dvd->udfcache = NULL;
-
+
dvd->css_state = 0; /* Only used in the UDF path */
dvd->css_title = 0; /* Only matters in the UDF path */
@@ -289,7 +289,7 @@ static char *sun_block2char( const char
{
char *new_path;
- /* Must contain "/dsk/" */
+ /* Must contain "/dsk/" */
if( !strstr( path, "/dsk/" ) ) return (char *) strdup( path );
/* Replace "/dsk/" with "/rdsk/" */
@@ -313,8 +313,8 @@ static char *bsd_block2char( const char
{
char *new_path;
- /* If it doesn't start with "/dev/" or does start with "/dev/r" exit */
- if( !strncmp( path, "/dev/", 5 ) || strncmp( path, "/dev/r", 6 ) )
+ /* If it doesn't start with "/dev/" or does start with "/dev/r" exit */
+ if( !strncmp( path, "/dev/", 5 ) || strncmp( path, "/dev/r", 6 ) )
return (char *) strdup( path );
/* Replace "/dev/" with "/dev/r" */
@@ -345,21 +345,21 @@ dvd_reader_t *DVDOpen( const char *ppath
path = strdup(ppath);
if( path == NULL )
return 0;
-
+
/* Try to open libdvdcss or fall back to standard functions */
have_css = dvdinput_setup();
#ifdef _MSC_VER
/* Strip off the trailing \ if it is not a drive */
len = strlen(path);
- if ((len > 1) &&
- (path[len - 1] == '\\') &&
+ if ((len > 1) &&
+ (path[len - 1] == '\\') &&
(path[len - 2] != ':'))
{
path[len-1] = '\0';
}
#endif
-
+
ret = stat( path, &fileinfo );
if( ret < 0 ) {
@@ -370,7 +370,7 @@ dvd_reader_t *DVDOpen( const char *ppath
free(path);
return ret_val;
}
-
+
/* If we can't stat the file, give up */
fprintf( stderr, "libdvdread: Can't stat %s\n", path );
perror("");
@@ -379,8 +379,8 @@ dvd_reader_t *DVDOpen( const char *ppath
}
/* First check if this is a block/char device or a file*/
- if( S_ISBLK( fileinfo.st_mode ) ||
- S_ISCHR( fileinfo.st_mode ) ||
+ if( S_ISBLK( fileinfo.st_mode ) ||
+ S_ISCHR( fileinfo.st_mode ) ||
S_ISREG( fileinfo.st_mode ) ) {
/**
@@ -408,7 +408,7 @@ dvd_reader_t *DVDOpen( const char *ppath
/* XXX: We should scream real loud here. */
if( !(path_copy = strdup( path ) ) ) {
- free(path);
+ free(path);
return NULL;
}
@@ -419,7 +419,7 @@ dvd_reader_t *DVDOpen( const char *ppath
{
char *new_path;
int cdir = open( ".", O_RDONLY );
-
+
if( cdir >= 0 ) {
chdir( path_copy );
new_path = malloc(PATH_MAX+1);
@@ -434,24 +434,24 @@ dvd_reader_t *DVDOpen( const char *ppath
path_copy = new_path;
}
}
-#endif
+#endif
/**
* If we're being asked to open a directory, check if that directory
* is the mountpoint for a DVD-ROM which we can use instead.
*/
if( strlen( path_copy ) > 1 ) {
- if( path_copy[ strlen( path_copy ) - 1 ] == '/' )
+ if( path_copy[ strlen( path_copy ) - 1 ] == '/' )
path_copy[ strlen( path_copy ) - 1 ] = '\0';
}
if( strlen( path_copy ) > TITLES_MAX ) {
- if( !strcasecmp( &(path_copy[ strlen( path_copy ) - TITLES_MAX ]),
+ if( !strcasecmp( &(path_copy[ strlen( path_copy ) - TITLES_MAX ]),
"/video_ts" ) ) {
path_copy[ strlen( path_copy ) - TITLES_MAX ] = '\0';
}
}
-
+
if(path_copy[0] == '\0') {
path_copy[0] = '/';
path_copy[1] = '\0';
@@ -476,7 +476,7 @@ dvd_reader_t *DVDOpen( const char *ppath
while( ( res = getmntent( mntfile, &mp ) ) != -1 ) {
if( res == 0 && !strcmp( mp.mnt_mountp, path_copy ) ) {
dev_name = sun_block2char( mp.mnt_special );
- fprintf( stderr,
+ fprintf( stderr,
"libdvdread: Attempting to use device %s"
" mounted on %s for CSS authentication\n",
dev_name,
@@ -491,10 +491,10 @@ dvd_reader_t *DVDOpen( const char *ppath
mntfile = fopen( MOUNTED, "r" );
if( mntfile ) {
struct mntent *me;
-
+
while( ( me = getmntent( mntfile ) ) ) {
if( !strcmp( me->mnt_dir, path_copy ) ) {
- fprintf( stderr,
+ fprintf( stderr,
"libdvdread: Attempting to use device %s"
" mounted on %s for CSS authentication\n",
me->mnt_fsname,
@@ -594,7 +594,7 @@ static dvd_file_t *DVDOpenFileUDF( dvd_r
* or -1 on file not found.
* or -2 on path not found.
*/
-static int findDirFile( const char *path, const char *file, char *filename )
+static int findDirFile( const char *path, const char *file, char *filename )
{
DIR *dir;
struct dirent *ent;
@@ -728,18 +728,18 @@ static dvd_file_t *DVDOpenVOBUDF( dvd_re
dvd_file->filesize += len / DVD_VIDEO_LB_LEN;
}
}
-
+
if( dvd->css_state == 1 /* Need key init */ ) {
initAllCSSKeys( dvd );
dvd->css_state = 2;
}
- /*
+ /*
if( dvdinput_title( dvd_file->dvd->dev, (int)start ) < 0 ) {
fprintf( stderr, "libdvdread: Error cracking CSS key for %s\n",
filename );
}
*/
-
+
return dvd_file;
}
@@ -760,7 +760,7 @@ static dvd_file_t *DVDOpenVOBPath( dvd_r
memset( dvd_file->title_sizes, 0, sizeof( dvd_file->title_sizes ) );
memset( dvd_file->title_devs, 0, sizeof( dvd_file->title_devs ) );
dvd_file->filesize = 0;
-
+
if( menu ) {
dvd_input_t dev;
@@ -818,11 +818,11 @@ static dvd_file_t *DVDOpenVOBPath( dvd_r
return dvd_file;
}
-dvd_file_t *DVDOpenFile( dvd_reader_t *dvd, int titlenum,
+dvd_file_t *DVDOpenFile( dvd_reader_t *dvd, int titlenum,
dvd_read_domain_t domain )
{
char filename[ MAX_UDF_FILE_NAME_LEN ];
-
+
/* Check arguments. */
if( dvd == NULL || titlenum < 0 )
return NULL;
@@ -861,7 +861,7 @@ dvd_file_t *DVDOpenFile( dvd_reader_t *d
fprintf( stderr, "libdvdread: Invalid domain for file open.\n" );
return NULL;
}
-
+
if( dvd->isImageFile ) {
return DVDOpenFileUDF( dvd, filename );
} else {
@@ -891,7 +891,7 @@ void DVDCloseFile( dvd_file_t *dvd_file
/* Internal, but used from dvd_udf.c */
int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number,
- size_t block_count, unsigned char *data,
+ size_t block_count, unsigned char *data,
int encrypted )
{
int ret;
@@ -906,7 +906,7 @@ int UDFReadBlocksRaw( dvd_reader_t *devi
return 0;
}
- ret = dvdinput_read( device->dev, (char *) data,
+ ret = dvdinput_read( device->dev, (char *) data,
(int) block_count, encrypted );
return ret;
}
@@ -947,7 +947,7 @@ static int DVDReadBlocksPath( dvd_file_t
if( ( offset + block_count ) <= dvd_file->title_sizes[ i ] ) {
off = dvdinput_seek( dvd_file->title_devs[ i ], (int)offset );
if( off < 0 || off != (int)offset ) {
- fprintf( stderr, "libdvdread: Can't seek to block %d\n",
+ fprintf( stderr, "libdvdread: Can't seek to block %d\n",
offset );
return off < 0 ? off : 0;
}
@@ -958,20 +958,20 @@ static int DVDReadBlocksPath( dvd_file_t
size_t part1_size = dvd_file->title_sizes[ i ] - offset;
/* FIXME: Really needs to be a while loop.
* (This is only true if you try and read >1GB at a time) */
-
+
/* Read part 1 */
off = dvdinput_seek( dvd_file->title_devs[ i ], (int)offset );
if( off < 0 || off != (int)offset ) {
- fprintf( stderr, "libdvdread: Can't seek to block %d\n",
+ fprintf( stderr, "libdvdread: Can't seek to block %d\n",
offset );
return off < 0 ? off : 0;
}
ret = dvdinput_read( dvd_file->title_devs[ i ], data,
(int)part1_size, encrypted );
if( ret < 0 ) return ret;
- /* FIXME: This is wrong if i is the last file in the set.
+ /* FIXME: This is wrong if i is the last file in the set.
* also error from this read will not show in ret. */
-
+
/* Does the next part exist? If not then return now. */
if( i + 1 >= TITLES_MAX || !dvd_file->title_devs[ i + 1 ] )
return ret;
@@ -979,11 +979,11 @@ static int DVDReadBlocksPath( dvd_file_t
/* Read part 2 */
off = dvdinput_seek( dvd_file->title_devs[ i + 1 ], 0 );
if( off < 0 || off != 0 ) {
- fprintf( stderr, "libdvdread: Can't seek to block %d\n",
+ fprintf( stderr, "libdvdread: Can't seek to block %d\n",
0 );
return off < 0 ? off : 0;
}
- ret2 = dvdinput_read( dvd_file->title_devs[ i + 1 ],
+ ret2 = dvdinput_read( dvd_file->title_devs[ i + 1 ],
data + ( part1_size
* (int64_t)DVD_VIDEO_LB_LEN ),
(int)(block_count - part1_size),
@@ -1000,34 +1000,34 @@ static int DVDReadBlocksPath( dvd_file_t
}
/* This is broken reading more than 2Gb at a time is ssize_t is 32-bit. */
-ssize_t DVDReadBlocks( dvd_file_t *dvd_file, int offset,
+ssize_t DVDReadBlocks( dvd_file_t *dvd_file, int offset,
size_t block_count, unsigned char *data )
{
int ret;
/* Check arguments. */
if( dvd_file == NULL || offset < 0 || data == NULL )
return -1;
-
+
/* Hack, and it will still fail for multiple opens in a threaded app ! */
if( dvd_file->dvd->css_title != dvd_file->css_title ) {
dvd_file->dvd->css_title = dvd_file->css_title;
if( dvd_file->dvd->isImageFile ) {
dvdinput_title( dvd_file->dvd->dev, (int)dvd_file->lb_start );
- }
- /* Here each vobu has it's own dvdcss handle, so no need to update
+ }
+ /* Here each vobu has it's own dvdcss handle, so no need to update
else {
dvdinput_title( dvd_file->title_devs[ 0 ], (int)dvd_file->lb_start );
}*/
}
-
+
if( dvd_file->dvd->isImageFile ) {
- ret = DVDReadBlocksUDF( dvd_file, (uint32_t)offset,
+ ret = DVDReadBlocksUDF( dvd_file, (uint32_t)offset,
block_count, data, DVDINPUT_READ_DECRYPT );
} else {
- ret = DVDReadBlocksPath( dvd_file, (unsigned int)offset,
+ ret = DVDReadBlocksPath( dvd_file, (unsigned int)offset,
block_count, data, DVDINPUT_READ_DECRYPT );
}
-
+
return (ssize_t)ret;
}
@@ -1036,7 +1036,7 @@ int32_t DVDFileSeek( dvd_file_t *dvd_fil
/* Check arguments. */
if( dvd_file == NULL || offset < 0 )
return -1;
-
+
if( offset > dvd_file->filesize * DVD_VIDEO_LB_LEN ) {
return -1;
}
@@ -1071,7 +1071,7 @@ ssize_t DVDReadBytes( dvd_file_t *dvd_fi
unsigned char *secbuf_base, *secbuf;
unsigned int numsec, seek_sector, seek_byte;
int ret;
-
+
/* Check arguments. */
if( dvd_file == NULL || data == NULL )
return -1;
@@ -1081,20 +1081,20 @@ ssize_t DVDReadBytes( dvd_file_t *dvd_fi
numsec = ( ( seek_byte + byte_size ) / DVD_VIDEO_LB_LEN ) +
( ( ( seek_byte + byte_size ) % DVD_VIDEO_LB_LEN ) ? 1 : 0 );
-
+
secbuf_base = (unsigned char *) malloc( numsec * DVD_VIDEO_LB_LEN + 2048 );
secbuf = (unsigned char *)(((uintptr_t)secbuf_base & ~((uintptr_t)2047)) + 2048);
if( !secbuf_base ) {
- fprintf( stderr, "libdvdread: Can't allocate memory "
+ fprintf( stderr, "libdvdread: Can't allocate memory "
"for file read!\n" );
return 0;
}
-
+
if( dvd_file->dvd->isImageFile ) {
- ret = DVDReadBlocksUDF( dvd_file, (uint32_t) seek_sector,
+ ret = DVDReadBlocksUDF( dvd_file, (uint32_t) seek_sector,
(size_t) numsec, secbuf, DVDINPUT_NOFLAGS );
} else {
- ret = DVDReadBlocksPath( dvd_file, seek_sector,
+ ret = DVDReadBlocksPath( dvd_file, seek_sector,
(size_t) numsec, secbuf, DVDINPUT_NOFLAGS );
}
@@ -1115,7 +1115,7 @@ ssize_t DVDFileSize( dvd_file_t *dvd_fil
/* Check arguments. */
if( dvd_file == NULL )
return -1;
-
+
return dvd_file->filesize;
}
@@ -1128,8 +1128,8 @@ int DVDDiscID( dvd_reader_t *dvd, unsign
/* Check arguments. */
if( dvd == NULL || discid == NULL )
return 0;
-
- /* Go through the first 10 IFO:s, in order,
+
+ /* Go through the first 10 IFO:s, in order,
* and md5sum them, i.e VIDEO_TS.IFO and VTS_0?_0.IFO */
md5_init_ctx( &ctx );
for( title = 0; title < 10; title++ ) {
@@ -1139,7 +1139,7 @@ int DVDDiscID( dvd_reader_t *dvd, unsign
size_t file_size = dvd_file->filesize * DVD_VIDEO_LB_LEN;
char *buffer_base = malloc( file_size + 2048 );
char *buffer = (char *)(((uintptr_t)buffer_base & ~((uintptr_t)2047)) + 2048);
-
+
if( buffer_base == NULL ) {
DVDCloseFile( dvd_file );
fprintf( stderr, "libdvdread: DVDDiscId, failed to "
@@ -1154,9 +1154,9 @@ int DVDDiscID( dvd_reader_t *dvd, unsign
free( buffer_base );
return -1;
}
-
+
md5_process_bytes( buffer, file_size, &ctx );
-
+
DVDCloseFile( dvd_file );
free( buffer_base );
nr_of_files++;
@@ -1165,7 +1165,7 @@ int DVDDiscID( dvd_reader_t *dvd, unsign
md5_finish_ctx( &ctx, discid );
if(!nr_of_files)
return -1;
-
+
return 0;
}
@@ -1180,12 +1180,12 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd,
/* Check arguments. */
if( dvd == NULL )
return 0;
-
+
if( dvd->dev == NULL ) {
/* No block access, so no ISO... */
return -1;
}
-
+
buffer_base = malloc( DVD_VIDEO_LB_LEN + 2048 );
buffer = (unsigned char *)(((uintptr_t)buffer_base & ~((uintptr_t)2047)) + 2048);
@@ -1202,7 +1202,7 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd,
free( buffer_base );
return -1;
}
-
+
if( (volid != NULL) && (volid_size > 0) ) {
unsigned int n;
for(n = 0; n < 32; n++) {
@@ -1210,7 +1210,7 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd,
break;
}
}
-
+
if(volid_size > n+1) {
volid_size = n+1;
}
@@ -1218,7 +1218,7 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd,
memcpy(volid, &buffer[40], volid_size-1);
volid[volid_size-1] = '\0';
}
-
+
if( (volsetid != NULL) && (volsetid_size > 0) ) {
if(volsetid_size > 128) {
volsetid_size = 128;
@@ -1238,12 +1238,12 @@ int DVDUDFVolumeInfo( dvd_reader_t *dvd,
/* Check arguments. */
if( dvd == NULL )
return -1;
-
+
if( dvd->dev == NULL ) {
/* No block access, so no UDF VolumeSet Identifier */
return -1;
}
-
+
if( (volid != NULL) && (volid_size > 0) ) {
ret = UDFGetVolumeIdentifier(dvd, volid, volid_size);
if(!ret) {
@@ -1256,6 +1256,6 @@ int DVDUDFVolumeInfo( dvd_reader_t *dvd,
return -1;
}
}
-
- return 0;
+
+ return 0;
}
Modified: trunk/libdvdread/src/dvd_reader.h
==============================================================================
--- trunk/libdvdread/src/dvd_reader.h (original)
+++ trunk/libdvdread/src/dvd_reader.h Sat Sep 6 23:55:51 2008
@@ -56,12 +56,12 @@
#ifdef __cplusplus
extern "C" {
#endif
-
+
/**
* Opaque type that is used as a handle for one instance of an opened DVD.
*/
typedef struct dvd_reader_s dvd_reader_t;
-
+
/**
* Opaque type for a file read handle, much like a normal fd or FILE *.
*/
@@ -73,7 +73,7 @@ typedef struct dvd_file_s dvd_file_t;
*
* If the given file is a block device, or is the mountpoint for a block
* device, then that device is used for CSS authentication using libdvdcss.
- * If no device is available, then no CSS authentication is performed,
+ * If no device is available, then no CSS authentication is performed,
* and we hope that the image is decrypted.
*
* If the path given is a directory, then the files in that directory may be
@@ -84,7 +84,7 @@ typedef struct dvd_file_s dvd_file_t;
* path/VTS_01_1.VOB
* path/vts_01_1.vob
*
- * @param path Specifies the the device, file or directory to be used.
+ * @param path Specifies the the device, file or directory to be used.
* @return If successful a a read handle is returned. Otherwise 0 is returned.
*
* dvd = DVDOpen(path);
@@ -103,13 +103,13 @@ dvd_reader_t *DVDOpen( const char * );
void DVDClose( dvd_reader_t * );
/**
- *
+ *
*/
typedef enum {
DVD_READ_INFO_FILE, /**< VIDEO_TS.IFO or VTS_XX_0.IFO (title) */
DVD_READ_INFO_BACKUP_FILE, /**< VIDEO_TS.BUP or VTS_XX_0.BUP (title) */
DVD_READ_MENU_VOBS, /**< VIDEO_TS.VOB or VTS_XX_0.VOB (title) */
- DVD_READ_TITLE_VOBS /**< VTS_XX_[1-9].VOB (title). All files in
+ DVD_READ_TITLE_VOBS /**< VTS_XX_[1-9].VOB (title). All files in
the title set are opened and read as a
single file. */
} dvd_read_domain_t;
@@ -123,7 +123,7 @@ typedef enum {
*
* @param dvd A dvd read handle.
* @param titlenum Which Video Title Set should be used, VIDEO_TS is 0.
- * @param domain Which domain.
+ * @param domain Which domain.
* @return If successful a a file read handle is returned, otherwise 0.
*
* dvd_file = DVDOpenFile(dvd, titlenum, domain); */
@@ -141,8 +141,8 @@ void DVDCloseFile( dvd_file_t * );
/**
* Reads block_count number of blocks from the file at the given block offset.
* Returns number of blocks read on success, -1 on error. This call is only
- * for reading VOB data, and should not be used when reading the IFO files.
- * When reading from an encrypted drive, blocks are decrypted using libdvdcss
+ * for reading VOB data, and should not be used when reading the IFO files.
+ * When reading from an encrypted drive, blocks are decrypted using libdvdcss
* where required.
*
* @param dvd_file A file read handle.
@@ -198,7 +198,7 @@ ssize_t DVDFileSize( dvd_file_t * );
* This is the MD5 sum of VIDEO_TS.IFO and the VTS_0?_0.IFO files
* in title order (those that exist).
* If you need a 'text' representation of the id, print it as a
- * hexadecimal number, using lowercase letters, discid[0] first.
+ * hexadecimal number, using lowercase letters, discid[0] first.
* I.e. the same format as the command-line 'md5sum' program uses.
*
* @param dvd A read handle to get the disc ID from
@@ -263,7 +263,7 @@ int DVDISOVolumeInfo( dvd_reader_t *, ch
* -1 - returns the current setting.
* 0 - UDF Cache turned off.
* 1 - (default level) Pointers to IFO files and some data from
- * PrimaryVolumeDescriptor are cached.
+ * PrimaryVolumeDescriptor are cached.
*
* @return The level of caching.
*/
Modified: trunk/libdvdread/src/dvd_udf.c
==============================================================================
--- trunk/libdvdread/src/dvd_udf.c (original)
+++ trunk/libdvdread/src/dvd_udf.c Sat Sep 6 23:55:51 2008
@@ -10,24 +10,24 @@
* Copyright (C) 1999 Christian Wolff for convergence integrated media
* GmbH The author can be reached at scarabaeus at convergence.de, the
* project's page is at http://linuxtv.org/dvd/
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA. Or, point your browser to
* http://www.gnu.org/copyleft/gpl.html
*/
-
+
#include "config.h"
#include <stdio.h>
@@ -44,12 +44,12 @@
/* Private but located in/shared with dvd_reader.c */
extern int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number,
- size_t block_count, unsigned char *data,
+ size_t block_count, unsigned char *data,
int encrypted );
/* It's required to either fail or deliver all the blocks asked for. */
static int DVDReadLBUDF( dvd_reader_t *device, uint32_t lb_number,
- size_t block_count, unsigned char *data,
+ size_t block_count, unsigned char *data,
int encrypted )
{
int ret;
@@ -234,7 +234,7 @@ static int SetUDFCache(dvd_reader_t *dev
c = (struct udf_cache *)GetUDFCacheHandle(device);
if(c == NULL) {
- c = calloc(1, sizeof(struct udf_cache));
+ c = calloc(1, sizeof(struct udf_cache));
/* fprintf(stderr, "calloc: %d\n", sizeof(struct udf_cache)); */
if(c == NULL)
return 0;
@@ -244,19 +244,19 @@ static int SetUDFCache(dvd_reader_t *dev
switch(type) {
case AVDPCache:
- c->avdp = *(struct avdp_t *)data;
+ c->avdp = *(struct avdp_t *)data;
c->avdp_valid = 1;
break;
case PVDCache:
- c->pvd = *(struct pvd_t *)data;
+ c->pvd = *(struct pvd_t *)data;
c->pvd_valid = 1;
break;
case PartitionCache:
- c->partition = *(struct Partition *)data;
+ c->partition = *(struct Partition *)data;
c->partition_valid = 1;
break;
case RootICBCache:
- c->rooticb = *(struct AD *)data;
+ c->rooticb = *(struct AD *)data;
c->rooticb_valid = 1;
break;
case LBUDFCache:
@@ -331,7 +331,7 @@ static int SetUDFCache(dvd_reader_t *dev
/* This is wrong with regard to endianess */
#define GETN(p, n, target) memcpy(target, &data[p], n)
-static int Unicodedecode( uint8_t *data, int len, char *target )
+static int Unicodedecode( uint8_t *data, int len, char *target )
{
int p = 1, i = 0;
@@ -346,22 +346,22 @@ static int Unicodedecode( uint8_t *data,
return 0;
}
-static int UDFDescriptor( uint8_t *data, uint16_t *TagID )
+static int UDFDescriptor( uint8_t *data, uint16_t *TagID )
{
*TagID = GETN2(0);
/* TODO: check CRC 'n stuff */
return 0;
}
-static int UDFExtentAD( uint8_t *data, uint32_t *Length, uint32_t *Location )
+static int UDFExtentAD( uint8_t *data, uint32_t *Length, uint32_t *Location )
{
*Length = GETN4(0);
*Location = GETN4(4);
return 0;
}
-static int UDFShortAD( uint8_t *data, struct AD *ad,
- struct Partition *partition )
+static int UDFShortAD( uint8_t *data, struct AD *ad,
+ struct Partition *partition )
{
ad->Length = GETN4(0);
ad->Flags = ad->Length >> 30;
@@ -427,7 +427,7 @@ static int UDFLogVolume( uint8_t *data,
return 0;
}
-static int UDFFileEntry( uint8_t *data, uint8_t *FileType,
+static int UDFFileEntry( uint8_t *data, uint8_t *FileType,
struct Partition *partition, struct AD *ad )
{
uint16_t flags;
@@ -488,7 +488,7 @@ static int UDFFileIdentifier( uint8_t *d
* return 1 on success, 0 on error;
*/
static int UDFMapICB( dvd_reader_t *device, struct AD ICB, uint8_t *FileType,
- struct Partition *partition, struct AD *File )
+ struct Partition *partition, struct AD *File )
{
uint8_t LogBlock_base[DVD_VIDEO_LB_LEN + 2048];
uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~((uintptr_t)2047)) + 2048);
@@ -531,7 +531,7 @@ static int UDFMapICB( dvd_reader_t *devi
*/
static int UDFScanDir( dvd_reader_t *device, struct AD Dir, char *FileName,
struct Partition *partition, struct AD *FileICB,
- int cache_file_info)
+ int cache_file_info)
{
char filename[ MAX_UDF_FILE_NAME_LEN ];
uint8_t directory_base[ 2 * DVD_VIDEO_LB_LEN + 2048];
@@ -649,7 +649,7 @@ static int UDFGetAVDP( dvd_reader_t *dev
uint16_t TagID;
uint32_t lastsector;
int terminate;
- struct avdp_t;
+ struct avdp_t;
if(GetUDFCache(device, AVDPCache, 0, avdp))
return 1;
@@ -710,7 +710,7 @@ static int UDFGetAVDP( dvd_reader_t *dev
* part: structure to fill with the partition information
*/
static int UDFFindPartition( dvd_reader_t *device, int partnum,
- struct Partition *part )
+ struct Partition *part )
{
uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ];
uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~((uintptr_t)2047)) + 2048);
@@ -851,7 +851,7 @@ uint32_t UDFFindFile( dvd_reader_t *devi
* bufsize, size of BlockBuf (must be >= DVD_VIDEO_LB_LEN).
*/
static int UDFGetDescriptor( dvd_reader_t *device, int id,
- uint8_t *descriptor, int bufsize)
+ uint8_t *descriptor, int bufsize)
{
uint32_t lbnum, MVDS_location, MVDS_length;
struct avdp_t avdp;
@@ -945,7 +945,7 @@ int UDFGetVolumeIdentifier(dvd_reader_t
* Gets the Volume Set Identifier, as a 128-byte dstring (not decoded)
* WARNING This is not a null terminated string
* volsetid, place to put the data
- * volsetid_size, size of the buffer volsetid points to
+ * volsetid_size, size of the buffer volsetid points to
* the buffer should be >=128 bytes to store the whole volumesetidentifier
* returns the size of the available volsetid information (128)
* or 0 on error
Modified: trunk/libdvdread/src/dvd_udf.h
==============================================================================
--- trunk/libdvdread/src/dvd_udf.h (original)
+++ trunk/libdvdread/src/dvd_udf.h Sat Sep 6 23:55:51 2008
@@ -8,22 +8,22 @@
* Modifications by:
* Billy Biggs <vektor at dumbterm.net>.
* Björn Englund <d4bjorn at dtek.chalmers.se>.
- *
+ *
* dvdudf: parse and read the UDF volume information of a DVD Video
* Copyright (C) 1999 Christian Wolff for convergence integrated media
* GmbH The author can be reached at scarabaeus at convergence.de, the
* project's page is at http://linuxtv.org/dvd/
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Modified: trunk/libdvdread/src/ifo_print.c
==============================================================================
--- trunk/libdvdread/src/ifo_print.c (original)
+++ trunk/libdvdread/src/ifo_print.c Sat Sep 6 23:55:51 2008
@@ -1,4 +1,4 @@
-/*
+/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -36,8 +36,8 @@ static void ifo_print_time(int level, dv
assert((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa);
assert((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa);
assert((dtime->frame_u&0xf) < 0xa);
-
- printf("%02x:%02x:%02x.%02x",
+
+ printf("%02x:%02x:%02x.%02x",
dtime->hour,
dtime->minute,
dtime->second,
@@ -50,13 +50,13 @@ static void ifo_print_time(int level, dv
rate = "29.97";
break;
default:
- if(dtime->hour == 0 && dtime->minute == 0
+ if(dtime->hour == 0 && dtime->minute == 0
&& dtime->second == 0 && dtime->frame_u == 0)
rate = "no";
else
rate = "(please send a bug report)";
break;
- }
+ }
printf(" @ %s fps", rate);
}
@@ -81,23 +81,23 @@ static void ifo_print_cmd(int row, vm_cm
}
static void ifo_print_video_attributes(int level, video_attr_t *attr) {
-
+
/* The following test is shorter but not correct ISO C,
memcmp(attr,my_friendly_zeros, sizeof(video_attr_t)) */
- if(attr->mpeg_version == 0
- && attr->video_format == 0
- && attr->display_aspect_ratio == 0
- && attr->permitted_df == 0
- && attr->unknown1 == 0
- && attr->line21_cc_1 == 0
- && attr->line21_cc_2 == 0
- && attr->video_format == 0
- && attr->letterboxed == 0
+ if(attr->mpeg_version == 0
+ && attr->video_format == 0
+ && attr->display_aspect_ratio == 0
+ && attr->permitted_df == 0
+ && attr->unknown1 == 0
+ && attr->line21_cc_1 == 0
+ && attr->line21_cc_2 == 0
+ && attr->video_format == 0
+ && attr->letterboxed == 0
&& attr->film_mode == 0) {
printf("-- Unspecified --");
return;
}
-
+
switch(attr->mpeg_version) {
case 0:
printf("mpeg1, ");
@@ -108,7 +108,7 @@ static void ifo_print_video_attributes(i
default:
printf("(please send a bug report), ");
}
-
+
switch(attr->video_format) {
case 0:
printf("ntsc, ");
@@ -119,7 +119,7 @@ static void ifo_print_video_attributes(i
default:
printf("(please send a bug report), ");
}
-
+
switch(attr->display_aspect_ratio) {
case 0:
printf("4:3, ");
@@ -130,7 +130,7 @@ static void ifo_print_video_attributes(i
default:
printf("(please send a bug report), ");
}
-
+
// Wide is allways allowed..!!!
switch(attr->permitted_df) {
case 0:
@@ -148,10 +148,10 @@ static void ifo_print_video_attributes(i
default:
printf("(please send a bug report), ");
}
-
+
printf("U%x, ", attr->unknown1);
assert(!attr->unknown1);
-
+
if(attr->line21_cc_1 || attr->line21_cc_2) {
printf("NTSC CC ");
if(attr->line21_cc_1)
@@ -159,10 +159,10 @@ static void ifo_print_video_attributes(i
if(attr->line21_cc_2)
printf("2, ");
}
-
+
{
int height = 480;
- if(attr->video_format != 0)
+ if(attr->video_format != 0)
height = 576;
switch(attr->picture_size) {
case 0:
@@ -176,7 +176,7 @@ static void ifo_print_video_attributes(i
break;
case 3:
printf("352x%d, ", height/2);
- break;
+ break;
default:
printf("(please send a bug report), ");
}
@@ -185,7 +185,7 @@ static void ifo_print_video_attributes(i
if(attr->letterboxed) {
printf("source letterboxed, ");
}
-
+
if(attr->film_mode) {
printf("film. ");
} else {
@@ -194,7 +194,7 @@ static void ifo_print_video_attributes(i
}
static void ifo_print_audio_attributes(int level, audio_attr_t *attr) {
-
+
if(attr->audio_format == 0
&& attr->multichannel_extension == 0
&& attr->lang_type == 0
@@ -208,7 +208,7 @@ static void ifo_print_audio_attributes(i
printf("-- Unspecified --");
return;
}
-
+
switch(attr->audio_format) {
case 0:
printf("ac3 ");
@@ -230,7 +230,7 @@ static void ifo_print_audio_attributes(i
printf("drc ");
break;
default:
- printf("(please send a bug report) mpeg reserved quant/drc (%d)", attr->quantization);
+ printf("(please send a bug report) mpeg reserved quant/drc (%d)", attr->quantization);
}
break;
case 4:
@@ -261,10 +261,10 @@ static void ifo_print_audio_attributes(i
default:
printf("(please send a bug report) ");
}
-
+
if(attr->multichannel_extension)
printf("multichannel_extension ");
-
+
switch(attr->lang_type) {
case 0:
// not specified
@@ -290,7 +290,7 @@ static void ifo_print_audio_attributes(i
default:
printf("(please send a bug report) ");
}
-
+
switch(attr->quantization) {
case 0:
printf("16bit ");
@@ -307,7 +307,7 @@ static void ifo_print_audio_attributes(i
default:
printf("(please send a bug report) ");
}
-
+
switch(attr->sample_frequency) {
case 0:
printf("48kHz ");
@@ -316,12 +316,12 @@ static void ifo_print_audio_attributes(i
printf("??kHz ");
break;
default:
- printf("sample_frequency %i (please send a bug report) ",
+ printf("sample_frequency %i (please send a bug report) ",
attr->sample_frequency);
}
-
+
printf("%dCh ", attr->channels + 1);
-
+
switch(attr->lang_extension) {
case 0:
printf("Not specified ");
@@ -338,17 +338,17 @@ static void ifo_print_audio_attributes(i
case 4: // Directors 2
printf("Director's comments 2 ");
break;
- //case 4: // Music score ?
+ //case 4: // Music score ?
default:
printf("(please send a bug report) ");
}
-
+
printf("%d ", attr->unknown1);
printf("%d ", attr->unknown3);
}
static void ifo_print_subp_attributes(int level, subp_attr_t *attr) {
-
+
if(attr->type == 0
&& attr->lang_code == 0
&& attr->zero1 == 0
@@ -357,17 +357,17 @@ static void ifo_print_subp_attributes(in
printf("-- Unspecified --");
return;
}
-
+
printf("type %02x ", attr->type);
-
+
if(isalpha((int)(attr->lang_code >> 8))
&& isalpha((int)(attr->lang_code & 0xff))) {
printf("%c%c ", attr->lang_code >> 8, attr->lang_code & 0xff);
} else {
- printf("%02x%02x ", 0xff & (unsigned)(attr->lang_code >> 8),
+ printf("%02x%02x ", 0xff & (unsigned)(attr->lang_code >> 8),
0xff & (unsigned)(attr->lang_code & 0xff));
}
-
+
printf("%d ", attr->zero1);
printf("%d ", attr->zero2);
@@ -381,7 +381,7 @@ static void ifo_print_subp_attributes(in
case 2:
printf("Caption with bigger size character ");
break;
- case 3:
+ case 3:
printf("Caption for children ");
break;
case 4:
@@ -430,12 +430,12 @@ static void ifo_print_subp_attributes(in
static void ifo_print_USER_OPS(user_ops_t *user_ops) {
uint32_t uops;
unsigned char *ptr = (unsigned char *)user_ops;
-
+
uops = (*ptr++ << 24);
uops |= (*ptr++ << 16);
uops |= (*ptr++ << 8);
uops |= (*ptr++);
-
+
if(uops == 0) {
printf("None\n");
} else if(uops == 0x01ffffff) {
@@ -497,12 +497,12 @@ static void ifo_print_USER_OPS(user_ops_
void ifo_print_VMGI_MAT(vmgi_mat_t *vmgi_mat) {
-
+
printf("VMG Identifier: %.12s\n", vmgi_mat->vmg_identifier);
printf("Last Sector of VMG: %08x\n", vmgi_mat->vmg_last_sector);
printf("Last Sector of VMGI: %08x\n", vmgi_mat->vmgi_last_sector);
- printf("Specification version number: %01x.%01x\n",
- vmgi_mat->specification_version >> 4,
+ printf("Specification version number: %01x.%01x\n",
+ vmgi_mat->specification_version >> 4,
vmgi_mat->specification_version & 0xf);
/* Byte 2 of 'VMG Category' (00xx0000) is the Region Code */
printf("VMG Category: %08x (Region Code=%02x)\n", vmgi_mat->vmg_category, ((vmgi_mat->vmg_category >> 16) & 0xff) ^0xff);
@@ -514,7 +514,7 @@ void ifo_print_VMGI_MAT(vmgi_mat_t *vmgi
printf("VMG POS Code: %08x", (uint32_t)(vmgi_mat->vmg_pos_code >> 32));
printf("%08x\n", (uint32_t)vmgi_mat->vmg_pos_code);
printf("End byte of VMGI_MAT: %08x\n", vmgi_mat->vmgi_last_byte);
- printf("Start byte of First Play PGC (FP PGC): %08x\n",
+ printf("Start byte of First Play PGC (FP PGC): %08x\n",
vmgi_mat->first_play_pgc);
printf("Start sector of VMGM_VOBS: %08x\n", vmgi_mat->vmgm_vobs);
printf("Start sector of TT_SRPT: %08x\n", vmgi_mat->tt_srpt);
@@ -523,19 +523,19 @@ void ifo_print_VMGI_MAT(vmgi_mat_t *vmgi
printf("Start sector of VTS_ATRT: %08x\n", vmgi_mat->vts_atrt);
printf("Start sector of TXTDT_MG: %08x\n", vmgi_mat->txtdt_mgi);
printf("Start sector of VMGM_C_ADT: %08x\n", vmgi_mat->vmgm_c_adt);
- printf("Start sector of VMGM_VOBU_ADMAP: %08x\n",
+ printf("Start sector of VMGM_VOBU_ADMAP: %08x\n",
vmgi_mat->vmgm_vobu_admap);
printf("Video attributes of VMGM_VOBS: ");
ifo_print_video_attributes(5, &vmgi_mat->vmgm_video_attr);
printf("\n");
- printf("VMGM Number of Audio attributes: %i\n",
+ printf("VMGM Number of Audio attributes: %i\n",
vmgi_mat->nr_of_vmgm_audio_streams);
if(vmgi_mat->nr_of_vmgm_audio_streams > 0) {
printf("\tstream %i status: ", 1);
ifo_print_audio_attributes(5, &vmgi_mat->vmgm_audio_attr);
printf("\n");
}
- printf("VMGM Number of Sub-picture attributes: %i\n",
+ printf("VMGM Number of Sub-picture attributes: %i\n",
vmgi_mat->nr_of_vmgm_subp_streams);
if(vmgi_mat->nr_of_vmgm_subp_streams > 0) {
printf("\tstream %2i status: ", 1);
@@ -551,8 +551,8 @@ void ifo_print_VTSI_MAT(vtsi_mat_t *vtsi
printf("VTS Identifier: %.12s\n", vtsi_mat->vts_identifier);
printf("Last Sector of VTS: %08x\n", vtsi_mat->vts_last_sector);
printf("Last Sector of VTSI: %08x\n", vtsi_mat->vtsi_last_sector);
- printf("Specification version number: %01x.%01x\n",
- vtsi_mat->specification_version>>4,
+ printf("Specification version number: %01x.%01x\n",
+ vtsi_mat->specification_version>>4,
vtsi_mat->specification_version&0xf);
printf("VTS Category: %08x\n", vtsi_mat->vts_category);
printf("End byte of VTSI_MAT: %08x\n", vtsi_mat->vtsi_last_byte);
@@ -570,36 +570,36 @@ void ifo_print_VTSI_MAT(vtsi_mat_t *vtsi
printf("Video attributes of VTSM_VOBS: ");
ifo_print_video_attributes(5, &vtsi_mat->vtsm_video_attr);
printf("\n");
-
- printf("VTSM Number of Audio attributes: %i\n",
+
+ printf("VTSM Number of Audio attributes: %i\n",
vtsi_mat->nr_of_vtsm_audio_streams);
if(vtsi_mat->nr_of_vtsm_audio_streams > 0) {
printf("\tstream %i status: ", 1);
ifo_print_audio_attributes(5, &vtsi_mat->vtsm_audio_attr);
printf("\n");
}
-
- printf("VTSM Number of Sub-picture attributes: %i\n",
+
+ printf("VTSM Number of Sub-picture attributes: %i\n",
vtsi_mat->nr_of_vtsm_subp_streams);
if(vtsi_mat->nr_of_vtsm_subp_streams > 0) {
printf("\tstream %2i status: ", 1);
ifo_print_subp_attributes(5, &vtsi_mat->vtsm_subp_attr);
printf("\n");
}
-
+
printf("Video attributes of VTS_VOBS: ");
ifo_print_video_attributes(5, &vtsi_mat->vts_video_attr);
printf("\n");
-
- printf("VTS Number of Audio attributes: %i\n",
+
+ printf("VTS Number of Audio attributes: %i\n",
vtsi_mat->nr_of_vts_audio_streams);
for(i = 0; i < vtsi_mat->nr_of_vts_audio_streams; i++) {
printf("\tstream %i status: ", i);
ifo_print_audio_attributes(5, &vtsi_mat->vts_audio_attr[i]);
printf("\n");
}
-
- printf("VTS Number of Subpicture attributes: %i\n",
+
+ printf("VTS Number of Subpicture attributes: %i\n",
vtsi_mat->nr_of_vts_subp_streams);
for(i = 0; i < vtsi_mat->nr_of_vts_subp_streams; i++) {
printf("\tstream %2i status: ", i);
@@ -611,12 +611,12 @@ void ifo_print_VTSI_MAT(vtsi_mat_t *vtsi
static void ifo_print_PGC_COMMAND_TBL(pgc_command_tbl_t *cmd_tbl) {
int i;
-
+
if(cmd_tbl == NULL) {
printf("No Command table present\n");
return;
}
-
+
printf("Number of Pre commands: %i\n", cmd_tbl->nr_of_pre);
for(i = 0; i < cmd_tbl->nr_of_pre; i++) {
ifo_print_cmd(i, &cmd_tbl->pre_cmds[i]);
@@ -636,12 +636,12 @@ static void ifo_print_PGC_COMMAND_TBL(pg
static void ifo_print_PGC_PROGRAM_MAP(pgc_program_map_t *program_map, int nr) {
int i;
-
+
if(program_map == NULL) {
printf("No Program map present\n");
return;
}
-
+
for(i = 0; i < nr; i++) {
printf("Program %3i Entry Cell: %3i\n", i + 1, program_map[i]);
}
@@ -650,12 +650,12 @@ static void ifo_print_PGC_PROGRAM_MAP(pg
static void ifo_print_CELL_PLAYBACK(cell_playback_t *cell_playback, int nr) {
int i;
-
+
if(cell_playback == NULL) {
printf("No Cell Playback info present\n");
return;
}
-
+
for(i=0;i<nr;i++) {
printf("Cell: %3i ", i + 1);
@@ -676,7 +676,7 @@ static void ifo_print_CELL_PLAYBACK(cell
s = "last"; break;
}
printf("%s cell in the block ", s);
-
+
switch(cell_playback[i].block_type) {
case 0:
printf("not part of the block ");
@@ -708,26 +708,26 @@ static void ifo_print_CELL_PLAYBACK(cell
printf("still time %d ", cell_playback[i].still_time);
if(cell_playback[i].cell_cmd_nr)
printf("cell command %d", cell_playback[i].cell_cmd_nr);
-
- printf("\n\tStart sector: %08x\tFirst ILVU end sector: %08x\n",
- cell_playback[i].first_sector,
+
+ printf("\n\tStart sector: %08x\tFirst ILVU end sector: %08x\n",
+ cell_playback[i].first_sector,
cell_playback[i].first_ilvu_end_sector);
- printf("\tEnd sector: %08x\tLast VOBU start sector: %08x\n",
- cell_playback[i].last_sector,
+ printf("\tEnd sector: %08x\tLast VOBU start sector: %08x\n",
+ cell_playback[i].last_sector,
cell_playback[i].last_vobu_start_sector);
}
}
static void ifo_print_CELL_POSITION(cell_position_t *cell_position, int nr) {
int i;
-
+
if(cell_position == NULL) {
printf("No Cell Position info present\n");
return;
}
-
+
for(i=0;i<nr;i++) {
- printf("Cell: %3i has VOB ID: %3i, Cell ID: %3i\n", i + 1,
+ printf("Cell: %3i has VOB ID: %3i, Cell ID: %3i\n", i + 1,
cell_position[i].vob_id_nr, cell_position[i].cell_nr);
}
}
@@ -735,7 +735,7 @@ static void ifo_print_CELL_POSITION(cell
void ifo_print_PGC(pgc_t *pgc) {
int i;
-
+
if (!pgc) {
printf("None\n");
return;
@@ -749,17 +749,17 @@ void ifo_print_PGC(pgc_t *pgc) {
/* If no programs/no time then does this mean anything? */
printf("Prohibited user operations: ");
ifo_print_USER_OPS(&pgc->prohibited_ops);
-
+
for(i = 0; i < 8; i++) {
if(pgc->audio_control[i] & 0x8000) { /* The 'is present' bit */
- printf("Audio stream %i control: %04x\n",
+ printf("Audio stream %i control: %04x\n",
i, pgc->audio_control[i]);
}
}
-
+
for(i = 0; i < 32; i++) {
if(pgc->subp_control[i] & 0x80000000) { /* The 'is present' bit */
- printf("Subpicture stream %2i control: %08x: 4:3=%d, Wide=%d, Letterbox=%d, Pan-Scan=%d\n",
+ printf("Subpicture stream %2i control: %08x: 4:3=%d, Wide=%d, Letterbox=%d, Pan-Scan=%d\n",
i, pgc->subp_control[i],
(pgc->subp_control[i] >>24) & 0x1f,
(pgc->subp_control[i] >>16) & 0x1f,
@@ -767,7 +767,7 @@ void ifo_print_PGC(pgc_t *pgc) {
(pgc->subp_control[i] ) & 0x1f);
}
}
-
+
printf("Next PGC number: %i\n", pgc->next_pgc_nr);
printf("Prev PGC number: %i\n", pgc->prev_pgc_nr);
printf("GoUp PGC number: %i\n", pgc->goup_pgc_nr);
@@ -775,13 +775,13 @@ void ifo_print_PGC(pgc_t *pgc) {
printf("Still time: %i seconds (255=inf)\n", pgc->still_time);
printf("PG Playback mode %02x\n", pgc->pg_playback_mode);
}
-
+
if(pgc->nr_of_programs != 0) {
for(i = 0; i < 16; i++) {
printf("Color %2i: %08x\n", i, pgc->palette[i]);
}
}
-
+
/* Memmory offsets to div. tables. */
ifo_print_PGC_COMMAND_TBL(pgc->command_tbl);
ifo_print_PGC_PROGRAM_MAP(pgc->program_map, pgc->nr_of_programs);
@@ -792,23 +792,23 @@ void ifo_print_PGC(pgc_t *pgc) {
void ifo_print_TT_SRPT(tt_srpt_t *tt_srpt) {
int i;
-
+
printf("Number of TitleTrack search pointers: %i\n",
tt_srpt->nr_of_srpts);
for(i=0;i<tt_srpt->nr_of_srpts;i++) {
printf("Title Track index %i\n", i + 1);
- printf("\tTitle set number (VTS): %i",
+ printf("\tTitle set number (VTS): %i",
tt_srpt->title[i].title_set_nr);
printf("\tVTS_TTN: %i\n", tt_srpt->title[i].vts_ttn);
printf("\tNumber of PTTs: %i\n", tt_srpt->title[i].nr_of_ptts);
- printf("\tNumber of angles: %i\n",
+ printf("\tNumber of angles: %i\n",
tt_srpt->title[i].nr_of_angles);
- printf("\tTitle playback type: (%02x)\n",
+ printf("\tTitle playback type: (%02x)\n",
*(uint8_t *)&(tt_srpt->title[i].pb_ty));
printf("\t\t%s\n",
tt_srpt->title[i].pb_ty.multi_or_random_pgc_title ? "Random or Shuffle" : "Sequencial");
- if (tt_srpt->title[i].pb_ty.jlc_exists_in_cell_cmd) printf("\t\tJump/Link/Call exists in cell cmd\n");
+ if (tt_srpt->title[i].pb_ty.jlc_exists_in_cell_cmd) printf("\t\tJump/Link/Call exists in cell cmd\n");
if (tt_srpt->title[i].pb_ty.jlc_exists_in_prepost_cmd) printf("\t\tJump/Link/Call exists in pre/post cmd\n");
if (tt_srpt->title[i].pb_ty.jlc_exists_in_button_cmd) printf("\t\tJump/Link/Call exists in button cmd\n");
if (tt_srpt->title[i].pb_ty.jlc_exists_in_tt_dom) printf("\t\tJump/Link/Call exists in tt_dom cmd\n");
@@ -817,7 +817,7 @@ void ifo_print_TT_SRPT(tt_srpt_t *tt_srp
printf("\tParental ID field: %04x\n",
tt_srpt->title[i].parental_id);
- printf("\tTitle set starting sector %08x\n",
+ printf("\tTitle set starting sector %08x\n",
tt_srpt->title[i].title_set_sector);
}
}
@@ -825,13 +825,13 @@ void ifo_print_TT_SRPT(tt_srpt_t *tt_srp
void ifo_print_VTS_PTT_SRPT(vts_ptt_srpt_t *vts_ptt_srpt) {
int i, j;
- printf(" nr_of_srpts %i last byte %i\n",
- vts_ptt_srpt->nr_of_srpts,
+ printf(" nr_of_srpts %i last byte %i\n",
+ vts_ptt_srpt->nr_of_srpts,
vts_ptt_srpt->last_byte);
for(i=0;i<vts_ptt_srpt->nr_of_srpts;i++) {
for(j=0;j<vts_ptt_srpt->title[i].nr_of_ptts;j++) {
printf("VTS_PTT_SRPT - Title %3i part %3i: PGC: %3i PG: %3i\n",
- i + 1, j + 1,
+ i + 1, j + 1,
vts_ptt_srpt->title[i].ptt[j].pgcn,
vts_ptt_srpt->title[i].ptt[j].pgn );
}
@@ -846,18 +846,18 @@ static void hexdump(uint8_t *ptr, int le
void ifo_print_PTL_MAIT(ptl_mait_t *ptl_mait) {
int i, j;
-
+
printf("Number of Countries: %i\n", ptl_mait->nr_of_countries);
printf("Number of VTSs: %i\n", ptl_mait->nr_of_vtss);
//printf("Last byte: %i\n", ptl_mait->last_byte);
-
+
for(i = 0; i < ptl_mait->nr_of_countries; i++) {
- printf("Country code: %c%c\n",
+ printf("Country code: %c%c\n",
ptl_mait->countries[i].country_code >> 8,
ptl_mait->countries[i].country_code & 0xff);
/*
- printf("Start byte: %04x %i\n",
- ptl_mait->countries[i].pf_ptl_mai_start_byte,
+ printf("Start byte: %04x %i\n",
+ ptl_mait->countries[i].pf_ptl_mai_start_byte,
ptl_mait->countries[i].pf_ptl_mai_start_byte);
*/
/* This seems to be pointing at a array with 8 2byte fields per VTS
@@ -865,7 +865,7 @@ void ifo_print_PTL_MAIT(ptl_mait_t *ptl_
all the dics I tested so it might be padding to even also.
If it is for the menu it probably the first entry. */
for(j=0;j<8;j++) {
- hexdump( (uint8_t *)ptl_mait->countries - PTL_MAIT_COUNTRY_SIZE
+ hexdump( (uint8_t *)ptl_mait->countries - PTL_MAIT_COUNTRY_SIZE
+ ptl_mait->countries[i].pf_ptl_mai_start_byte
+ j*(ptl_mait->nr_of_vtss+1)*2, (ptl_mait->nr_of_vtss+1)*2);
printf("\n");
@@ -898,16 +898,16 @@ void ifo_print_VTS_TMAPT(vts_tmapt_t *vt
void ifo_print_C_ADT(c_adt_t *c_adt) {
int i, entries;
-
+
printf("Number of VOBs in this VOBS: %i\n", c_adt->nr_of_vobs);
//entries = c_adt->nr_of_vobs;
entries = (c_adt->last_byte + 1 - C_ADT_SIZE)/sizeof(c_adt_t);
-
+
for(i = 0; i < entries; i++) {
- printf("VOB ID: %3i, Cell ID: %3i ",
+ printf("VOB ID: %3i, Cell ID: %3i ",
c_adt->cell_adr_table[i].vob_id, c_adt->cell_adr_table[i].cell_id);
printf("Sector (first): 0x%08x (last): 0x%08x\n",
- c_adt->cell_adr_table[i].start_sector,
+ c_adt->cell_adr_table[i].start_sector,
c_adt->cell_adr_table[i].last_sector);
}
}
@@ -915,7 +915,7 @@ void ifo_print_C_ADT(c_adt_t *c_adt) {
void ifo_print_VOBU_ADMAP(vobu_admap_t *vobu_admap) {
int i, entries;
-
+
entries = (vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE)/4;
for(i = 0; i < entries; i++) {
printf("VOBU %5i First sector: 0x%08x\n", i + 1,
@@ -955,7 +955,7 @@ const char *ifo_print_menu_name(int type
/* pgc_type=1 for menu, 0 for title. */
void ifo_print_PGCIT(pgcit_t *pgcit, int pgc_type) {
int i;
-
+
printf("\nNumber of Program Chains: %3i\n", pgcit->nr_of_pgci_srp);
for(i = 0; i < pgcit->nr_of_pgci_srp; i++) {
printf("\nProgram (PGC): %3i\n", i + 1);
@@ -979,14 +979,14 @@ void ifo_print_PGCIT(pgcit_t *pgcit, int
void ifo_print_PGCI_UT(pgci_ut_t *pgci_ut) {
int i, menu;
-
+
printf("Number of Menu Language Units (PGCI_LU): %3i\n", pgci_ut->nr_of_lus);
for(i = 0; i < pgci_ut->nr_of_lus; i++) {
printf("\nMenu Language Unit %d\n", i+1);
printf("\nMenu Language Code: %c%c\n",
pgci_ut->lu[i].lang_code >> 8,
pgci_ut->lu[i].lang_code & 0xff);
-
+
menu = pgci_ut->lu[i].exists;
printf("Menu Existence: %02x: ", menu);
if (menu == 0) {
@@ -1024,42 +1024,42 @@ void ifo_print_PGCI_UT(pgci_ut_t *pgci_u
static void ifo_print_VTS_ATTRIBUTES(vts_attributes_t *vts_attributes) {
int i;
-
+
printf("VTS_CAT Application type: %08x\n", vts_attributes->vts_cat);
-
+
printf("Video attributes of VTSM_VOBS: ");
ifo_print_video_attributes(5, &vts_attributes->vtsm_vobs_attr);
printf("\n");
- printf("Number of Audio streams: %i\n",
+ printf("Number of Audio streams: %i\n",
vts_attributes->nr_of_vtsm_audio_streams);
if(vts_attributes->nr_of_vtsm_audio_streams > 0) {
printf("\tstream %i attributes: ", 1);
ifo_print_audio_attributes(5, &vts_attributes->vtsm_audio_attr);
printf("\n");
}
- printf("Number of Subpicture streams: %i\n",
+ printf("Number of Subpicture streams: %i\n",
vts_attributes->nr_of_vtsm_subp_streams);
if(vts_attributes->nr_of_vtsm_subp_streams > 0) {
printf("\tstream %2i attributes: ", 1);
ifo_print_subp_attributes(5, &vts_attributes->vtsm_subp_attr);
printf("\n");
}
-
+
printf("Video attributes of VTSTT_VOBS: ");
ifo_print_video_attributes(5, &vts_attributes->vtstt_vobs_video_attr);
printf("\n");
- printf("Number of Audio streams: %i\n",
+ printf("Number of Audio streams: %i\n",
vts_attributes->nr_of_vtstt_audio_streams);
for(i = 0; i < vts_attributes->nr_of_vtstt_audio_streams; i++) {
printf("\tstream %i attributes: ", i);
ifo_print_audio_attributes(5, &vts_attributes->vtstt_audio_attr[i]);
printf("\n");
}
-
- printf("Number of Subpicture streams: %i\n",
+
+ printf("Number of Subpicture streams: %i\n",
vts_attributes->nr_of_vtstt_subp_streams);
for(i = 0; i < vts_attributes->nr_of_vtstt_subp_streams; i++) {
- printf("\tstream %2i attributes: ", i);
+ printf("\tstream %2i attributes: ", i);
ifo_print_subp_attributes(5, &vts_attributes->vtstt_subp_attr[i]);
printf("\n");
}
@@ -1068,7 +1068,7 @@ static void ifo_print_VTS_ATTRIBUTES(vts
void ifo_print_VTS_ATRT(vts_atrt_t *vts_atrt) {
int i;
-
+
printf("Number of Video Title Sets: %3i\n", vts_atrt->nr_of_vtss);
for(i = 0; i < vts_atrt->nr_of_vtss; i++) {
printf("\nVideo Title Set %i\n", i + 1);
@@ -1085,8 +1085,8 @@ void ifo_print(dvd_reader_t *dvd, int ti
fprintf(stderr, "Can't open info file for title %d\n", title);
return;
}
-
-
+
+
if(ifohandle->vmgi_mat) {
printf("VMG top level\n-------------\n");
@@ -1121,7 +1121,7 @@ void ifo_print(dvd_reader_t *dvd, int ti
printf("\nVideo Title Set Attribute Table\n");
printf( "-------------------------------\n");
ifo_print_VTS_ATRT(ifohandle->vts_atrt);
-
+
printf("\nText Data Manager Information\n");
printf( "-----------------------------\n");
if(ifohandle->txtdt_mgi) {
@@ -1143,7 +1143,7 @@ void ifo_print(dvd_reader_t *dvd, int ti
if(ifohandle->menu_vobu_admap) {
ifo_print_VOBU_ADMAP(ifohandle->menu_vobu_admap);
} else {
- printf("No Menu VOBU address map present\n");
+ printf("No Menu VOBU address map present\n");
}
}
@@ -1200,7 +1200,7 @@ void ifo_print(dvd_reader_t *dvd, int ti
printf("\nVideo Title Set VOBU address map\n");
printf( "-----------------\n");
ifo_print_VOBU_ADMAP(ifohandle->vts_vobu_admap);
- }
+ }
ifoClose(ifohandle);
}
Modified: trunk/libdvdread/src/ifo_print.h
==============================================================================
--- trunk/libdvdread/src/ifo_print.h (original)
+++ trunk/libdvdread/src/ifo_print.h Sat Sep 6 23:55:51 2008
@@ -3,12 +3,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Modified: trunk/libdvdread/src/ifo_read.c
==============================================================================
--- trunk/libdvdread/src/ifo_read.c (original)
+++ trunk/libdvdread/src/ifo_read.c Sat Sep 6 23:55:51 2008
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2000, 2001, 2002, 2003
- * Björn Englund <d4bjorn at dtek.chalmers.se>,
+ * Björn Englund <d4bjorn at dtek.chalmers.se>,
* Håkan Hjort <d95hjort at dtek.chalmers.se>
*
* This program is free software; you can redistribute it and/or modify
@@ -62,27 +62,27 @@ static const uint8_t my_friendly_zeros[2
static int ifoRead_VMG(ifo_handle_t *ifofile);
static int ifoRead_VTS(ifo_handle_t *ifofile);
static int ifoRead_PGC(ifo_handle_t *ifofile, pgc_t *pgc, unsigned int offset);
-static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
- pgc_command_tbl_t *cmd_tbl,
+static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
+ pgc_command_tbl_t *cmd_tbl,
unsigned int offset);
-static int ifoRead_PGC_PROGRAM_MAP(ifo_handle_t *ifofile,
- pgc_program_map_t *program_map,
+static int ifoRead_PGC_PROGRAM_MAP(ifo_handle_t *ifofile,
+ pgc_program_map_t *program_map,
unsigned int nr, unsigned int offset);
-static int ifoRead_CELL_PLAYBACK_TBL(ifo_handle_t *ifofile,
- cell_playback_t *cell_playback,
+static int ifoRead_CELL_PLAYBACK_TBL(ifo_handle_t *ifofile,
+ cell_playback_t *cell_playback,
unsigned int nr, unsigned int offset);
-static int ifoRead_CELL_POSITION_TBL(ifo_handle_t *ifofile,
- cell_position_t *cell_position,
+static int ifoRead_CELL_POSITION_TBL(ifo_handle_t *ifofile,
+ cell_position_t *cell_position,
unsigned int nr, unsigned int offset);
-static int ifoRead_VTS_ATTRIBUTES(ifo_handle_t *ifofile,
- vts_attributes_t *vts_attributes,
+static int ifoRead_VTS_ATTRIBUTES(ifo_handle_t *ifofile,
+ vts_attributes_t *vts_attributes,
unsigned int offset);
-static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile, c_adt_t *c_adt,
+static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile, c_adt_t *c_adt,
unsigned int sector);
-static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile,
- vobu_admap_t *vobu_admap,
+static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile,
+ vobu_admap_t *vobu_admap,
unsigned int sector);
-static int ifoRead_PGCIT_internal(ifo_handle_t *ifofile, pgcit_t *pgcit,
+static int ifoRead_PGCIT_internal(ifo_handle_t *ifofile, pgcit_t *pgcit,
unsigned int offset);
static void ifoFree_PGC(pgc_t *pgc);
@@ -119,7 +119,7 @@ static void read_video_attr(video_attr_t
static void read_audio_attr(audio_attr_t *aa) {
getbits_state_t state;
uint8_t buf[sizeof(audio_attr_t)];
-
+
memcpy(buf, aa, sizeof(audio_attr_t));
if (!dvdread_getbits_init(&state, buf)) abort();
aa->audio_format = dvdread_getbits(&state, 3);
@@ -144,7 +144,7 @@ static void read_audio_attr(audio_attr_t
static void read_multichannel_ext(multichannel_ext_t *me) {
getbits_state_t state;
uint8_t buf[sizeof(multichannel_ext_t)];
-
+
memcpy(buf, me, sizeof(multichannel_ext_t));
if (!dvdread_getbits_init(&state, buf)) abort();
me->zero1 = dvdread_getbits(&state, 7);
@@ -171,7 +171,7 @@ static void read_multichannel_ext(multic
static void read_subp_attr(subp_attr_t *sa) {
getbits_state_t state;
uint8_t buf[sizeof(subp_attr_t)];
-
+
memcpy(buf, sa, sizeof(subp_attr_t));
if (!dvdread_getbits_init(&state, buf)) abort();
sa->code_mode = dvdread_getbits(&state, 3);
@@ -186,7 +186,7 @@ static void read_subp_attr(subp_attr_t *
static void read_user_ops(user_ops_t *uo) {
getbits_state_t state;
uint8_t buf[sizeof(user_ops_t)];
-
+
memcpy(buf, uo, sizeof(user_ops_t));
if (!dvdread_getbits_init(&state, buf)) abort();
uo->zero = dvdread_getbits(&state, 7);
@@ -220,7 +220,7 @@ static void read_user_ops(user_ops_t *uo
static void read_pgci_srp(pgci_srp_t *ps) {
getbits_state_t state;
uint8_t buf[sizeof(pgci_srp_t)];
-
+
memcpy(buf, ps, sizeof(pgci_srp_t));
if (!dvdread_getbits_init(&state, buf)) abort();
ps->entry_id = dvdread_getbits(&state, 8);
@@ -234,7 +234,7 @@ static void read_pgci_srp(pgci_srp_t *ps
static void read_cell_playback(cell_playback_t *cp) {
getbits_state_t state;
uint8_t buf[sizeof(cell_playback_t)];
-
+
memcpy(buf, cp, sizeof(cell_playback_t));
if (!dvdread_getbits_init(&state, buf)) abort();
cp->block_mode = dvdread_getbits(&state, 2);
@@ -248,12 +248,12 @@ static void read_cell_playback(cell_play
cp->unknown2 = dvdread_getbits(&state, 6);
cp->still_time = dvdread_getbits(&state, 8);
cp->cell_cmd_nr = dvdread_getbits(&state, 8);
-
+
cp->playback_time.hour = dvdread_getbits(&state, 8);
cp->playback_time.minute = dvdread_getbits(&state, 8);
cp->playback_time.second = dvdread_getbits(&state, 8);
cp->playback_time.frame_u = dvdread_getbits(&state, 8);
-
+
cp->first_sector = dvdread_getbits(&state, 32);
cp->first_ilvu_end_sector = dvdread_getbits(&state, 32);
cp->last_vobu_start_sector = dvdread_getbits(&state, 32);
@@ -263,7 +263,7 @@ static void read_cell_playback(cell_play
static void read_playback_type(playback_type_t *pt) {
getbits_state_t state;
uint8_t buf[sizeof(playback_type_t)];
-
+
memcpy(buf, pt, sizeof(playback_type_t));
if (!dvdread_getbits_init(&state, buf)) abort();
pt->zero_1 = dvdread_getbits(&state, 1);
@@ -399,19 +399,19 @@ ifo_handle_t *ifoOpenVMGI(dvd_reader_t *
ifo_handle_t *ifoOpenVTSI(dvd_reader_t *dvd, int title) {
ifo_handle_t *ifofile;
-
+
ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t));
if(!ifofile)
return NULL;
memset(ifofile, 0, sizeof(ifo_handle_t));
-
+
if(title <= 0 || title > 99) {
fprintf(stderr, "libdvdread: ifoOpenVTSI invalid title (%d).\n", title);
free(ifofile);
return NULL;
}
-
+
ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_FILE);
if(!ifofile->file) /* Should really catch any error and try to fallback */
ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_BACKUP_FILE);
@@ -435,7 +435,7 @@ ifo_handle_t *ifoOpenVTSI(dvd_reader_t *
void ifoClose(ifo_handle_t *ifofile) {
if(!ifofile)
return;
-
+
ifoFree_VOBU_ADMAP(ifofile);
ifoFree_TITLE_VOBU_ADMAP(ifofile);
ifoFree_C_ADT(ifofile);
@@ -489,7 +489,7 @@ static int ifoRead_VMG(ifo_handle_t *ifo
ifofile->vmgi_mat = 0;
return 0;
}
-
+
B2N_32(vmgi_mat->vmg_last_sector);
B2N_32(vmgi_mat->vmgi_last_sector);
B2N_32(vmgi_mat->vmg_category);
@@ -521,7 +521,7 @@ static int ifoRead_VMG(ifo_handle_t *ifo
CHECK_ZERO(vmgi_mat->zero_7);
CHECK_ZERO(vmgi_mat->zero_8);
CHECK_ZERO(vmgi_mat->zero_9);
- CHECK_ZERO(vmgi_mat->zero_10);
+ CHECK_ZERO(vmgi_mat->zero_10);
CHECK_VALUE(vmgi_mat->vmg_last_sector != 0);
CHECK_VALUE(vmgi_mat->vmgi_last_sector != 0);
CHECK_VALUE(vmgi_mat->vmgi_last_sector * 2 <= vmgi_mat->vmg_last_sector);
@@ -532,11 +532,11 @@ static int ifoRead_VMG(ifo_handle_t *ifo
CHECK_VALUE(vmgi_mat->disc_side == 1 || vmgi_mat->disc_side == 2);
CHECK_VALUE(vmgi_mat->vmg_nr_of_title_sets != 0);
CHECK_VALUE(vmgi_mat->vmgi_last_byte >= 341);
- CHECK_VALUE(vmgi_mat->vmgi_last_byte / DVD_BLOCK_LEN <=
+ CHECK_VALUE(vmgi_mat->vmgi_last_byte / DVD_BLOCK_LEN <=
vmgi_mat->vmgi_last_sector);
/* It seems that first_play_pgc is optional. */
CHECK_VALUE(vmgi_mat->first_play_pgc < vmgi_mat->vmgi_last_byte);
- CHECK_VALUE(vmgi_mat->vmgm_vobs == 0 ||
+ CHECK_VALUE(vmgi_mat->vmgm_vobs == 0 ||
(vmgi_mat->vmgm_vobs > vmgi_mat->vmgi_last_sector &&
vmgi_mat->vmgm_vobs < vmgi_mat->vmg_last_sector));
CHECK_VALUE(vmgi_mat->tt_srpt <= vmgi_mat->vmgi_last_sector);
@@ -561,7 +561,7 @@ static int ifoRead_VTS(ifo_handle_t *ifo
vtsi_mat = (vtsi_mat_t *)malloc(sizeof(vtsi_mat_t));
if(!vtsi_mat)
return 0;
-
+
ifofile->vtsi_mat = vtsi_mat;
if(!DVDFileSeek_(ifofile->file, 0)) {
@@ -629,10 +629,10 @@ static int ifoRead_VTS(ifo_handle_t *ifo
CHECK_ZERO(vtsi_mat->zero_21);
CHECK_VALUE(vtsi_mat->vtsi_last_sector*2 <= vtsi_mat->vts_last_sector);
CHECK_VALUE(vtsi_mat->vtsi_last_byte/DVD_BLOCK_LEN <= vtsi_mat->vtsi_last_sector);
- CHECK_VALUE(vtsi_mat->vtsm_vobs == 0 ||
+ CHECK_VALUE(vtsi_mat->vtsm_vobs == 0 ||
(vtsi_mat->vtsm_vobs > vtsi_mat->vtsi_last_sector &&
vtsi_mat->vtsm_vobs < vtsi_mat->vts_last_sector));
- CHECK_VALUE(vtsi_mat->vtstt_vobs == 0 ||
+ CHECK_VALUE(vtsi_mat->vtstt_vobs == 0 ||
(vtsi_mat->vtstt_vobs > vtsi_mat->vtsi_last_sector &&
vtsi_mat->vtstt_vobs < vtsi_mat->vts_last_sector));
CHECK_VALUE(vtsi_mat->vts_ptt_srpt <= vtsi_mat->vtsi_last_sector);
@@ -643,7 +643,7 @@ static int ifoRead_VTS(ifo_handle_t *ifo
CHECK_VALUE(vtsi_mat->vtsm_vobu_admap <= vtsi_mat->vtsi_last_sector);
CHECK_VALUE(vtsi_mat->vts_c_adt <= vtsi_mat->vtsi_last_sector);
CHECK_VALUE(vtsi_mat->vts_vobu_admap <= vtsi_mat->vtsi_last_sector);
-
+
CHECK_VALUE(vtsi_mat->nr_of_vtsm_audio_streams <= 1);
CHECK_VALUE(vtsi_mat->nr_of_vtsm_subp_streams <= 1);
@@ -653,8 +653,8 @@ static int ifoRead_VTS(ifo_handle_t *ifo
CHECK_VALUE(vtsi_mat->nr_of_vts_subp_streams <= 32);
for(i = vtsi_mat->nr_of_vts_subp_streams; i < 32; i++)
- CHECK_ZERO(vtsi_mat->vts_subp_attr[i]);
-
+ CHECK_ZERO(vtsi_mat->vts_subp_attr[i]);
+
for(i = 0; i < 8; i++) {
read_multichannel_ext(&vtsi_mat->vts_mu_audio_attr[i]);
CHECK_ZERO0(vtsi_mat->vts_mu_audio_attr[i].zero1);
@@ -664,17 +664,17 @@ static int ifoRead_VTS(ifo_handle_t *ifo
CHECK_ZERO0(vtsi_mat->vts_mu_audio_attr[i].zero5);
CHECK_ZERO(vtsi_mat->vts_mu_audio_attr[i].zero6);
}
-
+
return 1;
}
-static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
- pgc_command_tbl_t *cmd_tbl,
+static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
+ pgc_command_tbl_t *cmd_tbl,
unsigned int offset) {
-
+
memset(cmd_tbl, 0, sizeof(pgc_command_tbl_t));
-
+
if(!DVDFileSeek_(ifofile->file, offset))
return 0;
@@ -686,7 +686,7 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_h
B2N_16(cmd_tbl->nr_of_cell);
CHECK_VALUE(cmd_tbl->nr_of_pre + cmd_tbl->nr_of_post + cmd_tbl->nr_of_cell<= 255);
-
+
if(cmd_tbl->nr_of_pre != 0) {
unsigned int pre_cmds_size = cmd_tbl->nr_of_pre * COMMAND_DATA_SIZE;
cmd_tbl->pre_cmds = (vm_cmd_t *)malloc(pre_cmds_size);
@@ -698,17 +698,17 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_h
return 0;
}
}
-
+
if(cmd_tbl->nr_of_post != 0) {
unsigned int post_cmds_size = cmd_tbl->nr_of_post * COMMAND_DATA_SIZE;
cmd_tbl->post_cmds = (vm_cmd_t *)malloc(post_cmds_size);
if(!cmd_tbl->post_cmds) {
- if(cmd_tbl->pre_cmds)
+ if(cmd_tbl->pre_cmds)
free(cmd_tbl->pre_cmds);
return 0;
}
if(!(DVDReadBytes(ifofile->file, cmd_tbl->post_cmds, post_cmds_size))) {
- if(cmd_tbl->pre_cmds)
+ if(cmd_tbl->pre_cmds)
free(cmd_tbl->pre_cmds);
free(cmd_tbl->post_cmds);
return 0;
@@ -726,16 +726,16 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_h
return 0;
}
if(!(DVDReadBytes(ifofile->file, cmd_tbl->cell_cmds, cell_cmds_size))) {
- if(cmd_tbl->pre_cmds)
+ if(cmd_tbl->pre_cmds)
free(cmd_tbl->pre_cmds);
- if(cmd_tbl->post_cmds)
+ if(cmd_tbl->post_cmds)
free(cmd_tbl->post_cmds);
free(cmd_tbl->cell_cmds);
return 0;
}
}
-
- /*
+
+ /*
* Make a run over all the commands and see that we can interpret them all?
*/
return 1;
@@ -754,21 +754,21 @@ static void ifoFree_PGC_COMMAND_TBL(pgc_
}
}
-static int ifoRead_PGC_PROGRAM_MAP(ifo_handle_t *ifofile,
- pgc_program_map_t *program_map,
+static int ifoRead_PGC_PROGRAM_MAP(ifo_handle_t *ifofile,
+ pgc_program_map_t *program_map,
unsigned int nr, unsigned int offset) {
unsigned int size = nr * sizeof(pgc_program_map_t);
if(!DVDFileSeek_(ifofile->file, offset))
return 0;
-
+
if(!(DVDReadBytes(ifofile->file, program_map, size)))
return 0;
return 1;
}
-static int ifoRead_CELL_PLAYBACK_TBL(ifo_handle_t *ifofile,
+static int ifoRead_CELL_PLAYBACK_TBL(ifo_handle_t *ifofile,
cell_playback_t *cell_playback,
unsigned int nr, unsigned int offset) {
unsigned int i;
@@ -783,9 +783,9 @@ static int ifoRead_CELL_PLAYBACK_TBL(ifo
for(i = 0; i < nr; i++) {
read_cell_playback(&cell_playback[i]);
/* Changed < to <= because this was false in the movie 'Pi'. */
- CHECK_VALUE(cell_playback[i].last_vobu_start_sector <=
+ CHECK_VALUE(cell_playback[i].last_vobu_start_sector <=
cell_playback[i].last_sector);
- CHECK_VALUE(cell_playback[i].first_sector <=
+ CHECK_VALUE(cell_playback[i].first_sector <=
cell_playback[i].last_vobu_start_sector);
}
@@ -793,8 +793,8 @@ static int ifoRead_CELL_PLAYBACK_TBL(ifo
}
-static int ifoRead_CELL_POSITION_TBL(ifo_handle_t *ifofile,
- cell_position_t *cell_position,
+static int ifoRead_CELL_POSITION_TBL(ifo_handle_t *ifofile,
+ cell_position_t *cell_position,
unsigned int nr, unsigned int offset) {
unsigned int i;
unsigned int size = nr * sizeof(cell_position_t);
@@ -818,7 +818,7 @@ static int ifoRead_PGC(ifo_handle_t *ifo
if(!DVDFileSeek_(ifofile->file, offset))
return 0;
-
+
if(!(DVDReadBytes(ifofile->file, pgc, PGC_SIZE)))
return 0;
@@ -837,7 +837,7 @@ static int ifoRead_PGC(ifo_handle_t *ifo
B2N_32(pgc->subp_control[i]);
for(i = 0; i < 16; i++)
B2N_32(pgc->palette[i]);
-
+
CHECK_ZERO(pgc->zero_1);
CHECK_VALUE(pgc->nr_of_programs <= pgc->nr_of_cells);
@@ -848,7 +848,7 @@ static int ifoRead_PGC(ifo_handle_t *ifo
for(i = 0; i < 32; i++)
if(!pgc->subp_control[i] & 0x80000000) /* The 'is present' bit */
CHECK_ZERO(pgc->subp_control[i]);
-
+
/* Check that time is 0:0:0:0 also if nr_of_programs == 0 */
if(pgc->nr_of_programs == 0) {
CHECK_ZERO(pgc->still_time);
@@ -861,13 +861,13 @@ static int ifoRead_PGC(ifo_handle_t *ifo
CHECK_VALUE(pgc->cell_playback_offset != 0);
CHECK_VALUE(pgc->cell_position_offset != 0);
}
-
+
if(pgc->command_tbl_offset != 0) {
pgc->command_tbl = malloc(sizeof(pgc_command_tbl_t));
if(!pgc->command_tbl)
return 0;
- if(!ifoRead_PGC_COMMAND_TBL(ifofile, pgc->command_tbl,
+ if(!ifoRead_PGC_COMMAND_TBL(ifofile, pgc->command_tbl,
offset + pgc->command_tbl_offset)) {
free(pgc->command_tbl);
return 0;
@@ -875,7 +875,7 @@ static int ifoRead_PGC(ifo_handle_t *ifo
} else {
pgc->command_tbl = NULL;
}
-
+
if(pgc->program_map_offset != 0 && pgc->nr_of_programs>0) {
pgc->program_map = malloc(pgc->nr_of_programs * sizeof(pgc_program_map_t));
if(!pgc->program_map) {
@@ -891,7 +891,7 @@ static int ifoRead_PGC(ifo_handle_t *ifo
} else {
pgc->program_map = NULL;
}
-
+
if(pgc->cell_playback_offset != 0 && pgc->nr_of_cells>0) {
pgc->cell_playback = malloc(pgc->nr_of_cells * sizeof(cell_playback_t));
if(!pgc->cell_playback) {
@@ -900,7 +900,7 @@ static int ifoRead_PGC(ifo_handle_t *ifo
free(pgc->program_map);
return 0;
}
- if(!ifoRead_CELL_PLAYBACK_TBL(ifofile, pgc->cell_playback,
+ if(!ifoRead_CELL_PLAYBACK_TBL(ifofile, pgc->cell_playback,
pgc->nr_of_cells,
offset + pgc->cell_playback_offset)) {
ifoFree_PGC_COMMAND_TBL(pgc->command_tbl);
@@ -912,14 +912,14 @@ static int ifoRead_PGC(ifo_handle_t *ifo
} else {
pgc->cell_playback = NULL;
}
-
+
if(pgc->cell_position_offset != 0 && pgc->nr_of_cells>0) {
pgc->cell_position = malloc(pgc->nr_of_cells * sizeof(cell_position_t));
if(!pgc->cell_position) {
ifoFree_PGC(pgc);
return 0;
}
- if(!ifoRead_CELL_POSITION_TBL(ifofile, pgc->cell_position,
+ if(!ifoRead_CELL_POSITION_TBL(ifofile, pgc->cell_position,
pgc->nr_of_cells,
offset + pgc->cell_position_offset)) {
ifoFree_PGC(pgc);
@@ -939,17 +939,17 @@ int ifoRead_FP_PGC(ifo_handle_t *ifofile
if(!ifofile->vmgi_mat)
return 0;
-
+
/* It seems that first_play_pgc is optional after all. */
ifofile->first_play_pgc = 0;
if(ifofile->vmgi_mat->first_play_pgc == 0)
return 1;
-
+
ifofile->first_play_pgc = (pgc_t *)malloc(sizeof(pgc_t));
if(!ifofile->first_play_pgc)
return 0;
-
- if(!ifoRead_PGC(ifofile, ifofile->first_play_pgc,
+
+ if(!ifoRead_PGC(ifofile, ifofile->first_play_pgc,
ifofile->vmgi_mat->first_play_pgc)) {
free(ifofile->first_play_pgc);
ifofile->first_play_pgc = 0;
@@ -974,7 +974,7 @@ static void ifoFree_PGC(pgc_t *pgc) {
void ifoFree_FP_PGC(ifo_handle_t *ifofile) {
if(!ifofile)
return;
-
+
if(ifofile->first_play_pgc) {
ifoFree_PGC(ifofile->first_play_pgc);
free(ifofile->first_play_pgc);
@@ -1004,7 +1004,7 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofil
return 0;
ifofile->tt_srpt = tt_srpt;
-
+
if(!(DVDReadBytes(ifofile->file, tt_srpt, TT_SRPT_SIZE))) {
fprintf(stderr, "libdvdread: Unable to read read TT_SRPT.\n");
free(tt_srpt);
@@ -1013,10 +1013,10 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofil
B2N_16(tt_srpt->nr_of_srpts);
B2N_32(tt_srpt->last_byte);
-
+
info_length = tt_srpt->last_byte + 1 - TT_SRPT_SIZE;
- tt_srpt->title = (title_info_t *)malloc(info_length);
+ tt_srpt->title = (title_info_t *)malloc(info_length);
if(!tt_srpt->title) {
free(tt_srpt);
ifofile->tt_srpt = 0;
@@ -1033,13 +1033,13 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofil
B2N_16(tt_srpt->title[i].parental_id);
B2N_32(tt_srpt->title[i].title_set_sector);
}
-
+
CHECK_ZERO(tt_srpt->zero_1);
CHECK_VALUE(tt_srpt->nr_of_srpts != 0);
CHECK_VALUE(tt_srpt->nr_of_srpts < 100); /* ?? */
CHECK_VALUE((int)tt_srpt->nr_of_srpts * sizeof(title_info_t) <= info_length);
-
+
for(i = 0; i < tt_srpt->nr_of_srpts; i++) {
read_playback_type(&tt_srpt->title[i].pb_ty);
CHECK_VALUE(tt_srpt->title[i].pb_ty.zero_1 == 0);
@@ -1054,16 +1054,16 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofil
CHECK_VALUE(tt_srpt->title[i].vts_ttn < 100); /* ?? */
/* CHECK_VALUE(tt_srpt->title[i].title_set_sector != 0); */
}
-
+
/* Make this a function */
#if 0
- if(memcmp((uint8_t *)tt_srpt->title +
- tt_srpt->nr_of_srpts * sizeof(title_info_t),
- my_friendly_zeros,
+ if(memcmp((uint8_t *)tt_srpt->title +
+ tt_srpt->nr_of_srpts * sizeof(title_info_t),
+ my_friendly_zeros,
info_length - tt_srpt->nr_of_srpts * sizeof(title_info_t))) {
fprintf(stderr, "VMG_PTT_SRPT slack is != 0, ");
- hexdump((uint8_t *)tt_srpt->title +
- tt_srpt->nr_of_srpts * sizeof(title_info_t),
+ hexdump((uint8_t *)tt_srpt->title +
+ tt_srpt->nr_of_srpts * sizeof(title_info_t),
info_length - tt_srpt->nr_of_srpts * sizeof(title_info_t));
}
#endif
@@ -1075,7 +1075,7 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofil
void ifoFree_TT_SRPT(ifo_handle_t *ifofile) {
if(!ifofile)
return;
-
+
if(ifofile->tt_srpt) {
free(ifofile->tt_srpt->title);
free(ifofile->tt_srpt);
@@ -1091,13 +1091,13 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *i
if(!ifofile)
return 0;
-
+
if(!ifofile->vtsi_mat)
return 0;
if(ifofile->vtsi_mat->vts_ptt_srpt == 0) /* mandatory */
return 0;
-
+
if(!DVDFileSeek_(ifofile->file,
ifofile->vtsi_mat->vts_ptt_srpt * DVD_BLOCK_LEN))
return 0;
@@ -1120,10 +1120,10 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *i
CHECK_ZERO(vts_ptt_srpt->zero_1);
CHECK_VALUE(vts_ptt_srpt->nr_of_srpts != 0);
CHECK_VALUE(vts_ptt_srpt->nr_of_srpts < 100); /* ?? */
-
+
info_length = vts_ptt_srpt->last_byte + 1 - VTS_PTT_SRPT_SIZE;
-
- data = (uint32_t *)malloc(info_length);
+
+ data = (uint32_t *)malloc(info_length);
if(!data) {
free(vts_ptt_srpt);
ifofile->vts_ptt_srpt = 0;
@@ -1140,14 +1140,14 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *i
for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) {
B2N_32(data[i]);
/* assert(data[i] + sizeof(ptt_info_t) <= vts_ptt_srpt->last_byte + 1);
- Magic Knight Rayearth Daybreak is mastered very strange and has
+ Magic Knight Rayearth Daybreak is mastered very strange and has
Titles with 0 PTTs. They all have a data[i] offsets beyond the end of
of the vts_ptt_srpt structure. */
CHECK_VALUE(data[i] + sizeof(ptt_info_t) <= vts_ptt_srpt->last_byte + 1 + 4);
}
-
+
vts_ptt_srpt->ttu_offset = data;
-
+
vts_ptt_srpt->title = malloc(vts_ptt_srpt->nr_of_srpts * sizeof(ttu_t));
if(!vts_ptt_srpt->title) {
free(vts_ptt_srpt);
@@ -1162,11 +1162,11 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *i
else
n = (vts_ptt_srpt->last_byte + 1 - data[i]);
/* assert(n > 0 && (n % 4) == 0);
- Magic Knight Rayearth Daybreak is mastered very strange and has
+ Magic Knight Rayearth Daybreak is mastered very strange and has
Titles with 0 PTTs. */
if(n < 0) n = 0;
CHECK_VALUE(n % 4 == 0);
-
+
vts_ptt_srpt->title[i].nr_of_ptts = n / 4;
vts_ptt_srpt->title[i].ptt = malloc(n * sizeof(ptt_info_t));
if(!vts_ptt_srpt->title[i].ptt) {
@@ -1180,20 +1180,20 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *i
for(j = 0; j < vts_ptt_srpt->title[i].nr_of_ptts; j++) {
/* The assert placed here because of Magic Knight Rayearth Daybreak */
CHECK_VALUE(data[i] + sizeof(ptt_info_t) <= vts_ptt_srpt->last_byte + 1);
- vts_ptt_srpt->title[i].ptt[j].pgcn
+ vts_ptt_srpt->title[i].ptt[j].pgcn
= *(uint16_t*)(((char *)data) + data[i] + 4*j - VTS_PTT_SRPT_SIZE);
- vts_ptt_srpt->title[i].ptt[j].pgn
+ vts_ptt_srpt->title[i].ptt[j].pgn
= *(uint16_t*)(((char *)data) + data[i] + 4*j + 2 - VTS_PTT_SRPT_SIZE);
}
}
-
+
for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) {
for(j = 0; j < vts_ptt_srpt->title[i].nr_of_ptts; j++) {
B2N_16(vts_ptt_srpt->title[i].ptt[j].pgcn);
B2N_16(vts_ptt_srpt->title[i].ptt[j].pgn);
}
}
-
+
for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) {
CHECK_VALUE(vts_ptt_srpt->title[i].nr_of_ptts < 1000); /* ?? */
for(j = 0; j < vts_ptt_srpt->title[i].nr_of_ptts; j++) {
@@ -1211,7 +1211,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *i
void ifoFree_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
if(!ifofile)
return;
-
+
if(ifofile->vts_ptt_srpt) {
int i;
for(i = 0; i < ifofile->vts_ptt_srpt->nr_of_srpts; i++)
@@ -1231,10 +1231,10 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofi
if(!ifofile)
return 0;
-
+
if(!ifofile->vmgi_mat)
return 0;
-
+
if(ifofile->vmgi_mat->ptl_mait == 0)
return 1;
@@ -1256,14 +1256,14 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofi
B2N_16(ptl_mait->nr_of_countries);
B2N_16(ptl_mait->nr_of_vtss);
B2N_32(ptl_mait->last_byte);
-
+
CHECK_VALUE(ptl_mait->nr_of_countries != 0);
CHECK_VALUE(ptl_mait->nr_of_countries < 100); /* ?? */
CHECK_VALUE(ptl_mait->nr_of_vtss != 0);
CHECK_VALUE(ptl_mait->nr_of_vtss < 100); /* ?? */
- CHECK_VALUE(ptl_mait->nr_of_countries * PTL_MAIT_COUNTRY_SIZE
+ CHECK_VALUE(ptl_mait->nr_of_countries * PTL_MAIT_COUNTRY_SIZE
<= ptl_mait->last_byte + 1 - PTL_MAIT_SIZE);
-
+
info_length = ptl_mait->nr_of_countries * sizeof(ptl_mait_country_t);
ptl_mait->countries = (ptl_mait_country_t *)malloc(info_length);
if(!ptl_mait->countries) {
@@ -1271,7 +1271,7 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofi
ifofile->ptl_mait = 0;
return 0;
}
-
+
for(i = 0; i < ptl_mait->nr_of_countries; i++) {
if(!(DVDReadBytes(ifofile->file, &ptl_mait->countries[i], PTL_MAIT_COUNTRY_SIZE))) {
fprintf(stderr, "libdvdread: Unable to read PTL_MAIT.\n");
@@ -1286,18 +1286,18 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofi
B2N_16(ptl_mait->countries[i].country_code);
B2N_16(ptl_mait->countries[i].pf_ptl_mai_start_byte);
}
-
+
for(i = 0; i < ptl_mait->nr_of_countries; i++) {
CHECK_ZERO(ptl_mait->countries[i].zero_1);
- CHECK_ZERO(ptl_mait->countries[i].zero_2);
+ CHECK_ZERO(ptl_mait->countries[i].zero_2);
CHECK_VALUE(ptl_mait->countries[i].pf_ptl_mai_start_byte
+ 8*2 * (ptl_mait->nr_of_vtss + 1) <= ptl_mait->last_byte + 1);
}
for(i = 0; i < ptl_mait->nr_of_countries; i++) {
uint16_t *pf_temp;
-
- if(!DVDFileSeek_(ifofile->file,
+
+ if(!DVDFileSeek_(ifofile->file,
ifofile->vmgi_mat->ptl_mait * DVD_BLOCK_LEN
+ ptl_mait->countries[i].pf_ptl_mai_start_byte)) {
fprintf(stderr, "libdvdread: Unable to seak PTL_MAIT table.\n");
@@ -1342,10 +1342,10 @@ int ifoRead_PTL_MAIT(ifo_handle_t *ifofi
void ifoFree_PTL_MAIT(ifo_handle_t *ifofile) {
unsigned int i;
-
+
if(!ifofile)
return;
-
+
if(ifofile->ptl_mait) {
for(i = 0; i < ifofile->ptl_mait->nr_of_countries; i++) {
free(ifofile->ptl_mait->countries[i].pf_ptl_mai);
@@ -1362,7 +1362,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifof
unsigned int offset;
int info_length;
unsigned int i, j;
-
+
if(!ifofile)
return 0;
@@ -1374,18 +1374,18 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifof
fprintf(stderr,"Please send bug report - no VTS_TMAPT ?? \n");
return 1;
}
-
+
offset = ifofile->vtsi_mat->vts_tmapt * DVD_BLOCK_LEN;
-
- if(!DVDFileSeek_(ifofile->file, offset))
+
+ if(!DVDFileSeek_(ifofile->file, offset))
return 0;
-
+
vts_tmapt = (vts_tmapt_t *)malloc(sizeof(vts_tmapt_t));
if(!vts_tmapt)
return 0;
-
+
ifofile->vts_tmapt = vts_tmapt;
-
+
if(!(DVDReadBytes(ifofile->file, vts_tmapt, VTS_TMAPT_SIZE))) {
fprintf(stderr, "libdvdread: Unable to read VTS_TMAPT.\n");
free(vts_tmapt);
@@ -1395,11 +1395,11 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifof
B2N_16(vts_tmapt->nr_of_tmaps);
B2N_32(vts_tmapt->last_byte);
-
+
CHECK_ZERO(vts_tmapt->zero_1);
-
+
info_length = vts_tmapt->nr_of_tmaps * 4;
-
+
vts_tmap_srp = (uint32_t *)malloc(info_length);
if(!vts_tmap_srp) {
free(vts_tmapt);
@@ -1408,7 +1408,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifof
}
vts_tmapt->tmap_offset = vts_tmap_srp;
-
+
if(!(DVDReadBytes(ifofile->file, vts_tmap_srp, info_length))) {
fprintf(stderr, "libdvdread: Unable to read VTS_TMAPT.\n");
free(vts_tmap_srp);
@@ -1418,12 +1418,12 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifof
}
for (i = 0; i < vts_tmapt->nr_of_tmaps; i++) {
- B2N_32(vts_tmap_srp[i]);
+ B2N_32(vts_tmap_srp[i]);
}
-
+
info_length = vts_tmapt->nr_of_tmaps * sizeof(vts_tmap_t);
-
+
vts_tmapt->tmap = (vts_tmap_t *)malloc(info_length);
if(!vts_tmapt->tmap) {
free(vts_tmap_srp);
@@ -1433,7 +1433,7 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifof
}
memset(vts_tmapt->tmap, 0, info_length); /* So ifoFree_VTS_TMAPT works. */
-
+
for(i = 0; i < vts_tmapt->nr_of_tmaps; i++) {
if(!DVDFileSeek_(ifofile->file, offset + vts_tmap_srp[i])) {
ifoFree_VTS_TMAPT(ifofile);
@@ -1445,17 +1445,17 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifof
ifoFree_VTS_TMAPT(ifofile);
return 0;
}
-
+
B2N_16(vts_tmapt->tmap[i].nr_of_entries);
CHECK_ZERO(vts_tmapt->tmap[i].zero_1);
-
+
if(vts_tmapt->tmap[i].nr_of_entries == 0) { /* Early out if zero entries */
vts_tmapt->tmap[i].map_ent = NULL;
continue;
}
-
+
info_length = vts_tmapt->tmap[i].nr_of_entries * sizeof(map_ent_t);
-
+
vts_tmapt->tmap[i].map_ent = (map_ent_t *)malloc(info_length);
if(!vts_tmapt->tmap[i].map_ent) {
ifoFree_VTS_TMAPT(ifofile);
@@ -1467,21 +1467,21 @@ int ifoRead_VTS_TMAPT(ifo_handle_t *ifof
ifoFree_VTS_TMAPT(ifofile);
return 0;
}
-
+
for(j = 0; j < vts_tmapt->tmap[i].nr_of_entries; j++)
B2N_32(vts_tmapt->tmap[i].map_ent[j]);
- }
-
+ }
+
return 1;
}
void ifoFree_VTS_TMAPT(ifo_handle_t *ifofile) {
unsigned int i;
-
+
if(!ifofile)
return;
-
- if(ifofile->vts_tmapt) {
+
+ if(ifofile->vts_tmapt) {
for(i = 0; i < ifofile->vts_tmapt->nr_of_tmaps; i++)
if(ifofile->vts_tmapt->tmap[i].map_ent)
free(ifofile->vts_tmapt->tmap[i].map_ent);
@@ -1508,7 +1508,7 @@ int ifoRead_TITLE_C_ADT(ifo_handle_t *if
if(!ifofile->vts_c_adt)
return 0;
- if(!ifoRead_C_ADT_internal(ifofile, ifofile->vts_c_adt,
+ if(!ifoRead_C_ADT_internal(ifofile, ifofile->vts_c_adt,
ifofile->vtsi_mat->vts_c_adt)) {
free(ifofile->vts_c_adt);
ifofile->vts_c_adt = 0;
@@ -1523,7 +1523,7 @@ int ifoRead_C_ADT(ifo_handle_t *ifofile)
if(!ifofile)
return 0;
-
+
if(ifofile->vmgi_mat) {
if(ifofile->vmgi_mat->vmgm_c_adt == 0)
return 1;
@@ -1535,7 +1535,7 @@ int ifoRead_C_ADT(ifo_handle_t *ifofile)
} else {
return 0;
}
-
+
ifofile->menu_c_adt = (c_adt_t *)malloc(sizeof(c_adt_t));
if(!ifofile->menu_c_adt)
return 0;
@@ -1549,7 +1549,7 @@ int ifoRead_C_ADT(ifo_handle_t *ifofile)
return 1;
}
-static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile,
+static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile,
c_adt_t *c_adt, unsigned int sector) {
int i, info_length;
@@ -1561,15 +1561,15 @@ static int ifoRead_C_ADT_internal(ifo_ha
B2N_16(c_adt->nr_of_vobs);
B2N_32(c_adt->last_byte);
-
+
info_length = c_adt->last_byte + 1 - C_ADT_SIZE;
-
+
CHECK_ZERO(c_adt->zero_1);
- /* assert(c_adt->nr_of_vobs > 0);
- Magic Knight Rayearth Daybreak is mastered very strange and has
+ /* assert(c_adt->nr_of_vobs > 0);
+ Magic Knight Rayearth Daybreak is mastered very strange and has
Titles with a VOBS that has no cells. */
CHECK_VALUE(info_length % sizeof(cell_adr_t) == 0);
-
+
/* assert(info_length / sizeof(cell_adr_t) >= c_adt->nr_of_vobs);
Enemy of the State region 2 (de) has Titles where nr_of_vobs field
is to high, they high ones are never referenced though. */
@@ -1577,12 +1577,12 @@ static int ifoRead_C_ADT_internal(ifo_ha
fprintf(stderr, "libdvdread: *C_ADT nr_of_vobs > avaiable info entries\n");
c_adt->nr_of_vobs = info_length / sizeof(cell_adr_t);
}
-
+
c_adt->cell_adr_table = (cell_adr_t *)malloc(info_length);
if(!c_adt->cell_adr_table)
return 0;
- if(info_length &&
+ if(info_length &&
!(DVDReadBytes(ifofile->file, c_adt->cell_adr_table, info_length))) {
free(c_adt->cell_adr_table);
return 0;
@@ -1597,7 +1597,7 @@ static int ifoRead_C_ADT_internal(ifo_ha
CHECK_VALUE(c_adt->cell_adr_table[i].vob_id > 0);
CHECK_VALUE(c_adt->cell_adr_table[i].vob_id <= c_adt->nr_of_vobs);
CHECK_VALUE(c_adt->cell_adr_table[i].cell_id > 0);
- CHECK_VALUE(c_adt->cell_adr_table[i].start_sector <
+ CHECK_VALUE(c_adt->cell_adr_table[i].start_sector <
c_adt->cell_adr_table[i].last_sector);
}
@@ -1615,7 +1615,7 @@ static void ifoFree_C_ADT_internal(c_adt
void ifoFree_C_ADT(ifo_handle_t *ifofile) {
if(!ifofile)
return;
-
+
ifoFree_C_ADT_internal(ifofile->menu_c_adt);
ifofile->menu_c_adt = 0;
}
@@ -1623,7 +1623,7 @@ void ifoFree_C_ADT(ifo_handle_t *ifofile
void ifoFree_TITLE_C_ADT(ifo_handle_t *ifofile) {
if(!ifofile)
return;
-
+
ifoFree_C_ADT_internal(ifofile->vts_c_adt);
ifofile->vts_c_adt = 0;
}
@@ -1634,10 +1634,10 @@ int ifoRead_TITLE_VOBU_ADMAP(ifo_handle_
if(!ifofile->vtsi_mat)
return 0;
-
+
if(ifofile->vtsi_mat->vts_vobu_admap == 0) /* mandatory */
return 0;
-
+
ifofile->vts_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t));
if(!ifofile->vts_vobu_admap)
return 0;
@@ -1657,7 +1657,7 @@ int ifoRead_VOBU_ADMAP(ifo_handle_t *ifo
if(!ifofile)
return 0;
-
+
if(ifofile->vmgi_mat) {
if(ifofile->vmgi_mat->vmgm_vobu_admap == 0)
return 1;
@@ -1669,11 +1669,11 @@ int ifoRead_VOBU_ADMAP(ifo_handle_t *ifo
} else {
return 0;
}
-
+
ifofile->menu_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t));
if(!ifofile->menu_vobu_admap)
return 0;
-
+
if(!ifoRead_VOBU_ADMAP_internal(ifofile, ifofile->menu_vobu_admap, sector)) {
free(ifofile->menu_vobu_admap);
ifofile->menu_vobu_admap = 0;
@@ -1683,8 +1683,8 @@ int ifoRead_VOBU_ADMAP(ifo_handle_t *ifo
return 1;
}
-static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile,
- vobu_admap_t *vobu_admap,
+static int ifoRead_VOBU_ADMAP_internal(ifo_handle_t *ifofile,
+ vobu_admap_t *vobu_admap,
unsigned int sector) {
unsigned int i;
int info_length;
@@ -1696,19 +1696,19 @@ static int ifoRead_VOBU_ADMAP_internal(i
return 0;
B2N_32(vobu_admap->last_byte);
-
+
info_length = vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE;
/* assert(info_length > 0);
- Magic Knight Rayearth Daybreak is mastered very strange and has
+ Magic Knight Rayearth Daybreak is mastered very strange and has
Titles with a VOBS that has no VOBUs. */
CHECK_VALUE(info_length % sizeof(uint32_t) == 0);
-
- vobu_admap->vobu_start_sectors = (uint32_t *)malloc(info_length);
+
+ vobu_admap->vobu_start_sectors = (uint32_t *)malloc(info_length);
if(!vobu_admap->vobu_start_sectors) {
return 0;
}
- if(info_length &&
- !(DVDReadBytes(ifofile->file,
+ if(info_length &&
+ !(DVDReadBytes(ifofile->file,
vobu_admap->vobu_start_sectors, info_length))) {
free(vobu_admap->vobu_start_sectors);
return 0;
@@ -1731,7 +1731,7 @@ static void ifoFree_VOBU_ADMAP_internal(
void ifoFree_VOBU_ADMAP(ifo_handle_t *ifofile) {
if(!ifofile)
return;
-
+
ifoFree_VOBU_ADMAP_internal(ifofile->menu_vobu_admap);
ifofile->menu_vobu_admap = 0;
}
@@ -1739,7 +1739,7 @@ void ifoFree_VOBU_ADMAP(ifo_handle_t *if
void ifoFree_TITLE_VOBU_ADMAP(ifo_handle_t *ifofile) {
if(!ifofile)
return;
-
+
ifoFree_VOBU_ADMAP_internal(ifofile->vts_vobu_admap);
ifofile->vts_vobu_admap = 0;
}
@@ -1748,18 +1748,18 @@ int ifoRead_PGCIT(ifo_handle_t *ifofile)
if(!ifofile)
return 0;
-
+
if(!ifofile->vtsi_mat)
return 0;
-
+
if(ifofile->vtsi_mat->vts_pgcit == 0) /* mandatory */
return 0;
-
+
ifofile->vts_pgcit = (pgcit_t *)malloc(sizeof(pgcit_t));
if(!ifofile->vts_pgcit)
return 0;
- if(!ifoRead_PGCIT_internal(ifofile, ifofile->vts_pgcit,
+ if(!ifoRead_PGCIT_internal(ifofile, ifofile->vts_pgcit,
ifofile->vtsi_mat->vts_pgcit * DVD_BLOCK_LEN)) {
free(ifofile->vts_pgcit);
ifofile->vts_pgcit = 0;
@@ -1769,11 +1769,11 @@ int ifoRead_PGCIT(ifo_handle_t *ifofile)
return 1;
}
-static int ifoRead_PGCIT_internal(ifo_handle_t *ifofile, pgcit_t *pgcit,
+static int ifoRead_PGCIT_internal(ifo_handle_t *ifofile, pgcit_t *pgcit,
unsigned int offset) {
int i, info_length;
uint8_t *data, *ptr;
-
+
if(!DVDFileSeek_(ifofile->file, offset))
return 0;
@@ -1782,13 +1782,13 @@ static int ifoRead_PGCIT_internal(ifo_ha
B2N_16(pgcit->nr_of_pgci_srp);
B2N_32(pgcit->last_byte);
-
+
CHECK_ZERO(pgcit->zero_1);
/* assert(pgcit->nr_of_pgci_srp != 0);
- Magic Knight Rayearth Daybreak is mastered very strange and has
+ Magic Knight Rayearth Daybreak is mastered very strange and has
Titles with 0 PTTs. */
CHECK_VALUE(pgcit->nr_of_pgci_srp < 10000); /* ?? seen max of 1338 */
-
+
info_length = pgcit->nr_of_pgci_srp * PGCI_SRP_SIZE;
data = malloc(info_length);
if(!data)
@@ -1812,10 +1812,10 @@ static int ifoRead_PGCIT_internal(ifo_ha
CHECK_VALUE(pgcit->pgci_srp[i].unknown1 == 0);
}
free(data);
-
+
for(i = 0; i < pgcit->nr_of_pgci_srp; i++)
CHECK_VALUE(pgcit->pgci_srp[i].pgc_start_byte + PGC_SIZE <= pgcit->last_byte+1);
-
+
for(i = 0; i < pgcit->nr_of_pgci_srp; i++) {
pgcit->pgci_srp[i].pgc = malloc(sizeof(pgc_t));
if(!pgcit->pgci_srp[i].pgc) {
@@ -1826,7 +1826,7 @@ static int ifoRead_PGCIT_internal(ifo_ha
}
goto fail;
}
- if(!ifoRead_PGC(ifofile, pgcit->pgci_srp[i].pgc,
+ if(!ifoRead_PGC(ifofile, pgcit->pgci_srp[i].pgc,
offset + pgcit->pgci_srp[i].pgc_start_byte)) {
int j;
for(j = 0; j < i; j++) {
@@ -1856,7 +1856,7 @@ static void ifoFree_PGCIT_internal(pgcit
void ifoFree_PGCIT(ifo_handle_t *ifofile) {
if(!ifofile)
return;
-
+
if(ifofile->vts_pgcit) {
ifoFree_PGCIT_internal(ifofile->vts_pgcit);
free(ifofile->vts_pgcit);
@@ -1868,13 +1868,13 @@ void ifoFree_PGCIT(ifo_handle_t *ifofile
int ifoRead_PGCI_UT(ifo_handle_t *ifofile) {
pgci_ut_t *pgci_ut;
unsigned int sector;
- unsigned int i;
+ unsigned int i;
int info_length;
uint8_t *data, *ptr;
if(!ifofile)
return 0;
-
+
if(ifofile->vmgi_mat) {
if(ifofile->vmgi_mat->vmgm_pgci_ut == 0)
return 1;
@@ -1886,28 +1886,28 @@ int ifoRead_PGCI_UT(ifo_handle_t *ifofil
} else {
return 0;
}
-
+
ifofile->pgci_ut = (pgci_ut_t *)malloc(sizeof(pgci_ut_t));
if(!ifofile->pgci_ut)
return 0;
-
+
if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN)) {
free(ifofile->pgci_ut);
ifofile->pgci_ut = 0;
return 0;
}
-
+
if(!(DVDReadBytes(ifofile->file, ifofile->pgci_ut, PGCI_UT_SIZE))) {
free(ifofile->pgci_ut);
ifofile->pgci_ut = 0;
return 0;
}
-
+
pgci_ut = ifofile->pgci_ut;
-
+
B2N_16(pgci_ut->nr_of_lus);
B2N_32(pgci_ut->last_byte);
-
+
CHECK_ZERO(pgci_ut->zero_1);
CHECK_VALUE(pgci_ut->nr_of_lus != 0);
CHECK_VALUE(pgci_ut->nr_of_lus < 100); /* ?? 3-4 ? */
@@ -1938,11 +1938,11 @@ int ifoRead_PGCI_UT(ifo_handle_t *ifofil
for(i = 0; i < pgci_ut->nr_of_lus; i++) {
memcpy(&pgci_ut->lu[i], ptr, PGCI_LU_SIZE);
ptr += PGCI_LU_SIZE;
- B2N_16(pgci_ut->lu[i].lang_code);
- B2N_32(pgci_ut->lu[i].lang_start_byte);
+ B2N_16(pgci_ut->lu[i].lang_code);
+ B2N_32(pgci_ut->lu[i].lang_start_byte);
}
free(data);
-
+
for(i = 0; i < pgci_ut->nr_of_lus; i++) {
/* Maybe this is only defined for v1.1 and later titles? */
/* If the bits in 'lu[i].exists' are enumerated abcd efgh then:
@@ -1969,8 +1969,8 @@ int ifoRead_PGCI_UT(ifo_handle_t *ifofil
ifofile->pgci_ut = 0;
return 0;
}
- if(!ifoRead_PGCIT_internal(ifofile, pgci_ut->lu[i].pgcit,
- sector * DVD_BLOCK_LEN
+ if(!ifoRead_PGCIT_internal(ifofile, pgci_ut->lu[i].pgcit,
+ sector * DVD_BLOCK_LEN
+ pgci_ut->lu[i].lang_start_byte)) {
unsigned int j;
for(j = 0; j < i; j++) {
@@ -1998,7 +1998,7 @@ void ifoFree_PGCI_UT(ifo_handle_t *ifofi
if(!ifofile)
return;
-
+
if(ifofile->pgci_ut) {
for(i = 0; i < ifofile->pgci_ut->nr_of_lus; i++) {
ifoFree_PGCIT_internal(ifofile->pgci_ut->lu[i].pgcit);
@@ -2010,8 +2010,8 @@ void ifoFree_PGCI_UT(ifo_handle_t *ifofi
}
}
-static int ifoRead_VTS_ATTRIBUTES(ifo_handle_t *ifofile,
- vts_attributes_t *vts_attributes,
+static int ifoRead_VTS_ATTRIBUTES(ifo_handle_t *ifofile,
+ vts_attributes_t *vts_attributes,
unsigned int offset) {
unsigned int i;
@@ -2031,7 +2031,7 @@ static int ifoRead_VTS_ATTRIBUTES(ifo_ha
read_subp_attr(&vts_attributes->vtstt_subp_attr[i]);
B2N_32(vts_attributes->last_byte);
B2N_32(vts_attributes->vts_cat);
-
+
CHECK_ZERO(vts_attributes->zero_1);
CHECK_ZERO(vts_attributes->zero_2);
CHECK_ZERO(vts_attributes->zero_3);
@@ -2047,7 +2047,7 @@ static int ifoRead_VTS_ATTRIBUTES(ifo_ha
CHECK_VALUE(vts_attributes->nr_of_vtstt_subp_streams <= 32);
{
unsigned int nr_coded;
- CHECK_VALUE(vts_attributes->last_byte + 1 >= VTS_ATTRIBUTES_MIN_SIZE);
+ CHECK_VALUE(vts_attributes->last_byte + 1 >= VTS_ATTRIBUTES_MIN_SIZE);
nr_coded = (vts_attributes->last_byte + 1 - VTS_ATTRIBUTES_MIN_SIZE)/6;
/* This is often nr_coded = 70, how do you know how many there really are? */
if(nr_coded > 32) { /* We haven't read more from disk/file anyway */
@@ -2070,13 +2070,13 @@ int ifoRead_VTS_ATRT(ifo_handle_t *ifofi
if(!ifofile)
return 0;
-
+
if(!ifofile->vmgi_mat)
return 0;
-
+
if(ifofile->vmgi_mat->vts_atrt == 0) /* mandatory */
return 0;
-
+
sector = ifofile->vmgi_mat->vts_atrt;
if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN))
return 0;
@@ -2086,7 +2086,7 @@ int ifoRead_VTS_ATRT(ifo_handle_t *ifofi
return 0;
ifofile->vts_atrt = vts_atrt;
-
+
if(!(DVDReadBytes(ifofile->file, vts_atrt, VTS_ATRT_SIZE))) {
free(vts_atrt);
ifofile->vts_atrt = 0;
@@ -2099,7 +2099,7 @@ int ifoRead_VTS_ATRT(ifo_handle_t *ifofi
CHECK_ZERO(vts_atrt->zero_1);
CHECK_VALUE(vts_atrt->nr_of_vtss != 0);
CHECK_VALUE(vts_atrt->nr_of_vtss < 100); /* ?? */
- CHECK_VALUE((uint32_t)vts_atrt->nr_of_vtss * (4 + VTS_ATTRIBUTES_MIN_SIZE) +
+ CHECK_VALUE((uint32_t)vts_atrt->nr_of_vtss * (4 + VTS_ATTRIBUTES_MIN_SIZE) +
VTS_ATRT_SIZE < vts_atrt->last_byte + 1);
info_length = vts_atrt->nr_of_vtss * sizeof(uint32_t);
@@ -2110,7 +2110,7 @@ int ifoRead_VTS_ATRT(ifo_handle_t *ifofi
return 0;
}
- vts_atrt->vts_atrt_offsets = data;
+ vts_atrt->vts_atrt_offsets = data;
if(!(DVDReadBytes(ifofile->file, data, info_length))) {
free(data);
@@ -2118,12 +2118,12 @@ int ifoRead_VTS_ATRT(ifo_handle_t *ifofi
ifofile->vts_atrt = 0;
return 0;
}
-
+
for(i = 0; i < vts_atrt->nr_of_vtss; i++) {
B2N_32(data[i]);
CHECK_VALUE(data[i] + VTS_ATTRIBUTES_MIN_SIZE < vts_atrt->last_byte + 1);
}
-
+
info_length = vts_atrt->nr_of_vtss * sizeof(vts_attributes_t);
vts_atrt->vts = (vts_attributes_t *)malloc(info_length);
if(!vts_atrt->vts) {
@@ -2154,7 +2154,7 @@ int ifoRead_VTS_ATRT(ifo_handle_t *ifofi
void ifoFree_VTS_ATRT(ifo_handle_t *ifofile) {
if(!ifofile)
return;
-
+
if(ifofile->vts_atrt) {
free(ifofile->vts_atrt->vts);
free(ifofile->vts_atrt->vts_atrt_offsets);
@@ -2169,18 +2169,18 @@ int ifoRead_TXTDT_MGI(ifo_handle_t *ifof
if(!ifofile)
return 0;
-
+
if(!ifofile->vmgi_mat)
return 0;
-
- /* Return successfully if there is nothing to read. */
+
+ /* Return successfully if there is nothing to read. */
if(ifofile->vmgi_mat->txtdt_mgi == 0)
return 1;
- if(!DVDFileSeek_(ifofile->file,
+ if(!DVDFileSeek_(ifofile->file,
ifofile->vmgi_mat->txtdt_mgi * DVD_BLOCK_LEN))
return 0;
-
+
txtdt_mgi = (txtdt_mgi_t *)malloc(sizeof(txtdt_mgi_t));
if(!txtdt_mgi) {
return 0;
@@ -2201,7 +2201,7 @@ int ifoRead_TXTDT_MGI(ifo_handle_t *ifof
void ifoFree_TXTDT_MGI(ifo_handle_t *ifofile) {
if(!ifofile)
return;
-
+
if(ifofile->txtdt_mgi) {
free(ifofile->txtdt_mgi);
ifofile->txtdt_mgi = 0;
Modified: trunk/libdvdread/src/ifo_read.h
==============================================================================
--- trunk/libdvdread/src/ifo_read.h (original)
+++ trunk/libdvdread/src/ifo_read.h Sat Sep 6 23:55:51 2008
@@ -136,7 +136,7 @@ int ifoRead_PGCIT(ifo_handle_t *);
* VTSI files, this fills the ifofile->vtsm_pgci_ut structure.
*/
int ifoRead_PGCI_UT(ifo_handle_t *);
-
+
/**
* okay = ifoRead_VTS_TMAPT(ifofile);
*
@@ -146,7 +146,7 @@ int ifoRead_PGCI_UT(ifo_handle_t *);
* seeking for One_Sequential_PGC_Titles.
*/
int ifoRead_VTS_TMAPT(ifo_handle_t *);
-
+
/**
* okay = ifoRead_C_ADT(ifofile);
*
Modified: trunk/libdvdread/src/ifo_types.h
==============================================================================
--- trunk/libdvdread/src/ifo_types.h (original)
+++ trunk/libdvdread/src/ifo_types.h Sat Sep 6 23:55:51 2008
@@ -25,7 +25,7 @@
#undef ATTRIBUTE_PACKED
-#undef PRAGMA_PACK_BEGIN
+#undef PRAGMA_PACK_BEGIN
#undef PRAGMA_PACK_END
#if defined(__GNUC__)
@@ -79,12 +79,12 @@ typedef struct {
unsigned char video_format : 2;
unsigned char display_aspect_ratio : 2;
unsigned char permitted_df : 2;
-
+
unsigned char line21_cc_1 : 1;
unsigned char line21_cc_2 : 1;
unsigned char unknown1 : 1;
unsigned char bit_rate : 1;
-
+
unsigned char picture_size : 2;
unsigned char letterboxed : 1;
unsigned char film_mode : 1;
@@ -98,7 +98,7 @@ typedef struct {
unsigned char multichannel_extension : 1;
unsigned char lang_type : 2;
unsigned char application_mode : 2;
-
+
unsigned char quantization : 2;
unsigned char sample_frequency : 2;
unsigned char unknown1 : 1;
@@ -182,7 +182,7 @@ typedef struct {
/**
* PGC Command Table.
- */
+ */
typedef struct {
uint16_t nr_of_pre;
uint16_t nr_of_post;
@@ -197,7 +197,7 @@ typedef struct {
/**
* PGC Program Map
*/
-typedef uint8_t pgc_program_map_t;
+typedef uint8_t pgc_program_map_t;
/**
* Cell Playback Information.
@@ -244,7 +244,7 @@ typedef struct {
typedef struct {
unsigned int zero : 7; /* 25-31 */
unsigned int video_pres_mode_change : 1; /* 24 */
-
+
unsigned int karaoke_audio_pres_mode_change : 1; /* 23 */
unsigned int angle_change : 1;
unsigned int subpic_stream_change : 1;
@@ -253,7 +253,7 @@ typedef struct {
unsigned int still_off : 1;
unsigned int button_select_or_activate : 1;
unsigned int resume : 1; /* 16 */
-
+
unsigned int chapter_menu_call : 1; /* 15 */
unsigned int angle_menu_call : 1;
unsigned int audio_menu_call : 1;
@@ -262,7 +262,7 @@ typedef struct {
unsigned int title_menu_call : 1;
unsigned int backward_scan : 1;
unsigned int forward_scan : 1; /* 8 */
-
+
unsigned int next_pg_search : 1; /* 7 */
unsigned int prev_or_top_pg_search : 1;
unsigned int time_or_chapter_search : 1;
@@ -420,7 +420,7 @@ typedef struct {
uint32_t vmgm_c_adt; /* sector */
uint32_t vmgm_vobu_admap; /* sector */
uint8_t zero_6[32];
-
+
video_attr_t vmgm_video_attr;
uint8_t zero_7;
uint8_t nr_of_vmgm_audio_streams; /* should be 0 or 1 */
@@ -503,20 +503,20 @@ typedef struct {
typedef struct {
uint32_t last_byte;
uint32_t vts_cat;
-
+
video_attr_t vtsm_vobs_attr;
uint8_t zero_1;
uint8_t nr_of_vtsm_audio_streams; /* should be 0 or 1 */
audio_attr_t vtsm_audio_attr;
- audio_attr_t zero_2[7];
+ audio_attr_t zero_2[7];
uint8_t zero_3[16];
uint8_t zero_4;
uint8_t nr_of_vtsm_subp_streams; /* should be 0 or 1 */
subp_attr_t vtsm_subp_attr;
subp_attr_t zero_5[27];
-
+
uint8_t zero_6[2];
-
+
video_attr_t vtstt_vobs_video_attr;
uint8_t zero_7;
uint8_t nr_of_vtstt_audio_streams;
@@ -547,10 +547,10 @@ typedef struct {
typedef struct {
uint32_t last_byte; /* offsets are relative here */
uint16_t offsets[100]; /* == nr_of_srpts + 1 (first is disc title) */
-#if 0
+#if 0
uint16_t unknown; /* 0x48 ?? 0x48 words (16bit) info following */
uint16_t zero_1;
-
+
uint8_t type_of_info; /* ?? 01 == disc, 02 == Title, 04 == Title part */
uint8_t unknown1;
uint8_t unknown2;
@@ -558,14 +558,14 @@ typedef struct {
uint8_t unknown4; /* ?? allways 0x30 language?, text format? */
uint8_t unknown5;
uint16_t offset; /* from first */
-
+
char text[12]; /* ended by 0x09 */
#endif
} ATTRIBUTE_PACKED txtdt_t;
/**
* Text Data Language Unit. (Incomplete)
- */
+ */
typedef struct {
uint16_t lang_code;
uint16_t unknown; /* 0x0001, title 1? disc 1? side 1? */
@@ -625,7 +625,7 @@ typedef struct {
uint32_t vts_c_adt; /* sector */
uint32_t vts_vobu_admap; /* sector */
uint8_t zero_13[24];
-
+
video_attr_t vtsm_video_attr;
uint8_t zero_14;
uint8_t nr_of_vtsm_audio_streams; /* should be 0 or 1 */
@@ -636,7 +636,7 @@ typedef struct {
subp_attr_t vtsm_subp_attr;
subp_attr_t zero_17[27];
uint8_t zero_18[2];
-
+
video_attr_t vts_video_attr;
uint8_t zero_19;
uint8_t nr_of_vts_audio_streams;
@@ -721,20 +721,20 @@ typedef struct {
*/
typedef struct {
dvd_file_t *file;
-
+
/* VMGI */
vmgi_mat_t *vmgi_mat;
tt_srpt_t *tt_srpt;
- pgc_t *first_play_pgc;
+ pgc_t *first_play_pgc;
ptl_mait_t *ptl_mait;
vts_atrt_t *vts_atrt;
txtdt_mgi_t *txtdt_mgi;
-
+
/* Common */
pgci_ut_t *pgci_ut;
c_adt_t *menu_c_adt;
vobu_admap_t *menu_vobu_admap;
-
+
/* VTSI */
vtsi_mat_t *vtsi_mat;
vts_ptt_srpt_t *vts_ptt_srpt;
Modified: trunk/libdvdread/src/nav_print.c
==============================================================================
--- trunk/libdvdread/src/nav_print.c (original)
+++ trunk/libdvdread/src/nav_print.c Sat Sep 6 23:55:51 2008
@@ -45,7 +45,7 @@ static void navPrint_PCI_GI(pci_gi_t *pc
printf("e_eltm ");
dvdread_print_time(&pci_gi->e_eltm);
printf("\n");
-
+
printf("vobu_isrc \"");
for(i = 0; i < 32; i++) {
char c = pci_gi->vobu_isrc[i];
@@ -59,24 +59,24 @@ static void navPrint_PCI_GI(pci_gi_t *pc
static void navPrint_NSML_AGLI(nsml_agli_t *nsml_agli) {
int i, j = 0;
-
+
for(i = 0; i < 9; i++)
j |= nsml_agli->nsml_agl_dsta[i];
if(j == 0)
return;
-
+
printf("nsml_agli:\n");
for(i = 0; i < 9; i++)
if(nsml_agli->nsml_agl_dsta[i])
- printf("nsml_agl_c%d_dsta 0x%08x\n", i + 1,
+ printf("nsml_agl_c%d_dsta 0x%08x\n", i + 1,
nsml_agli->nsml_agl_dsta[i]);
}
static void navPrint_HL_GI(hl_gi_t *hl_gi, int *btngr_ns, int *btn_ns) {
-
+
if((hl_gi->hli_ss & 0x03) == 0)
return;
-
+
printf("hl_gi:\n");
printf("hli_ss 0x%01x\n", hl_gi->hli_ss & 0x03);
printf("hli_s_ptm 0x%08x\n", hl_gi->hli_s_ptm);
@@ -88,7 +88,7 @@ static void navPrint_HL_GI(hl_gi_t *hl_g
printf("btngr%d_dsp_ty 0x%02x\n", 1, hl_gi->btngr1_dsp_ty);
printf("btngr%d_dsp_ty 0x%02x\n", 2, hl_gi->btngr2_dsp_ty);
printf("btngr%d_dsp_ty 0x%02x\n", 3, hl_gi->btngr3_dsp_ty);
-
+
printf("btn_ofn %d\n", hl_gi->btn_ofn);
*btn_ns = hl_gi->btn_ns;
printf("btn_ns %d\n", hl_gi->btn_ns);
@@ -99,13 +99,13 @@ static void navPrint_HL_GI(hl_gi_t *hl_g
static void navPrint_BTN_COLIT(btn_colit_t *btn_colit) {
int i, j;
-
+
j = 0;
for(i = 0; i < 6; i++)
j |= btn_colit->btn_coli[i/2][i&1];
if(j == 0)
return;
-
+
printf("btn_colit:\n");
for(i = 0; i < 3; i++)
for(j = 0; j < 2; j++)
@@ -116,30 +116,30 @@ static void navPrint_BTN_COLIT(btn_colit
static void navPrint_BTNIT(btni_t *btni_table, int btngr_ns, int btn_ns) {
int i, j;
-
+
printf("btnit:\n");
printf("btngr_ns: %i\n", btngr_ns);
printf("btn_ns: %i\n", btn_ns);
-
+
if(btngr_ns == 0)
return;
-
+
for(i = 0; i < btngr_ns; i++) {
for(j = 0; j < (36 / btngr_ns); j++) {
if(j < btn_ns) {
btni_t *btni = &btni_table[(36 / btngr_ns) * i + j];
-
+
printf("group %d btni %d: ", i+1, j+1);
printf("btn_coln %d, auto_action_mode %d\n",
btni->btn_coln, btni->auto_action_mode);
printf("coords (%d, %d) .. (%d, %d)\n",
btni->x_start, btni->y_start, btni->x_end, btni->y_end);
-
+
printf("up %d, ", btni->up);
printf("down %d, ", btni->down);
printf("left %d, ", btni->left);
printf("right %d\n", btni->right);
-
+
/* ifoPrint_COMMAND(&btni->cmd); */
printf("\n");
}
@@ -149,7 +149,7 @@ static void navPrint_BTNIT(btni_t *btni_
static void navPrint_HLI(hli_t *hli) {
int btngr_ns = 0, btn_ns = 0;
-
+
printf("hli:\n");
navPrint_HL_GI(&hli->hl_gi, & btngr_ns, & btn_ns);
navPrint_BTN_COLIT(&hli->btn_colit);
@@ -189,14 +189,14 @@ static void navPrint_SML_PBI(sml_pbi_t *
printf("VOBU at the beginning of ILVU\n");
if(sml_pbi->category & 0x1000)
printf("VOBU at end of PREU of ILVU\n");
-
+
printf("ilvu_ea 0x%08x\n", sml_pbi->ilvu_ea);
printf("nxt_ilvu_sa 0x%08x\n", sml_pbi->ilvu_sa);
printf("nxt_ilvu_size 0x%04x\n", sml_pbi->size);
-
+
printf("vob_v_s_s_ptm 0x%08x\n", sml_pbi->vob_v_s_s_ptm);
printf("vob_v_e_e_ptm 0x%08x\n", sml_pbi->vob_v_e_e_ptm);
-
+
/* $$$ more code needed here */
}
@@ -211,7 +211,7 @@ static void navPrint_SML_AGLI(sml_agli_t
static void navPrint_VOBU_SRI(vobu_sri_t *vobu_sri) {
int i;
- int stime[19] = { 240, 120, 60, 20, 15, 14, 13, 12, 11,
+ int stime[19] = { 240, 120, 60, 20, 15, 14, 13, 12, 11,
10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
printf("vobu_sri:\n");
printf("Next VOBU with Video %08x\n", vobu_sri->next_video);
@@ -231,7 +231,7 @@ static void navPrint_VOBU_SRI(vobu_sri_t
static void navPrint_SYNCI(synci_t *synci) {
int i;
-
+
printf("synci:\n");
/* $$$ more code needed here */
for(i = 0; i < 8; i++)
Modified: trunk/libdvdread/src/nav_print.h
==============================================================================
--- trunk/libdvdread/src/nav_print.h (original)
+++ trunk/libdvdread/src/nav_print.h Sat Sep 6 23:55:51 2008
@@ -36,7 +36,7 @@ extern "C" {
* @param pci Pointer to the PCI data structure to be printed.
*/
void navPrint_PCI(pci_t *);
-
+
/**
* Prints information contained in the DSI to stdout.
*
Modified: trunk/libdvdread/src/nav_read.c
==============================================================================
--- trunk/libdvdread/src/nav_read.c (original)
+++ trunk/libdvdread/src/nav_read.c Sat Sep 6 23:55:51 2008
@@ -44,7 +44,7 @@ void navRead_PCI(pci_t *pci, unsigned ch
pci->pci_gi.vobu_uop_ctl.zero = getbits(&state, 7 );
pci->pci_gi.vobu_uop_ctl.video_pres_mode_change = getbits(&state, 1 );
- pci->pci_gi.vobu_uop_ctl.karaoke_audio_pres_mode_change = getbits(&state, 1 );
+ pci->pci_gi.vobu_uop_ctl.karaoke_audio_pres_mode_change = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.angle_change = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.subpic_stream_change = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.audio_stream_change = getbits(&state, 1 );
@@ -53,7 +53,7 @@ void navRead_PCI(pci_t *pci, unsigned ch
pci->pci_gi.vobu_uop_ctl.button_select_or_activate = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.resume = getbits(&state, 1 );
- pci->pci_gi.vobu_uop_ctl.chapter_menu_call = getbits(&state, 1 );
+ pci->pci_gi.vobu_uop_ctl.chapter_menu_call = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.angle_menu_call = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.audio_menu_call = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.subpic_menu_call = getbits(&state, 1 );
@@ -62,7 +62,7 @@ void navRead_PCI(pci_t *pci, unsigned ch
pci->pci_gi.vobu_uop_ctl.backward_scan = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.forward_scan = getbits(&state, 1 );
- pci->pci_gi.vobu_uop_ctl.next_pg_search = getbits(&state, 1 );
+ pci->pci_gi.vobu_uop_ctl.next_pg_search = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.prev_or_top_pg_search = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.time_or_chapter_search = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.go_up = getbits(&state, 1 );
@@ -70,9 +70,9 @@ void navRead_PCI(pci_t *pci, unsigned ch
pci->pci_gi.vobu_uop_ctl.title_play = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.chapter_search_or_play = getbits(&state, 1 );
pci->pci_gi.vobu_uop_ctl.title_or_time_play = getbits(&state, 1 );
- pci->pci_gi.vobu_s_ptm = getbits(&state, 32 );
- pci->pci_gi.vobu_e_ptm = getbits(&state, 32 );
- pci->pci_gi.vobu_se_e_ptm = getbits(&state, 32 );
+ pci->pci_gi.vobu_s_ptm = getbits(&state, 32 );
+ pci->pci_gi.vobu_e_ptm = getbits(&state, 32 );
+ pci->pci_gi.vobu_se_e_ptm = getbits(&state, 32 );
pci->pci_gi.e_eltm.hour = getbits(&state, 8 );
pci->pci_gi.e_eltm.minute = getbits(&state, 8 );
pci->pci_gi.e_eltm.second = getbits(&state, 8 );
@@ -86,7 +86,7 @@ void navRead_PCI(pci_t *pci, unsigned ch
/* pci hli hli_gi */
pci->hli.hl_gi.hli_ss = getbits(&state, 16 );
- pci->hli.hl_gi.hli_s_ptm = getbits(&state, 32 );
+ pci->hli.hl_gi.hli_s_ptm = getbits(&state, 32 );
pci->hli.hl_gi.hli_e_ptm = getbits(&state, 32 );
pci->hli.hl_gi.btn_se_e_ptm = getbits(&state, 32 );
pci->hli.hl_gi.zero1 = getbits(&state, 2 );
@@ -99,7 +99,7 @@ void navRead_PCI(pci_t *pci, unsigned ch
pci->hli.hl_gi.btngr3_dsp_ty = getbits(&state, 3 );
pci->hli.hl_gi.btn_ofn = getbits(&state, 8 );
pci->hli.hl_gi.btn_ns = getbits(&state, 8 );
- pci->hli.hl_gi.nsl_btn_ns = getbits(&state, 8 );
+ pci->hli.hl_gi.nsl_btn_ns = getbits(&state, 8 );
pci->hli.hl_gi.zero5 = getbits(&state, 8 );
pci->hli.hl_gi.fosl_btnn = getbits(&state, 8 );
pci->hli.hl_gi.foac_btnn = getbits(&state, 8 );
@@ -107,11 +107,11 @@ void navRead_PCI(pci_t *pci, unsigned ch
/* pci hli btn_colit */
for(i = 0; i < 3; i++)
for(j = 0; j < 2; j++)
- pci->hli.btn_colit.btn_coli[i][j] = getbits(&state, 32 );
+ pci->hli.btn_colit.btn_coli[i][j] = getbits(&state, 32 );
/* NOTE: I've had to change the structure from the disk layout to get
* the packing to work with Sun's Forte C compiler. */
-
+
/* pci hli btni */
for(i = 0; i < 36; i++) {
pci->hli.btnit[i].btn_coln = getbits(&state, 2 );
@@ -142,7 +142,7 @@ void navRead_PCI(pci_t *pci, unsigned ch
#ifndef NDEBUG
/* Asserts */
- /* pci pci gi */
+ /* pci pci gi */
CHECK_VALUE(pci->pci_gi.zero1 == 0);
/* pci hli hli_gi */
@@ -154,10 +154,10 @@ void navRead_PCI(pci_t *pci, unsigned ch
/* Are there buttons defined here? */
if((pci->hli.hl_gi.hli_ss & 0x03) != 0) {
- CHECK_VALUE(pci->hli.hl_gi.btn_ns != 0);
- CHECK_VALUE(pci->hli.hl_gi.btngr_ns != 0);
+ CHECK_VALUE(pci->hli.hl_gi.btn_ns != 0);
+ CHECK_VALUE(pci->hli.hl_gi.btngr_ns != 0);
} else {
- CHECK_VALUE((pci->hli.hl_gi.btn_ns != 0 && pci->hli.hl_gi.btngr_ns != 0)
+ CHECK_VALUE((pci->hli.hl_gi.btn_ns != 0 && pci->hli.hl_gi.btngr_ns != 0)
|| (pci->hli.hl_gi.btn_ns == 0 && pci->hli.hl_gi.btngr_ns == 0));
}
@@ -171,8 +171,8 @@ void navRead_PCI(pci_t *pci, unsigned ch
CHECK_VALUE(pci->hli.btnit[n].zero4 == 0);
CHECK_VALUE(pci->hli.btnit[n].zero5 == 0);
CHECK_VALUE(pci->hli.btnit[n].zero6 == 0);
-
- if (j < pci->hli.hl_gi.btn_ns) {
+
+ if (j < pci->hli.hl_gi.btn_ns) {
CHECK_VALUE(pci->hli.btnit[n].x_start <= pci->hli.btnit[n].x_end);
CHECK_VALUE(pci->hli.btnit[n].y_start <= pci->hli.btnit[n].y_end);
CHECK_VALUE(pci->hli.btnit[n].up <= pci->hli.hl_gi.btn_ns);
@@ -256,7 +256,7 @@ void navRead_DSI(dsi_t *dsi, unsigned ch
for(i = 0; i < 32; i++)
dsi->synci.sp_synca[i] = getbits(&state, 32 );
-
+
/* Asserts */
/* dsi dsi gi */
Modified: trunk/libdvdread/src/nav_read.h
==============================================================================
--- trunk/libdvdread/src/nav_read.h (original)
+++ trunk/libdvdread/src/nav_read.h Sat Sep 6 23:55:51 2008
@@ -31,15 +31,15 @@ extern "C" {
/**
* Reads the PCI packet data pointed to into th pci struct.
- *
+ *
* @param pci Pointer to the PCI data structure to be filled in.
* @param bufffer Pointer to the buffer of the on disc PCI data.
- */
+ */
void navRead_PCI(pci_t *, unsigned char *);
/**
* Reads the DSI packet data pointed to into dsi struct.
- *
+ *
* @param dsi Pointer to the DSI data structure to be filled in.
* @param bufffer Pointer to the buffer of the on disc DSI data.
*/
Modified: trunk/libdvdread/src/nav_types.h
==============================================================================
--- trunk/libdvdread/src/nav_types.h (original)
+++ trunk/libdvdread/src/nav_types.h Sat Sep 6 23:55:51 2008
@@ -43,7 +43,7 @@
#define DSI_START_BYTE 1031
/**
- * PCI General Information
+ * PCI General Information
*/
typedef struct {
uint32_t nv_pck_lbn; /**< sector address of this nav pack */
@@ -64,8 +64,8 @@ typedef struct {
uint32_t nsml_agl_dsta[9]; /**< address of destination vobu in AGL_C#n */
} ATTRIBUTE_PACKED nsml_agli_t;
-/**
- * Highlight General Information
+/**
+ * Highlight General Information
*
* For btngrX_dsp_ty the bits have the following meaning:
* 000b: normal 4/3 only buttons
@@ -87,7 +87,7 @@ typedef struct {
unsigned int zero4 : 1; /**< reserved */
unsigned int btngr3_dsp_ty : 3; /**< display type of subpic stream for button group 3 */
uint8_t btn_ofn; /**< button offset number range 0-255 */
- uint8_t btn_ns; /**< number of valid buttons <= 36/18/12 (low 6 bits) */
+ uint8_t btn_ns; /**< number of valid buttons <= 36/18/12 (low 6 bits) */
uint8_t nsl_btn_ns; /**< number of buttons selectable by U_BTNNi (low 6 bits) nsl_btn_ns <= btn_ns */
uint8_t zero5; /**< reserved */
uint8_t fosl_btnn; /**< forcedly selected button (low 6 bits) */
@@ -95,8 +95,8 @@ typedef struct {
} ATTRIBUTE_PACKED hl_gi_t;
-/**
- * Button Color Information Table
+/**
+ * Button Color Information Table
* Each entry beeing a 32bit word that contains the color indexs and alpha
* values to use. They are all represented by 4 bit number and stored
* like this [Ci3, Ci2, Ci1, Ci0, A3, A2, A1, A0]. The actual palette
@@ -107,7 +107,7 @@ typedef struct {
uint32_t btn_coli[3][2]; /**< [button color number-1][select:0/action:1] */
} ATTRIBUTE_PACKED btn_colit_t;
-/**
+/**
* Button Information
*
* NOTE: I've had to change the structure from the disk layout to get
@@ -137,7 +137,7 @@ typedef struct {
} ATTRIBUTE_PACKED btni_t;
/**
- * Highlight Information
+ * Highlight Information
*/
typedef struct {
hl_gi_t hl_gi;
@@ -159,7 +159,7 @@ typedef struct {
/**
- * DSI General Information
+ * DSI General Information
*/
typedef struct {
uint32_t nv_pck_scr;
@@ -188,7 +188,7 @@ typedef struct {
uint32_t stp_ptm1;
uint32_t stp_ptm2;
uint32_t gap_len1;
- uint32_t gap_len2;
+ uint32_t gap_len2;
} vob_a[8];
} ATTRIBUTE_PACKED sml_pbi_t;
@@ -208,7 +208,7 @@ typedef struct {
} ATTRIBUTE_PACKED sml_agli_t;
/**
- * VOBU Search Information
+ * VOBU Search Information
*/
typedef struct {
uint32_t next_video; /**< Next vobu that contains video */
@@ -223,7 +223,7 @@ typedef struct {
/**
* Synchronous Information
- */
+ */
typedef struct {
uint16_t a_synca[8]; /**< offset to first audio packet for this VOBU */
uint32_t sp_synca[32]; /**< offset to first subpicture packet */
More information about the DVDnav-discuss
mailing list