From 44dea991a6693bdd34440b4a461cd393a865e80d Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 31 Jul 2011 08:31:11 +0000 Subject: [PATCH] Bug fix: Some drives return -150 as NWA of blank CD, rather than 0 --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/mmc.c | 5 +++++ libburn/trunk/libburn/spc.c | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index 589706d3..dd378457 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.07.31.080152" +#define Cdrskin_timestamP "2011.07.31.083046" diff --git a/libburn/trunk/libburn/mmc.c b/libburn/trunk/libburn/mmc.c index 042c6b78..c320062a 100644 --- a/libburn/trunk/libburn/mmc.c +++ b/libburn/trunk/libburn/mmc.c @@ -444,6 +444,11 @@ int mmc_get_nwa(struct burn_drive *d, int trackno, int *lba, int *nwa) *nwa = mmc_four_char_to_int(data + 12); num = mmc_four_char_to_int(data + 16); + /* Pioneer BD-RW BDR-205 and LITE-ON LTR-48125S return -150 as *nwa + of blank media */ + if (*nwa < *lba && d->status == BURN_DISC_BLANK) + *nwa = *lba; + #ifdef Libburn_pioneer_dvr_216d_load_mode5 /* >>> memorize track mode : data[6] & 0xf */; #endif diff --git a/libburn/trunk/libburn/spc.c b/libburn/trunk/libburn/spc.c index 23bae112..a270dde2 100644 --- a/libburn/trunk/libburn/spc.c +++ b/libburn/trunk/libburn/spc.c @@ -634,7 +634,7 @@ void spc_sense_write_params(struct burn_drive *d) { struct buffer *buf = NULL; struct scsi_mode_data *m; - int dummy, alloc_len = 10; + int dummy1, dummy2, alloc_len = 10; unsigned char *page; struct command *c = NULL; @@ -679,7 +679,7 @@ void spc_sense_write_params(struct burn_drive *d) else if (d->status == BURN_DISC_BLANK || (d->current_is_cd_profile && d->status == BURN_DISC_APPENDABLE)) { burn_drive_send_default_page_05(d, 0); - d->get_nwa(d, -1, &dummy, &dummy); + d->get_nwa(d, -1, &dummy1, &dummy2); } /* others are hopefully up to date from mmc_read_disc_info() */