Hiho,

I am about improving dvd::rip's compatiblity to transcode 1.1.0 and 
stumbled over a bug in transcode's -W option parser.

When it comes to audio transcoding, a special version of -W is used to 
tell transcode all chunks should be processed at once:

  transcode -S <psu_no> -W <chunk_cnt>,<chunk_cnt>,<nav_file>

This transcodes audio for the specified PSU. transcode 1.1.0 fails on 
this with an error about illegal options passed for -W.

The option parser obviously rejects the at-first-looking-illegal request
of processing a chunk number which is out of range (since chunk numbers
go from 0 up to chunk_cnt - 1, but not for this special case).

The alternative command line for transcode 1.1.0 is as follows (easily 
written down here, but it took me some time to get it, in particular 
--no_split was necessary to prevent transcode from mangling my output 
filenames... ;)

  transcode --psu_mode --no_split --psu_chunks <psu_no>-<psu_no + 1> \
            --nav_seek <nav_file>

But I still process the _video_ chunks using the -W syntax, since I 
can't see any option to pass the self-chosen maximum number of chunks 
without it - this is of course important, because transcode needs it to
calculate how long a chunk is.

This solution is Ok (and next dvd::rip release will contain it), but I 
think the mixing of -W and --psu options are - erm - somewhat confusing
;). Probably it's better to make it working in 1.0 fashion again. 
Attached you find a simple patch which accomplishes that.

Regards,

Jörn

-- 
Joern Reder
-> http://www.exit1.org/
-> http://search.cpan.org/~jred/
diff -u -r transcode-1.1.0/src/cmdline_def.h 
transcode-1.1.0.patched/src/cmdline_def.h
--- transcode-1.1.0/src/cmdline_def.h   2008-12-25 09:40:09.000000000 +0100
+++ transcode-1.1.0.patched/src/cmdline_def.h   2009-02-22 16:23:30.000000000 
+0100
@@ -1448,7 +1448,7 @@
                            &vob->vob_chunk_max, vob_logfile) < 2
                  || vob->vob_chunk < 0
                  || vob->vob_chunk_max <= 0
-                 || vob->vob_chunk >= vob->vob_chunk_max
+                 || vob->vob_chunk >= vob->vob_chunk_max + 1
                 ) {
                     tc_error("Invalid parameter for -W/--autosplit");
                     goto short_usage;
diff -u -r transcode-1.1.0/src/transcode.c 
transcode-1.1.0.patched/src/transcode.c
--- transcode-1.1.0/src/transcode.c     2009-01-05 12:00:16.000000000 +0100
+++ transcode-1.1.0.patched/src/transcode.c     2009-02-22 16:18:34.000000000 
+0100
@@ -2255,7 +2255,7 @@
         if (vob->vob_chunk < 0 || vob->vob_chunk < 0)
             tc_error("invalid parameter for option -W");
     } else {
-        if (vob->vob_chunk < 0 || vob->vob_chunk > vob->vob_chunk_max)
+        if (vob->vob_chunk < 0 || vob->vob_chunk > vob->vob_chunk_max + 1)
             tc_error("invalid parameter for option -W");
     }
 

Attachment: pgphQ2T66KaJL.pgp
Description: PGP signature

Reply via email to