On Tue, Feb 07, 2006 at 12:10:52AM +0100, Robos wrote:
> Either I'm stupid or the patch is missing. Also, since this is against a

Args, I have done it again. Attached the patch to this mail.

> rather old version I can't really say if the bug has been fixed already. If
> you could get in touch with me directly or through the maintainer, that'd be
> great. 
> There will be a release *very* soon now and I want to get the patches into
> it if possible.

Ok, I'll try hte latest version an tell you if the patch still is needed
and if it does apply.

    Ingo
-- 
/* Why waste time? -- asuffield */
diff -Ndurp vobcopy-0.5.14.orig/vobcopy.c vobcopy-0.5.14/vobcopy.c
--- vobcopy-0.5.14.orig/vobcopy.c       2004-11-22 20:12:46.000000000 +0100
+++ vobcopy-0.5.14/vobcopy.c    2006-01-26 17:36:46.819268130 +0100
@@ -130,7 +130,7 @@ extern int errno;
 
 int main ( int argc, char *argv[] )
 {
-  int               streamout, block_count;
+  int               streamout, block_count, file_block_count;
 //  char              name[300], op;
   char              op;
   char              dvd_path[255], logfile_name[20],logfile_path[255];
@@ -1142,19 +1142,26 @@ if( quiet_flag )
                   if( verbosity_level > 1) 
                     fprintf( stderr, "start of %s at %d blocks \n", 
output_file, start );
                   
-                 for( i = start; ( i - start ) * DVD_VIDEO_LB_LEN < file_size; 
i += block_count)
+                 file_block_count = block_count;
+                 for( i = start; ( i - start ) * DVD_VIDEO_LB_LEN < file_size; 
i += file_block_count)
                    {
+                     /* Only read and write as many blocks as there are left 
in the file */
+                     if ( ( i - start + file_block_count ) * DVD_VIDEO_LB_LEN 
> file_size )
+                       {
+                         file_block_count = ( file_size / DVD_VIDEO_LB_LEN ) - 
( i - start );
+                       }
+
 /*                   DVDReadBlocks( dvd_file, i, 1, bufferin );this has to be 
wrong with the 1 there...*/
-                             DVDReadBlocks( dvd_file, i, block_count, bufferin 
);
+                             DVDReadBlocks( dvd_file, i, file_block_count, 
bufferin );
 
-                     if( write( streamout, bufferin, DVD_VIDEO_LB_LEN * 
block_count ) < 0 )
+                     if( write( streamout, bufferin, DVD_VIDEO_LB_LEN * 
file_block_count ) < 0 )
                        {
                          fprintf( stderr, "\n[Error] error writing to %s \n", 
output_file );
                          fprintf( stderr, "[Error] error: %s\n", strerror( 
errno ) );
                          exit( 1 );
                        }
 
-                      l += block_count; 
+                      l += file_block_count; 
                      /*progression bar*/
                       /*this here doesn't work with -F 10 */
 /*                   if( !( ( ( ( i-start )+1 )*DVD_VIDEO_LB_LEN )%( 1024*1024 
) ) ) */
@@ -1568,13 +1575,23 @@ A businessman was talking with his barbe
 /*         offset++ ) */
 /*     { */
 
+      file_block_count = block_count;
       for ( ; ( offset + ( off_t ) seek_start ) < ( ( off_t ) 
file_size_in_blocks - ( off_t ) stop_before_end )  
             && offset - ( off_t )max_filesize_in_blocks_summed - 
(off_t)angle_blocks_skipped < max_filesize_in_blocks; 
-           offset += block_count )
+           offset += file_block_count )
        {
+         /* Only read and write as many blocks as there are left in the file */
+         if ( ( offset + file_block_count + ( off_t ) seek_start ) > ( ( off_t 
) file_size_in_blocks - ( off_t ) stop_before_end ) )
+           {
+             file_block_count = ( off_t ) file_size_in_blocks - ( off_t ) 
stop_before_end - offset - ( off_t ) seek_start;
+           }
+         if ( offset + file_block_count - ( off_t 
)max_filesize_in_blocks_summed - (off_t)angle_blocks_skipped > 
max_filesize_in_blocks )
+           {
+             file_block_count = max_filesize_in_blocks - ( offset + 
file_block_count - ( off_t )max_filesize_in_blocks_summed - 
(off_t)angle_blocks_skipped );
+           }
 
-         DVDReadBlocks( dvd_file,( offset + seek_start ), block_count, 
bufferin );
-         if( write( streamout, bufferin, DVD_VIDEO_LB_LEN * block_count ) < 0 )
+         DVDReadBlocks( dvd_file,( offset + seek_start ), file_block_count, 
bufferin );
+         if( write( streamout, bufferin, DVD_VIDEO_LB_LEN * file_block_count ) 
< 0 )
            {
              fprintf( stderr, "\n[Error] write() error\n"
                      "[Error] it's possible that you try to write files\n"
@@ -1583,7 +1600,7 @@ A businessman was talking with his barbe
              fprintf( stderr, "[Error] error: %s\n", strerror( errno ) );
              exit( 1 );
            }
-         l += block_count;
+         l += file_block_count;
 
 /*this is for people who report that it takes vobcopy ages to copy something */
 /* TODO */
Binärdateien vobcopy-0.5.14.orig/.vobcopy.c.swp and 
vobcopy-0.5.14/.vobcopy.c.swp sind verschieden.

Attachment: signature.asc
Description: Digital signature

Reply via email to