From: Sébastien NOBILI
Origin: upstream
Last-Update: 2011-10-19
Forwarded: not-needed
Description: Allow user to specify options to be passed to Wodim
 This patch allows the user to specify options to be added to Wodim's
 command-line call, giving better control on the process.
 .
 The patch was submitted to the upstream author by the user, who, not
 anticipating any new versions, submitted it to me for Debian inclusion.
Index: mp3roaster-0.3.0/mp3roaster
===================================================================
--- mp3roaster-0.3.0.orig/mp3roaster	2011-10-19 12:15:18.000000000 -0500
+++ mp3roaster-0.3.0/mp3roaster	2011-10-19 12:15:19.000000000 -0500
@@ -50,6 +50,7 @@
     \%opthash,
 
     'opt_cdr_dev|dev|D=s',
+    'opt_wodim_opts|wodim-opts|w=s',
     'opt_cdr_speed|speed|s=i',
     'opt_cdr_dummy|dummy|d',
     'opt_cdr_dao|dao|a',
@@ -100,6 +101,7 @@
   -Q, --questions   Replace questionmarks with underscores.
   -n, --normalize   Normalize WAV files before burning.
   -N, --no-normalize Don\'t normalize WAV files (useful to override config)
+  -w  --wodim-opts  Specify options to pass to Wodim for CD burning
   -y, --no-confirm  Don\'t prompt for confirmation.
   -v, --verbose     Enable verbose output.
   -h, --help        Show this help screen.
@@ -230,6 +232,7 @@
     # This variables are found in the configuration file and
     # need to be declared here in order to follow `use strict`
     my $config_cdr_dev;
+    my $config_wodim_opts;
     my $config_cdr_speed;
     my $config_cdr_dummy;
     my $config_cdr_dao;
@@ -250,6 +253,7 @@
     %refhash = (
 
         "config_cdr_dev"            => \$config_cdr_dev,
+        "config_wodim_opts"         => \$config_wodim_opts,
         "config_cdr_speed"          => \$config_cdr_speed,
         "config_cdr_dummy"          => \$config_cdr_dummy,
         "config_cdr_dao"            => \$config_cdr_dao,
@@ -1056,7 +1060,7 @@
 #
 sub burn {
 
-    my ($config_cdr_dev, $config_cdr_speed, $config_cdr_dummy, $config_cdr_dao, $config_cdr_burnfree, @wav_array) = @_;
+    my ($config_cdr_dev, $config_cdr_speed, $config_cdr_dummy, $config_cdr_dao, $config_cdr_burnfree, $config_wodim_opts, @wav_array) = @_;
     my $sub = "BURN";
     my $burn_wav_list;
     my $cdrecord_options;
@@ -1068,7 +1072,7 @@
         $burn_wav_list = $burn_wav_list." \"$wav\"";
     }
 
-    $cdrecord_options = "dev=$config_cdr_dev speed=$config_cdr_speed gracetime=2 -eject -pad -audio -silent";
+    $cdrecord_options = "dev=$config_cdr_dev speed=$config_cdr_speed gracetime=2 -eject -pad -audio -silent ".$config_wodim_opts;
 
     if ($config_cdr_dummy) {
 
@@ -1184,6 +1188,7 @@
             print "quotes " if ($confhash{config_check_quotes});
             print "questionmarks " if ($confhash{config_check_questions});
             print "normalize " if ($confhash{config_wav_normalize});
+            print "\"".$confhash{config_wodim_opts}."\" ";
 
             print "]\n";
 
@@ -1274,7 +1279,7 @@
             # printf " * Burning %d files, please wait... ", ($#wav_array+1);
             #
             print " * Burning files, please wait... ";
-            burn($confhash{config_cdr_dev}, $confhash{config_cdr_speed}, $confhash{config_cdr_dummy}, $confhash{config_cdr_dao}, $confhash{config_cdr_burnfree}, @wav_array);
+            burn($confhash{config_cdr_dev}, $confhash{config_cdr_speed}, $confhash{config_cdr_dummy}, $confhash{config_cdr_dao}, $confhash{config_cdr_burnfree}, $confhash{config_wodim_opts}, @wav_array);
             print "done.\n";
 
             #
@@ -1345,7 +1350,7 @@
 
 =over 4
 
-=item B<-d, --dev>
+=item B<-D, --dev>
 
 CDR device to use
 
@@ -1406,6 +1411,10 @@
 
 Don't prompt for confirmation.
 
+=item B<-w, --wodim-opts>
+
+Specify options to pass to Wodim for CD recording
+
 =item B<-v, --verbose>
 
 Enable verbose output
