Author: robux4
Date: 2004-09-19 11:33:25 +0400 (Sun, 19 Sep 2004)
New Revision: 830
Modified:
trunk/DvdMenuXtractor/libdvdread/config.h.in
trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c
trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c
trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.c
trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_print.c
trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c
trunk/DvdMenuXtractor/libdvdread/win32/config.h
trunk/DvdMenuXtractor/libdvdread/win32/libdvdread.vcproj
Log:
clean the error logging
Modified: trunk/DvdMenuXtractor/libdvdread/config.h.in
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/config.h.in 2004-09-18 21:03:05 UTC (rev 829)
+++ trunk/DvdMenuXtractor/libdvdread/config.h.in 2004-09-19 07:33:25 UTC (rev 830)
@@ -104,9 +104,6 @@
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
-#define O_BINARY 0
-
#ifndef LOG_ERROR
-#define LOG_ERROR internal_error
-extern int internal_error(const char*format, ...);
+#define LOG_ERROR fprintf
#endif
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c 2004-09-18 21:03:05 UTC (rev 829)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c 2004-09-19 07:33:25 UTC (rev 830)
@@ -70,6 +70,10 @@
};
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
/**
* initialize and open a DVD device or file.
*/
@@ -80,14 +84,14 @@
/* Allocate the handle structure */
dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s));
if(dev == NULL) {
- LOG_ERROR( "libdvdread: Could not allocate memory.\n");
+ LOG_ERROR( stderr, "libdvdread: Could not allocate memory.\n");
return NULL;
}
/* Really open it with libdvdcss */
dev->dvdcss = DVDcss_open(target);
if(dev->dvdcss == 0) {
- LOG_ERROR( "libdvdread: Could not open %s with libdvdcss.\n", target);
+ LOG_ERROR( stderr, "libdvdread: Could not open %s with libdvdcss.\n", target);
free(dev);
return NULL;
}
@@ -160,7 +164,7 @@
/* Allocate the library structure */
dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s));
if(dev == NULL) {
- LOG_ERROR( "libdvdread: Could not allocate memory.\n");
+ LOG_ERROR( stderr, "libdvdread: Could not allocate memory.\n");
return NULL;
}
@@ -310,7 +314,7 @@
dvdcss_version = (char **)dlsym(dvdcss_library, U_S "dvdcss_interface_2");
if(dlsym(dvdcss_library, U_S "dvdcss_crack")) {
- LOG_ERROR(
+ LOG_ERROR( 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" );
@@ -318,7 +322,7 @@
dvdcss_library = NULL;
} else if(!DVDcss_open || !DVDcss_close || !DVDcss_title || !DVDcss_seek
|| !DVDcss_read || !DVDcss_error || !dvdcss_version) {
- LOG_ERROR( "libdvdread: Missing symbols in libdvdcss.so.2, "
+ LOG_ERROR( stderr, "libdvdread: Missing symbols in libdvdcss.so.2, "
"this shouldn't happen !\n");
dlclose(dvdcss_library);
}
@@ -329,10 +333,10 @@
/*
char *psz_method = getenv( "DVDCSS_METHOD" );
char *psz_verbose = getenv( "DVDCSS_VERBOSE" );
- LOG_ERROR( "DVDCSS_METHOD %s\n", psz_method);
- LOG_ERROR( "DVDCSS_VERBOSE %s\n", psz_verbose);
+ LOG_ERROR( stderr, "DVDCSS_METHOD %s\n", psz_method);
+ LOG_ERROR( stderr, "DVDCSS_VERBOSE %s\n", psz_verbose);
*/
- LOG_ERROR( "libdvdread: Using libdvdcss version %s for DVD access\n",
+ LOG_ERROR( stderr, "libdvdread: Using libdvdcss version %s for DVD access\n",
*dvdcss_version);
/* libdvdcss wrapper functions */
@@ -345,7 +349,7 @@
return 1;
} else {
- LOG_ERROR( "libdvdread: Encrypted DVD support unavailable.\n");
+ LOG_ERROR( stderr, "libdvdread: Encrypted DVD support unavailable.\n");
/* libdvdcss replacement functions */
dvdinput_open = file_open;
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c 2004-09-18 21:03:05 UTC (rev 829)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c 2004-09-19 07:33:25 UTC (rev 830)
@@ -21,17 +21,17 @@
#include "config.h"
#include <sys/types.h>
-#include <sys/stat.h>
+#include <sys/stat.h>
#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h> /* For the timing of dvdcss_title crack. */
+#include <sys/time.h> /* For the timing of dvdcss_title crack. */
#endif
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
#endif
#include <limits.h>
#include <dirent.h>
@@ -129,9 +129,9 @@
}
-#if defined(WIN32)
+#if defined(WIN32)
#include <windows.h>
-# define GETTIME(v) v = GetTickCount ()
+# define GETTIME(v) v = GetTickCount ()
# define TIMEDIFF(v) (v.end - v.start)
#else /* !WIN32 */
# define GETTIME(v) gettimeofday (&v, NULL)
@@ -163,9 +163,9 @@
if(nokeys_str != NULL)
return 0;
- LOG_ERROR( "\n" );
- LOG_ERROR( "libdvdread: Attempting to retrieve all CSS keys\n" );
- LOG_ERROR( "libdvdread: This can take a _long_ time, "
+ LOG_ERROR( stderr, "\n" );
+ LOG_ERROR( stderr, "libdvdread: Attempting to retrieve all CSS keys\n" );
+ LOG_ERROR( stderr, "libdvdread: This can take a _long_ time, "
"please be patient\n\n" );
GETTIME( all_time.start );
@@ -180,13 +180,13 @@
start = UDFFindFile( dvd, filename, &len );
if( start != 0 && len != 0 ) {
/* Perform CSS key cracking for this title. */
- LOG_ERROR( "libdvdread: Get key for %s at 0x%08x\n",
+ LOG_ERROR( stderr, "libdvdread: Get key for %s at 0x%08x\n",
filename, start );
if( dvdinput_title( dvd->dev, (int)start ) < 0 ) {
- LOG_ERROR( "libdvdread: Error cracking CSS key for %s (0x%08x)\n", filename, start);
+ LOG_ERROR( stderr, "libdvdread: Error cracking CSS key for %s (0x%08x)\n", filename, start);
}
GETTIME( t_time.end );
- LOG_ERROR( "libdvdread: Elapsed time %ld\n",
+ LOG_ERROR( stderr, "libdvdread: Elapsed time %ld\n",
(long int) TIMEDIFF(t_time) );
}
@@ -198,20 +198,20 @@
if( start == 0 || len == 0 ) break;
/* Perform CSS key cracking for this title. */
- LOG_ERROR( "libdvdread: Get key for %s at 0x%08x\n",
+ LOG_ERROR( stderr, "libdvdread: Get key for %s at 0x%08x\n",
filename, start );
if( dvdinput_title( dvd->dev, (int)start ) < 0 ) {
- LOG_ERROR( "libdvdread: Error cracking CSS key for %s (0x%08x)!!\n", filename, start);
+ LOG_ERROR( stderr, "libdvdread: Error cracking CSS key for %s (0x%08x)!!\n", filename, start);
}
GETTIME( t_time.end );
- LOG_ERROR( "libdvdread: Elapsed time %ld\n",
+ LOG_ERROR( stderr, "libdvdread: Elapsed time %ld\n",
(long int) TIMEDIFF(t_time) );
}
title--;
- LOG_ERROR( "libdvdread: Found %d VTS's\n", title );
+ LOG_ERROR( stderr, "libdvdread: Found %d VTS's\n", title );
GETTIME( all_time.end );
- LOG_ERROR( "libdvdread: Elapsed time %ld\n",
+ LOG_ERROR( stderr, "libdvdread: Elapsed time %ld\n",
(long int) TIMEDIFF(all_time) );
return 0;
@@ -229,7 +229,7 @@
dev = dvdinput_open( location );
if( !dev ) {
- LOG_ERROR( "libdvdread: Can't open %s for reading\n", location );
+ LOG_ERROR( stderr, "libdvdread: Can't open %s for reading\n", location );
return 0;
}
@@ -330,7 +330,7 @@
ret = stat( path, &fileinfo );
if( ret < 0 ) {
/* If we can't stat the file, give up */
- LOG_ERROR( "libdvdread: Can't stat %s\n", path );
+ LOG_ERROR( stderr, "libdvdread: Can't stat %s\n", path );
perror("");
return 0;
}
@@ -366,7 +366,7 @@
/* XXX: We should scream real loud here. */
if( !(path_copy = strdup( path ) ) ) return 0;
- /* Resolve any symlinks and get the absolut dir name. */
+ /* Resolve any symlinks and get the absolut dir name. */
#if !defined(WIN32)
{
char *new_path;
@@ -382,7 +382,7 @@
path_copy = new_path;
}
}
- }
+ }
#endif
/**
@@ -405,7 +405,8 @@
#if defined(SYS_BSD)
if( ( fe = getfsfile( path_copy ) ) ) {
dev_name = bsd_block2char( fe->fs_spec );
- LOG_ERROR( "libdvdread: Attempting to use device %s"
+ LOG_ERROR( stderr,
+ "libdvdread: Attempting to use device %s"
" mounted on %s for CSS authentication\n",
dev_name,
fe->fs_file );
@@ -420,7 +421,7 @@
while( ( res = getmntent( mntfile, &mp ) ) != -1 ) {
if( res == 0 && !strcmp( mp.mnt_mountp, path_copy ) ) {
dev_name = sun_block2char( mp.mnt_special );
- LOG_ERROR(
+ LOG_ERROR( stderr,
"libdvdread: Attempting to use device %s"
" mounted on %s for CSS authentication\n",
dev_name,
@@ -438,7 +439,7 @@
while( ( me = getmntent( mntfile ) ) ) {
if( !strcmp( me->mnt_dir, path_copy ) ) {
- LOG_ERROR(
+ LOG_ERROR( stderr,
"libdvdread: Attempting to use device %s"
" mounted on %s for CSS authentication\n",
me->mnt_fsname,
@@ -452,9 +453,9 @@
}
#endif
if( !dev_name ) {
- LOG_ERROR( "libdvdread: Couldn't find device name.\n" );
+ LOG_ERROR( stderr, "libdvdread: Couldn't find device name.\n" );
} else if( !auth_drive ) {
- LOG_ERROR( "libdvdread: Device %s inaccessible, "
+ LOG_ERROR( stderr, "libdvdread: Device %s inaccessible, "
"CSS authentication not available.\n", dev_name );
}
@@ -473,7 +474,7 @@
}
/* If it's none of the above, screw it. */
- LOG_ERROR( "libdvdread: Could not open %s\n", path );
+ LOG_ERROR( stderr, "libdvdread: Could not open %s\n", path );
return 0;
}
@@ -596,7 +597,7 @@
dvd_file->filesize = 0;
if( stat( full_path, &fileinfo ) < 0 ) {
- LOG_ERROR( "libdvdread: Can't stat() %s.\n", filename );
+ LOG_ERROR( stderr, "libdvdread: Can't stat() %s.\n", filename );
free( dvd_file );
return 0;
}
@@ -648,7 +649,7 @@
}
/*
if( dvdinput_title( dvd_file->dvd->dev, (int)start ) < 0 ) {
- LOG_ERROR( "libdvdread: Error cracking CSS key for %s\n",
+ LOG_ERROR( stderr, "libdvdread: Error cracking CSS key for %s\n",
filename );
}
*/
@@ -694,7 +695,7 @@
}
if( stat( full_path, &fileinfo ) < 0 ) {
- LOG_ERROR( "libdvdread: Can't stat() %s.\n", filename );
+ LOG_ERROR( stderr, "libdvdread: Can't stat() %s.\n", filename );
free( dvd_file );
return 0;
}
@@ -712,7 +713,7 @@
}
if( stat( full_path, &fileinfo ) < 0 ) {
- LOG_ERROR( "libdvdread: Can't stat() %s.\n", filename );
+ LOG_ERROR( stderr, "libdvdread: Can't stat() %s.\n", filename );
break;
}
@@ -770,7 +771,7 @@
}
break;
default:
- LOG_ERROR( "libdvdread: Invalid domain for file open.\n" );
+ LOG_ERROR( stderr, "libdvdread: Invalid domain for file open.\n" );
return NULL;
}
@@ -809,13 +810,13 @@
int ret;
if( !device->dev ) {
- LOG_ERROR( "libdvdread: Fatal error in block read.\n" );
+ LOG_ERROR( stderr, "libdvdread: Fatal error in block read.\n" );
return 0;
}
ret = dvdinput_seek( device->dev, (int) lb_number );
if( ret != (int) lb_number ) {
- LOG_ERROR( "libdvdread: Can't seek to block %u\n", lb_number );
+ LOG_ERROR( stderr, "libdvdread: Can't seek to block %u\n", lb_number );
return 0;
}
@@ -859,7 +860,7 @@
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 ) {
- LOG_ERROR( "libdvdread: Can't seek to block %d\n",
+ LOG_ERROR( stderr, "libdvdread: Can't seek to block %d\n",
offset );
return off < 0 ? off : 0;
}
@@ -874,7 +875,7 @@
/* Read part 1 */
off = dvdinput_seek( dvd_file->title_devs[ i ], (int)offset );
if( off < 0 || off != (int)offset ) {
- LOG_ERROR( "libdvdread: Can't seek to block %d\n",
+ LOG_ERROR( stderr, "libdvdread: Can't seek to block %d\n",
offset );
return off < 0 ? off : 0;
}
@@ -890,7 +891,7 @@
/* Read part 2 */
off = dvdinput_seek( dvd_file->title_devs[ i + 1 ], 0 );
if( off < 0 || off != 0 ) {
- LOG_ERROR( "libdvdread: Can't seek to block %d\n",
+ LOG_ERROR( stderr, "libdvdread: Can't seek to block %d\n",
0 );
return off < 0 ? off : 0;
}
@@ -974,7 +975,7 @@
secbuf = (unsigned char *) malloc( numsec * DVD_VIDEO_LB_LEN );
if( !secbuf ) {
- LOG_ERROR( "libdvdread: Can't allocate memory "
+ LOG_ERROR( stderr, "libdvdread: Can't allocate memory "
"for file read!\n" );
return 0;
}
@@ -1028,13 +1029,13 @@
char *buffer = malloc( file_size );
if( buffer == NULL ) {
- LOG_ERROR( "libdvdread: DVDDiscId, failed to "
+ LOG_ERROR( stderr, "libdvdread: DVDDiscId, failed to "
"allocate memory for file read!\n" );
return -1;
}
bytes_read = DVDReadBytes( dvd_file, buffer, file_size );
if( bytes_read != file_size ) {
- LOG_ERROR( "libdvdread: DVDDiscId read returned %d bytes"
+ LOG_ERROR( stderr, "libdvdread: DVDDiscId read returned %d bytes"
", wanted %d\n", bytes_read, file_size );
DVDCloseFile( dvd_file );
return -1;
@@ -1070,14 +1071,14 @@
buffer = malloc( DVD_VIDEO_LB_LEN );
if( buffer == NULL ) {
- LOG_ERROR( "libdvdread: DVDISOVolumeInfo, failed to "
+ LOG_ERROR( stderr, "libdvdread: DVDISOVolumeInfo, failed to "
"allocate memory for file read!\n" );
return -1;
}
ret = UDFReadBlocksRaw( dvd, 16, 1, buffer, 0 );
if( ret != 1 ) {
- LOG_ERROR( "libdvdread: DVDISOVolumeInfo, failed to "
+ LOG_ERROR( stderr, "libdvdread: DVDISOVolumeInfo, failed to "
"read ISO9660 Primary Volume Descriptor!\n" );
return -1;
}
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.c
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.c 2004-09-18 21:03:05 UTC (rev 829)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.c 2004-09-19 07:33:25 UTC (rev 830)
@@ -32,14 +32,14 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
+#include <string.h>
#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
+#include <sys/ioctl.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
-#include <unistd.h>
+#include <unistd.h>
#endif
#include <inttypes.h>
@@ -241,7 +241,7 @@
if(c == NULL) {
c = calloc(1, sizeof(struct udf_cache));
- // LOG_ERROR( "calloc: %d\n", sizeof(struct udf_cache));
+ // LOG_ERROR( stderr, "calloc: %d\n", sizeof(struct udf_cache));
if(c == NULL) {
return 0;
}
@@ -278,7 +278,7 @@
c->lb_num++;
c->lbs = realloc(c->lbs, c->lb_num * sizeof(struct lbudf));
/*
- LOG_ERROR( "realloc lb: %d * %d = %d\n",
+ LOG_ERROR( stderr, "realloc lb: %d * %d = %d\n",
c->lb_num, sizeof(struct lbudf),
c->lb_num * sizeof(struct lbudf));
*/
@@ -301,7 +301,7 @@
c->map_num++;
c->maps = realloc(c->maps, c->map_num * sizeof(struct icbmap));
/*
- LOG_ERROR( "realloc maps: %d * %d = %d\n",
+ LOG_ERROR( stderr, "realloc maps: %d * %d = %d\n",
c->map_num, sizeof(struct icbmap),
c->map_num * sizeof(struct icbmap));
*/
@@ -563,7 +563,7 @@
}
/*
if(cached_dir) {
- LOG_ERROR( "malloc dir: %d\n",
+ LOG_ERROR( stderr, "malloc dir: %d\n",
dir_lba * DVD_VIDEO_LB_LEN);
}
*/
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_print.c
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_print.c 2004-09-18 21:03:05 UTC (rev 829)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_print.c 2004-09-19 07:33:25 UTC (rev 830)
@@ -36,13 +36,6 @@
#include "ifo_read.h"
#include "ifo_print.h"
#include "dvdread_internal.h"
-
-int internal_error(const char*format, ...)
-{
- va_list args;
- va_start(args, format);
- return vfprintf(stderr, format, args);
-}
/* Put this in some other file / package? It's used in nav_print too. */
static void ifoPrint_time(dvd_time_t *dtime) {
@@ -1038,7 +1031,7 @@
ifohandle = ifoOpen(dvd, title);
if(!ifohandle) {
- LOG_ERROR( "Can't open info file for title %d\n", title );
+ LOG_ERROR( stderr, "Can't open info file for title %d\n", title );
return;
}
@@ -1157,3 +1150,4 @@
ifoClose(ifohandle);
}
+
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c 2004-09-18 21:03:05 UTC (rev 829)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c 2004-09-19 07:33:25 UTC (rev 830)
@@ -38,17 +38,17 @@
#ifndef NDEBUG
#define CHECK_ZERO0(arg) \
if(arg != 0) { \
- LOG_ERROR( "*** Zero check failed in %s:%i\n for %s = 0x%x\n", \
+ LOG_ERROR( stderr, "*** Zero check failed in %s:%i\n for %s = 0x%x\n", \
__FILE__, __LINE__, # arg, arg); \
}
#define CHECK_ZERO(arg) \
if(memcmp(my_friendly_zeros, &arg, sizeof(arg))) { \
unsigned int i_CZ; \
- LOG_ERROR( "*** Zero check failed in %s:%i\n for %s = 0x", \
+ LOG_ERROR( stderr, "*** Zero check failed in %s:%i\n for %s = 0x", \
__FILE__, __LINE__, # arg ); \
for(i_CZ = 0; i_CZ < sizeof(arg); i_CZ++) \
- LOG_ERROR( "%02x", *((uint8_t *)&arg + i_CZ)); \
- LOG_ERROR( "\n"); \
+ LOG_ERROR( stderr, "%02x", *((uint8_t *)&arg + i_CZ)); \
+ LOG_ERROR( stderr, "\n"); \
}
static const uint8_t my_friendly_zeros[2048];
#else
@@ -108,20 +108,20 @@
ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_BACKUP_FILE);
if(!ifofile->file) {
if(title) {
- LOG_ERROR( "libdvdread: Can't open file VTS_%02d_0.IFO.\n", title);
+ LOG_ERROR( stderr, "libdvdread: Can't open file VTS_%02d_0.IFO.\n", title);
} else {
- LOG_ERROR( "libdvdread: Can't open file VIDEO_TS.IFO.\n");
+ LOG_ERROR( stderr, "libdvdread: Can't open file VIDEO_TS.IFO.\n");
}
free(ifofile);
return 0;
}
-
+
/* First check if this is a VMGI file. */
if(ifoRead_VMG(ifofile)) {
/* These are both mandatory. */
if(!ifoRead_FP_PGC(ifofile) || !ifoRead_TT_SRPT(ifofile)) {
- LOG_ERROR( "libdvdread: Invalid main menu IFO (VIDEO_TS.IFO).\n");
+ LOG_ERROR( stderr, "libdvdread: Invalid main menu IFO (VIDEO_TS.IFO).\n");
ifoClose(ifofile);
return 0;
}
@@ -131,7 +131,7 @@
/* This is also mandatory. */
if(!ifoRead_VTS_ATRT(ifofile)) {
- LOG_ERROR( "libdvdread: Invalid main menu IFO (VIDEO_TS.IFO).\n");
+ LOG_ERROR( stderr, "libdvdread: Invalid main menu IFO (VIDEO_TS.IFO).\n");
ifoClose(ifofile);
return 0;
}
@@ -146,7 +146,7 @@
if(ifoRead_VTS(ifofile)) {
if(!ifoRead_VTS_PTT_SRPT(ifofile) || !ifoRead_PGCIT(ifofile)) {
- LOG_ERROR( "libdvdread: Invalid title IFO (VTS_%02d_0.IFO).\n",
+ LOG_ERROR( stderr, "libdvdread: Invalid title IFO (VTS_%02d_0.IFO).\n",
title);
ifoClose(ifofile);
return 0;
@@ -159,7 +159,7 @@
ifoRead_VOBU_ADMAP(ifofile);
if(!ifoRead_TITLE_C_ADT(ifofile) || !ifoRead_TITLE_VOBU_ADMAP(ifofile)) {
- LOG_ERROR( "libdvdread: Invalid title IFO (VTS_%02d_0.IFO).\n",
+ LOG_ERROR( stderr, "libdvdread: Invalid title IFO (VTS_%02d_0.IFO).\n",
title);
ifoClose(ifofile);
return 0;
@@ -169,10 +169,10 @@
}
if(title) {
- LOG_ERROR( "libdvdread: Invalid IFO for title %d (VTS_%02d_0.IFO).\n",
+ LOG_ERROR( stderr, "libdvdread: Invalid IFO for title %d (VTS_%02d_0.IFO).\n",
title, title);
} else {
- LOG_ERROR( "libdvdread: Invalid IFO for VMGM (VIDEO_TS.IFO).\n");
+ LOG_ERROR( stderr, "libdvdread: Invalid IFO for VMGM (VIDEO_TS.IFO).\n");
}
ifoClose(ifofile);
return 0;
@@ -192,7 +192,7 @@
if(!ifofile->file) /* Should really catch any error and try to fallback */
ifofile->file = DVDOpenFile(dvd, 0, DVD_READ_INFO_BACKUP_FILE);
if(!ifofile->file) {
- LOG_ERROR( "libdvdread: Can't open file VIDEO_TS.IFO.\n");
+ LOG_ERROR( stderr, "libdvdread: Can't open file VIDEO_TS.IFO.\n");
free(ifofile);
return 0;
}
@@ -200,7 +200,7 @@
if(ifoRead_VMG(ifofile))
return ifofile;
- LOG_ERROR( "libdvdread: Invalid main menu IFO (VIDEO_TS.IFO).\n");
+ LOG_ERROR( stderr, "libdvdread: Invalid main menu IFO (VIDEO_TS.IFO).\n");
ifoClose(ifofile);
return 0;
}
@@ -216,7 +216,7 @@
memset(ifofile, 0, sizeof(ifo_handle_t));
if(title <= 0 || title > 99) {
- LOG_ERROR( "libdvdread: ifoOpenVTSI invalid title (%d).\n", title);
+ LOG_ERROR( stderr, "libdvdread: ifoOpenVTSI invalid title (%d).\n", title);
free(ifofile);
return 0;
}
@@ -225,7 +225,7 @@
if(!ifofile->file) /* Should really catch any error and try to fallback */
ifofile->file = DVDOpenFile(dvd, title, DVD_READ_INFO_BACKUP_FILE);
if(!ifofile->file) {
- LOG_ERROR( "libdvdread: Can't open file VTS_%02d_0.IFO.\n", title);
+ LOG_ERROR( stderr, "libdvdread: Can't open file VTS_%02d_0.IFO.\n", title);
free(ifofile);
return 0;
}
@@ -234,7 +234,7 @@
if(ifofile->vtsi_mat)
return ifofile;
- LOG_ERROR( "libdvdread: Invalid IFO for title %d (VTS_%02d_0.IFO).\n",
+ LOG_ERROR( stderr, "libdvdread: Invalid IFO for title %d (VTS_%02d_0.IFO).\n",
title, title);
ifoClose(ifofile);
return 0;
@@ -814,7 +814,7 @@
ifofile->tt_srpt = tt_srpt;
if(!(DVDReadBytes(ifofile->file, tt_srpt, TT_SRPT_SIZE))) {
- LOG_ERROR( "libdvdread: Unable to read read TT_SRPT.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to read read TT_SRPT.\n");
free(tt_srpt);
return 0;
}
@@ -831,7 +831,7 @@
return 0;
}
if(!(DVDReadBytes(ifofile->file, tt_srpt->title, info_length))) {
- LOG_ERROR( "libdvdread: Unable to read read TT_SRPT.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to read read TT_SRPT.\n");
ifoFree_TT_SRPT(ifofile);
return 0;
}
@@ -868,7 +868,7 @@
tt_srpt->nr_of_srpts * sizeof(title_info_t),
my_friendly_zeros,
info_length - tt_srpt->nr_of_srpts * sizeof(title_info_t))) {
- LOG_ERROR( "VMG_PTT_SRPT slack is != 0, ");
+ LOG_ERROR( stderr, "VMG_PTT_SRPT slack is != 0, ");
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));
@@ -917,7 +917,7 @@
ifofile->vts_ptt_srpt = vts_ptt_srpt;
if(!(DVDReadBytes(ifofile->file, vts_ptt_srpt, VTS_PTT_SRPT_SIZE))) {
- LOG_ERROR( "libdvdread: Unable to read PTT search table.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to read PTT search table.\n");
free(vts_ptt_srpt);
return 0;
}
@@ -938,7 +938,7 @@
return 0;
}
if(!(DVDReadBytes(ifofile->file, data, info_length))) {
- LOG_ERROR( "libdvdread: Unable to read PTT search table.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to read PTT search table.\n");
free(vts_ptt_srpt);
free(data);
ifofile->vts_ptt_srpt = 0;
@@ -1083,7 +1083,7 @@
for(i = 0; i < ptl_mait->nr_of_countries; i++) {
if(!(DVDReadBytes(ifofile->file, &ptl_mait->countries[i], PTL_MAIT_COUNTRY_SIZE))) {
- LOG_ERROR( "libdvdread: Unable to read PTL_MAIT.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to read PTL_MAIT.\n");
free(ptl_mait->countries);
free(ptl_mait);
ifofile->ptl_mait = 0;
@@ -1109,7 +1109,7 @@
if(!DVDFileSeek_(ifofile->file,
ifofile->vmgi_mat->ptl_mait * DVD_BLOCK_LEN
+ ptl_mait->countries[i].pf_ptl_mai_start_byte)) {
- LOG_ERROR( "libdvdread: Unable to seak PTL_MAIT table.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to seak PTL_MAIT table.\n");
free(ptl_mait->countries);
free(ptl_mait);
return 0;
@@ -1125,7 +1125,7 @@
return 0;
}
if(!(DVDReadBytes(ifofile->file, pf_temp, info_length))) {
- LOG_ERROR( "libdvdread: Unable to read PTL_MAIT table.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to read PTL_MAIT table.\n");
free(pf_temp);
for(j = 0; j < i ; j++) {
free(ptl_mait->countries[j].pf_ptl_mai);
@@ -1208,7 +1208,7 @@
ifofile->vts_tmapt = vts_tmapt;
if(!(DVDReadBytes(ifofile->file, vts_tmapt, VTS_TMAPT_SIZE))) {
- LOG_ERROR( "libdvdread: Unable to read VTS_TMAPT.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to read VTS_TMAPT.\n");
free(vts_tmapt);
ifofile->vts_tmapt = NULL;
return 0;
@@ -1231,7 +1231,7 @@
vts_tmapt->tmap_offset = vts_tmap_srp;
if(!(DVDReadBytes(ifofile->file, vts_tmap_srp, info_length))) {
- LOG_ERROR( "libdvdread: Unable to read VTS_TMAPT.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to read VTS_TMAPT.\n");
free(vts_tmap_srp);
free(vts_tmapt);
ifofile->vts_tmapt = NULL;
@@ -1262,7 +1262,7 @@
}
if(!(DVDReadBytes(ifofile->file, &vts_tmapt->tmap[i], VTS_TMAP_SIZE))) {
- LOG_ERROR( "libdvdread: Unable to read VTS_TMAP.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to read VTS_TMAP.\n");
ifoFree_VTS_TMAPT(ifofile);
return 0;
}
@@ -1284,7 +1284,7 @@
}
if(!(DVDReadBytes(ifofile->file, vts_tmapt->tmap[i].map_ent, info_length))) {
- LOG_ERROR( "libdvdread: Unable to read VTS_TMAP_ENT.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to read VTS_TMAP_ENT.\n");
ifoFree_VTS_TMAPT(ifofile);
return 0;
}
@@ -1395,7 +1395,7 @@
Enemy of the State region 2 (de) has Titles where nr_of_vobs field
is to high, they high ones are never referenced though. */
if(info_length / sizeof(cell_adr_t) < c_adt->nr_of_vobs) {
- LOG_ERROR( "libdvdread: *C_ADT nr_of_vobs > avaiable info entries\n");
+ LOG_ERROR( stderr, "libdvdread: *C_ADT nr_of_vobs > avaiable info entries\n");
c_adt->nr_of_vobs = info_length / sizeof(cell_adr_t);
}
@@ -2005,13 +2005,13 @@
ifofile->txtdt_mgi = txtdt_mgi;
if(!(DVDReadBytes(ifofile->file, txtdt_mgi, TXTDT_MGI_SIZE))) {
- LOG_ERROR( "libdvdread: Unable to read TXTDT_MGI.\n");
+ LOG_ERROR( stderr, "libdvdread: Unable to read TXTDT_MGI.\n");
free(txtdt_mgi);
ifofile->txtdt_mgi = 0;
return 0;
}
- // LOG_ERROR( "-- Not done yet --\n");
+ // LOG_ERROR( stderr, "-- Not done yet --\n");
return 1;
}
Modified: trunk/DvdMenuXtractor/libdvdread/win32/config.h
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/win32/config.h 2004-09-18 21:03:05 UTC (rev 829)
+++ trunk/DvdMenuXtractor/libdvdread/win32/config.h 2004-09-19 07:33:25 UTC (rev 830)
@@ -111,6 +111,5 @@
#undef _POSIX_
#ifndef LOG_ERROR
-#define LOG_ERROR internal_error
-extern int internal_error(const char*format, ...);
+#define LOG_ERROR fprintf
#endif
Modified: trunk/DvdMenuXtractor/libdvdread/win32/libdvdread.vcproj
===================================================================
--- trunk/DvdMenuXtractor/libdvdread/win32/libdvdread.vcproj 2004-09-18 21:03:05 UTC (rev 829)
+++ trunk/DvdMenuXtractor/libdvdread/win32/libdvdread.vcproj 2004-09-19 07:33:25 UTC (rev 830)
@@ -21,7 +21,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""$(ProjectDir)";"$(ProjectDir)..""
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;HAVE_CONFIG_H;LOG_ERROR=myfprintf"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -63,7 +63,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""$(ProjectDir)";"$(ProjectDir)..""
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;HAVE_CONFIG_H;LOG_ERROR=myfprintf"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="config.h"
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.