Lines 1-78
Link Here
|
1 |
--- src/dvdbackup.c.orig Mon Aug 5 02:08:39 2002 |
|
|
2 |
+++ src/dvdbackup.c Tue Mar 1 05:01:19 2005 |
3 |
@@ -210,6 +210,7 @@ |
4 |
fprintf(stderr,"\t-v X\t\twhere X is the amount of verbosity\n"); |
5 |
fprintf(stderr,"\t-I\t\tfor information about the DVD\n"); |
6 |
fprintf(stderr,"\t-o directory\twhere directory is your backup target\n"); |
7 |
+ fprintf(stderr,"\t-n\t\tuse this as DVD name (if we can't get it)\n"); |
8 |
fprintf(stderr,"\t-M\t\tbackup the whole DVD\n"); |
9 |
fprintf(stderr,"\t-F\t\tbackup the main feature of the DVD\n"); |
10 |
fprintf(stderr,"\t-T X\t\tbackup title set X\n"); |
11 |
@@ -219,8 +220,8 @@ |
12 |
fprintf(stderr,"\t-a 0\t\tto get aspect ratio 4:3 instead of 16:9 if both are present\n"); |
13 |
fprintf(stderr,"\t-h\t\tprint a brief usage message\n"); |
14 |
fprintf(stderr,"\t-?\t\tprint a brief usage message\n\n"); |
15 |
- fprintf(stderr,"\t-i is manditory\n"); |
16 |
- fprintf(stderr,"\t-o is manditory except if you use -I\n"); |
17 |
+ fprintf(stderr,"\t-i is mandatory\n"); |
18 |
+ fprintf(stderr,"\t-o is mandatory except if you use -I\n"); |
19 |
fprintf(stderr,"\t-a is option to the -F switch and has no effect on other options\n"); |
20 |
fprintf(stderr,"\t-s and -e should prefereibly be used together with -t \n\n"); |
21 |
exit(1); |
22 |
@@ -228,7 +228,8 @@ |
23 |
} |
24 |
|
25 |
int CheckSizeArray(const int size_array[], int reference, int target) { |
26 |
- if ( (size_array[reference]/size_array[target] == 1) && |
27 |
+ if ( size_array[target] && |
28 |
+ (size_array[reference]/size_array[target] == 1) && |
29 |
((size_array[reference] * 2 - size_array[target])/ size_array[target] == 1) && |
30 |
((size_array[reference]%size_array[target] * 3) < size_array[reference]) ) { |
31 |
/* We have a dual DVD with two feature films - now lets see if they have the same amount of chapters*/ |
32 |
@@ -782,7 +783,7 @@ |
33 |
to consider the second one a feature title we are doing two checks (biggest + biggest - second) /second == 1 |
34 |
and biggest%second * 3 < biggest */ |
35 |
|
36 |
- if ( CheckSizeArray(size_size_array, 0, 1) == 1 ) { |
37 |
+ if ( CheckSizeArray(size_size_array, 0, 1) == 1 && title_sets >1 ) { |
38 |
/* We have a dual DVD with two feature films - now lets see if they have the same amount of chapters*/ |
39 |
|
40 |
chapters_1 = 0; |
41 |
@@ -1530,7 +1531,7 @@ |
42 |
|
43 |
/* Seek to title of first track, which is at (track_no * 32768) + 40 */ |
44 |
|
45 |
- if ( 32808 != lseek(filehandle, 32808, SEEK_SET) ) { |
46 |
+ if ( 32768 != lseek(filehandle, 32768, SEEK_SET) ) { |
47 |
close(filehandle); |
48 |
fprintf(stderr, "Can't seek DVD device %s - check your DVD device\n", device); |
49 |
return(1); |
50 |
@@ -1538,12 +1539,18 @@ |
51 |
|
52 |
/* Read the DVD-Video title */ |
53 |
|
54 |
- if ( 32 != read(filehandle, title, 32)) { |
55 |
+#define DVD_SEC_SIZ 2048 |
56 |
+ { |
57 |
+ char tempBuf[ DVD_SEC_SIZ ]; |
58 |
+ |
59 |
+ if ( DVD_SEC_SIZ != read(filehandle, tempBuf, DVD_SEC_SIZ)) { |
60 |
close(filehandle); |
61 |
fprintf(stderr, "Can't read title from DVD device %s\n", device); |
62 |
return(1); |
63 |
} |
64 |
|
65 |
+ snprintf( title, 32, "%s", tempBuf + 40 ); |
66 |
+ } |
67 |
/* Terminate the title string */ |
68 |
|
69 |
title[32] = '\0'; |
70 |
@@ -2164,7 +2171,7 @@ |
71 |
DVDGetTitleName(dvd,title_name); |
72 |
|
73 |
|
74 |
- fprintf(stdout,"\n\n\nDVD-Video information of the DVD with tile %s\n\n", title_name); |
75 |
+ fprintf(stdout,"\n\n\nDVD-Video information of the DVD with title %s\n\n", title_name); |
76 |
|
77 |
/* Print file structure */ |
78 |
|