From a1e566615047ca800c6fe0471eeed9211ddab5c9 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 14 Feb 2014 20:03:01 +0000 Subject: [PATCH] Improved workaround for missing mode page 2A --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/drive.c | 28 ++++++++++++----------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index 8a131698..05761321 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2014.02.13.205358" +#define Cdrskin_timestamP "2014.02.14.200129" diff --git a/libburn/trunk/libburn/drive.c b/libburn/trunk/libburn/drive.c index 7a91c82e..a37444b3 100644 --- a/libburn/trunk/libburn/drive.c +++ b/libburn/trunk/libburn/drive.c @@ -1221,12 +1221,7 @@ static void strip_spaces(char *str) static int drive_getcaps(struct burn_drive *d, struct burn_drive_info *out) { struct burn_scsi_inquiry_data *id; - int i; - /* For faking CD recording capability of unavailable mode page 0x2A */ - static int writer_profiles[] = { - 0x09, 0x0a, 0x11, 0x12, 0x13, 0x14, 0x15, 0x1a, 0x1b, 0x2b, - 0x41, 0x42, 0x43, 0x00 - }; + int i, profile; /* ts A61007 : now prevented in enumerate_common() */ #if 0 @@ -1266,13 +1261,20 @@ static int drive_getcaps(struct burn_drive *d, struct burn_drive_info *out) out->read_dvdrom = out->read_cdr = out->read_cdrw = 0; out->write_dvdram = out->write_dvdr = out->write_cdr = 0; out->write_cdrw = out->write_simulate = out->c2_errors = 0; - /* If the drive reported a writer profile, attribute CD-R */ - for (i = 0; writer_profiles[i] != 0; i++) - if (writer_profiles[i] == d->current_profile) { - out->write_cdr = 1; - break; - } - + for (i = 0; i < d->num_profiles; i++) { + profile = (d->all_profiles[i * 4] << 8) | + d->all_profiles[i * 4 + 1]; + if (profile == 0x09) + out->write_cdr = out->read_cdr = 1; + else if (profile == 0x0a) + out->write_cdrw = out->read_cdrw = 1; + else if (profile == 0x10) + out->read_dvdrom = 1; + else if (profile == 0x11) + out->write_dvdr = out->read_dvdr = 1; + else if (profile == 0x12) + out->write_dvdram = out->read_dvdram = 1; + } } out->drive = d;