I forgot to attach the patch in the previous email, here it is.
/Bj|rn
--- dvdbackup.c.orig 2006-03-02 19:09:52.000000000 +0100
+++ dvdbackup.c 2006-03-02 20:14:25.000000000 +0100
@@ -30,6 +30,7 @@
#include <unistd.h>
#include <string.h>
#include <limits.h>
+#include <stdint.h>
#include <dvdread/dvd_reader.h>
#include <dvdread/ifo_read.h>
#include <dvdread/ifo_print.h>
@@ -1656,15 +1657,14 @@
/* DVD Video files */
- char filename[MAXNAME];
- int size;
+ dvd_stat_t statbuf;
/*DVD ifo handler*/
ifo_handle_t * vmg_ifo=NULL;
/* The Title Set Info struct*/
title_set_info_t * title_set_info;
-
+
/* Open main info file */
vmg_ifo = ifoOpen( _dvd, 0 );
if( !vmg_ifo ) {
@@ -1687,10 +1687,9 @@
/* Find VIDEO_TS.IFO is present - must be present since we did a ifo
open 0*/
- sprintf(filename,"/VIDEO_TS/VIDEO_TS.IFO");
-
- if ( UDFFindFile(_dvd, filename, &size) != 0 ) {
- title_set_info->title_set[0].size_ifo = size;
+
+ if ( DVDFileStat(_dvd, 0, DVD_READ_INFO_FILE, &statbuf) != -1 ) {
+ title_set_info->title_set[0].size_ifo = statbuf.size;
} else {
DVDFreeTitleSetInfo(title_set_info);
return(0);
@@ -1700,20 +1699,18 @@
/* Find VIDEO_TS.VOB if present*/
- sprintf(filename,"/VIDEO_TS/VIDEO_TS.VOB");
- if ( UDFFindFile(_dvd, filename, &size) != 0 ) {
- title_set_info->title_set[0].size_menu = size;
+ if ( DVDFileStat(_dvd, 0, DVD_READ_MENU_VOBS, &statbuf) != -1 ) {
+ title_set_info->title_set[0].size_menu = statbuf.size;
} else {
title_set_info->title_set[0].size_menu = 0 ;
}
/* Find VIDEO_TS.BUP if present */
- sprintf(filename,"/VIDEO_TS/VIDEO_TS.BUP");
- if ( UDFFindFile(_dvd, filename, &size) != 0 ) {
- title_set_info->title_set[0].size_bup = size;
+ if (DVDFileStat(_dvd, 0, DVD_READ_INFO_BACKUP_FILE, &statbuf) != -1) {
+ title_set_info->title_set[0].size_bup = statbuf.size;
} else {
DVDFreeTitleSetInfo(title_set_info);
return(0);
@@ -1745,10 +1742,9 @@
}
- sprintf(filename,"/VIDEO_TS/VTS_%02i_0.IFO",counter +
1);
- if ( UDFFindFile(_dvd, filename, &size) != 0 ) {
- title_set_info->title_set[counter + 1].size_ifo
= size;
+ if ( DVDFileStat(_dvd, counter + 1, DVD_READ_INFO_FILE,
&statbuf) != -1) {
+ title_set_info->title_set[counter+1].size_ifo =
statbuf.size;
} else {
DVDFreeTitleSetInfo(title_set_info);
return(0);
@@ -1761,10 +1757,9 @@
/* Find VTS_XX_0.VOB if present*/
- sprintf(filename,"/VIDEO_TS/VTS_%02i_0.VOB", counter +
1);
- if ( UDFFindFile(_dvd, filename, &size) != 0 ) {
- title_set_info->title_set[counter +
1].size_menu = size;
+ if ( DVDFileStat(_dvd, counter + 1, DVD_READ_MENU_VOBS,
&statbuf) != -1) {
+ title_set_info->title_set[counter +
1].size_menu = statbuf.size;
} else {
title_set_info->title_set[counter +
1].size_menu = 0 ;
}
@@ -1776,13 +1771,12 @@
/* Find all VTS_XX_[1 to 9].VOB files if they are
present*/
-
- for( i = 0; i < 9; ++i ) {
- sprintf(filename,"/VIDEO_TS/VTS_%02i_%i.VOB",
counter + 1, i + 1 );
- if(UDFFindFile(_dvd, filename, &size) == 0 ) {
- break;
+ i = 0;
+ if ( DVDFileStat(_dvd, counter + 1,
DVD_READ_TITLE_VOBS, &statbuf) != -1) {
+ for ( i = 0; i < statbuf.nr_parts; ++i) {
+ title_set_info->title_set[counter +
1].size_vob[i] = statbuf.parts_size[i];
}
- title_set_info->title_set[counter +
1].size_vob[i] = size;
+
}
title_set_info->title_set[counter +
1].number_of_vob_files = i;
@@ -1791,10 +1785,9 @@
}
- sprintf(filename,"/VIDEO_TS/VTS_%02i_0.BUP", counter +
1);
- if ( UDFFindFile(_dvd, filename, &size) != 0 ) {
- title_set_info->title_set[counter +1].size_bup
= size;
+ if ( DVDFileStat(_dvd, counter + 1,
DVD_READ_INFO_BACKUP_FILE, &statbuf) != -1) {
+ title_set_info->title_set[counter + 1].size_bup
= statbuf.size;
} else {
DVDFreeTitleSetInfo(title_set_info);
return(0);