From de189ea74275b8b683e011e7da22fd1e0e499a4f Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 11 Jan 2007 13:29:39 +0000 Subject: [PATCH] With full formatting prefer format 10h over 13h or 15h --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/mmc.c | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index 3813e9be..f682ec86 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.01.10.204839" +#define Cdrskin_timestamP "2007.01.11.131106" diff --git a/libburn/trunk/libburn/mmc.c b/libburn/trunk/libburn/mmc.c index 23ee1a37..bcf67d22 100644 --- a/libburn/trunk/libburn/mmc.c +++ b/libburn/trunk/libburn/mmc.c @@ -1114,7 +1114,7 @@ void mmc_get_configuration(struct burn_drive *d) int mmc_read_format_capacities(struct burn_drive *d, int top_wanted) { struct buffer buf; - int len, type, score, num_descr, max_score = -1, i; + int len, type, score, num_descr, max_score = -2000000000, i, sign = 1; off_t size; struct command c; unsigned char *dpt; @@ -1161,6 +1161,9 @@ int mmc_read_format_capacities(struct burn_drive *d, int top_wanted) d->format_curr_max_size *= (off_t) 2048; + if (top_wanted == 0x00 || top_wanted == 0x10) + sign = -1; /* the caller clearly desires full format */ + /* 6.24.3.3 Formattable Capacity Descriptors */ num_descr = (len - 8) / 8; for (i = 0; i < num_descr; i++) { @@ -1177,20 +1180,20 @@ int mmc_read_format_capacities(struct burn_drive *d, int top_wanted) LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO, msg, 0, 0); - /* Scoring strives for quick intermediate state */ + /* Criterion is proximity to quick intermediate state */ if (type == 0x00) { /* full format (with lead out) */ - score = 1; + score = 1 * sign; } else if (type == 0x10) { /* DVD-RW full format */ - score = 10; + score = 10 * sign; } else if(type == 0x13) { /* DVD-RW quick grow last session */ - score = 100; + score = 100 * sign; } else if(type == 0x15) { /* DVD-RW Quick */ - score = 50; + score = 50 * sign; } else { continue; } - if(type == top_wanted) - score+= 1000000000; + if (type == top_wanted) + score += 1000000000; if (score > max_score) { d->best_format_type = type; d->best_format_size = size;