Package: dvdbackup
Version: 0.1.1-10
Severity: normal
When using dvdbackup to backup a double layer DVD I got the other day I
found that DVDReadBlocks would sometimes return fewer blocks than
requested but would otherwise work fine. I have a patch that handles
this situation and it backed up my dvd fine after applying the patch.
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.18-3-xen-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash
Versions of packages dvdbackup depends on:
ii libc6 2.3.6.ds1-13 GNU C Library: Shared libraries
ii libdvdread3 0.9.7-3 library for reading DVDs
dvdbackup recommends no packages.
-- no debconf information
Only in dvdbackup-0.1.1.ckr/: build-stamp
Only in dvdbackup-0.1.1.ckr/debian: dvdbackup
Only in dvdbackup-0.1.1.ckr/debian: dvdbackup-dbg
Only in dvdbackup-0.1.1.ckr/debian: dvdbackup.substvars
Only in dvdbackup-0.1.1.ckr/debian: files
Only in dvdbackup-0.1.1.ckr/src: dvdbackup
diff -u -r dvdbackup-0.1.1/src/dvdbackup.c dvdbackup-0.1.1.ckr/src/dvdbackup.c
--- dvdbackup-0.1.1/src/dvdbackup.c 2007-04-17 06:01:28.000000000 -0400
+++ dvdbackup-0.1.1.ckr/src/dvdbackup.c 2007-04-15 07:37:39.800282257 -0400
@@ -328,7 +328,7 @@
/* Buffer size in DVD sectors */
/* Currently set to 1MB */
int buff = 512;
-
+ int rbuff;
/* Offsets */
int soffset;
@@ -422,15 +422,19 @@
if (buff > left) {
buff = left;
}
- if ( DVDReadBlocks(dvd_file,soffset,buff, buffer) != buff) {
- fprintf(stderr, "Error reading MENU VOB\n");
+
+ if ((rbuff = DVDReadBlocks(dvd_file,soffset,buff, buffer)) < 0) {
+ fprintf(stderr, "Error reading MENU VOB %d != %d\n", rbuff, buff);
free(buffer);
DVDCloseFile(dvd_file);
close(streamout);
return(1);
}
+ if (rbuff < buff) {
+ fprintf(stderr, "DVDReadBlocks read %d blocks of %d blocks\n", rbuff, buff);
+ }
- if (write(streamout,buffer,buff * 2048) != buff * 2048) {
+ if (write(streamout,buffer,rbuff * 2048) != rbuff * 2048) {
fprintf(stderr, "Error writing TITLE VOB\n");
free(buffer);
close(streamout);
@@ -440,8 +444,8 @@
fprintf(stderr,"Current soffset changed from %i to ",soffset);
#endif
soffset = soffset + buff;
- left = left - buff;
- size = size + buff;
+ left = left - rbuff;
+ size = size + rbuff;
if ((size >= vobsize) && (left > 0)) {
#ifdef DEBUG
fprintf(stderr,"size: %i, vobsize: %i\n ",size, vobsize);