From 9ee4f65141cb62652bd5ab82e66d7db4bba5c160 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 8 Jun 2011 18:13:02 +0000 Subject: [PATCH] Bug fix: burn_disc_format() on DVD-RW issued wrong block size with type 00h --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/mmc.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 48456c3..d968847 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.06.08.082201" +#define Cdrskin_timestamP "2011.06.08.181204" diff --git a/libburn/mmc.c b/libburn/mmc.c index cea590e..05e9e4a 100644 --- a/libburn/mmc.c +++ b/libburn/mmc.c @@ -3298,7 +3298,6 @@ no_suitable_formatting_type:; {ret = 0; goto ex;} } format_type = d->best_format_type; - c->page->data[11] = 16; /* block size * 2k */ sprintf(descr, "DVD-RW %s", format_type == 0x15 ? "quick" : "full"); return_immediately = 1; /* caller must do the waiting */ @@ -3640,6 +3639,20 @@ unsuitable_media:; } c->page->data[8] = (format_type << 2) | (format_sub_type & 3); + /* MMC-5 Table 253 , column Type Dependent Parameter */ + if (format_type == 0x00 || format_type == 0x01 || + format_type == 0x31) { + /* Block Length 0x0800 = 2k */ + c->page->data[ 9] = 0x00; + c->page->data[10] = 0x08; + c->page->data[11] = 0x00; + } else if (format_type >= 0x10 && format_type <= 0x15) { + /* ECC block size = 16 * 2k */ + c->page->data[ 9] = 0; + c->page->data[10] = 0; + c->page->data[11] = 16; + } + sprintf(msg, "Format type %2.2Xh \"%s\", blocks = %.f", format_type, descr, (double) num_of_blocks); libdax_msgs_submit(libdax_messenger, d->global_index, 0x00000002,