From 79b1f0d5b91e86f4620f1533fd5ac08af46599f4 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 28 May 2007 17:03:12 +0000 Subject: [PATCH] Added check for .might_simulate to burn_write_opts_auto_write_type() --- libburn/trunk/cdrskin/cdrskin.1 | 7 ++++++- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/options.c | 22 +++++++++++++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin.1 b/libburn/trunk/cdrskin/cdrskin.1 index d728c5c7..31a3d6a1 100644 --- a/libburn/trunk/cdrskin/cdrskin.1 +++ b/libburn/trunk/cdrskin/cdrskin.1 @@ -365,8 +365,10 @@ even if attempted explicitely via "driveropts=burnfree". .TP .BI \-dummy Try to perform the drive operations without actually affecting the inserted -media. There is no guarantee that this will work with a particular combination +media. There is no warranty that this will work with a particular combination of drive, media, and write mode. Blanking is prevented reliably, though. +To avoid inadverted real burning, -dummy refuses burn runs on anything but +CD-R[W] and DVD-R[W]. .TP .BI \-eject Eject the disc after work is done. @@ -380,6 +382,9 @@ write modes which libburn believes they are not supported by the drive. Another application is to enforce blanking or re-formatting of media which appear to be in the desired blank or format state already. .br +This option enables a burn run with option -dummy even if libburn believes +that drive and media will not simulate the write mode but will write for real. +.br .B Caution: Use this only when in urgent need. .TP diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index 48719559..a75ddbba 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.05.28.165630" +#define Cdrskin_timestamP "2007.05.28.170243" diff --git a/libburn/trunk/libburn/options.c b/libburn/trunk/libburn/options.c index 8cf30b95..73e7686e 100644 --- a/libburn/trunk/libburn/options.c +++ b/libburn/trunk/libburn/options.c @@ -124,11 +124,19 @@ void burn_write_opts_set_format(struct burn_write_opts *opts, int format) int burn_write_opts_set_simulate(struct burn_write_opts *opts, int sim) { +/* <<< ts A70529 : + One cannot predict the ability to simulate from page 05h + information alone. This check is now done later in + function burn_write_opts_auto_write_type(). + if (opts->drive->mdata->simulate) { opts->simulate = sim; return 1; } return 0; +*/ + opts->simulate = !!sim; + return 1; } int burn_write_opts_set_underrun_proof(struct burn_write_opts *opts, @@ -265,6 +273,8 @@ no_caps:; } else if (caps->might_do_sao >= 3 && !(flag & 1)) goto try_tao; do_sao:; + if (caps->might_simulate == 0 && opts->simulate && !opts->force_is_set) + goto no_simulate; if (!(flag & 1)) burn_write_opts_set_write_type( opts, BURN_WRITE_SAO, BURN_BLOCK_SAO); @@ -296,6 +306,8 @@ try_tao:; if (strcmp(reason_pt, "TAO: ") != 0) goto no_tao; /* ( TAO data/audio block size will be handled automatically ) */ + if (caps->might_simulate == 0 && opts->simulate && !opts->force_is_set) + goto no_simulate; if (!(flag & 1)) burn_write_opts_set_write_type( opts, BURN_WRITE_TAO, BURN_BLOCK_MODE1); @@ -323,13 +335,21 @@ try_raw:; strcat(reasons, "drive dislikes block type, "); if (strcmp(reason_pt, "RAW: ") != 0) goto no_write_mode; + if (!opts->force_is_set) + goto no_simulate; /* For now: no setting of raw write modes */ {wt = BURN_WRITE_RAW; goto ex;} no_write_mode:; - wt = BURN_WRITE_NONE; + {wt = BURN_WRITE_NONE; goto ex;} + +no_simulate:; + strcat(reasons, + "simulation of write job not supported by drive and media, "); + {wt = BURN_WRITE_NONE; goto ex;} + ex:; burn_disc_free_multi_caps(&caps); if (wt == BURN_WRITE_NONE && !(flag & 3)) {