From 62944e3b21ebc0511e4e6b08fa9041bfe4852c22 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 --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/mmc.c | 5 +++++ libburn/spc.c | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 589706d..dd37845 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.07.31.080152" +#define Cdrskin_timestamP "2011.07.31.083046" diff --git a/libburn/mmc.c b/libburn/mmc.c index 042c6b7..c320062 100644 --- a/libburn/mmc.c +++ b/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/spc.c b/libburn/spc.c index 23bae11..a270dde 100644 --- a/libburn/spc.c +++ b/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() */