From 1e42a7641561fa27156489ae14de35c981762474 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 14 Jan 2010 16:04:57 +0000 Subject: [PATCH] Giving up drive probing by mode page sending --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/drive.c | 24 ++++++++++++++---------- libburn/libburn.h | 22 ++++++++++++++-------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 265a71c..094c03b 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2010.01.13.171546" +#define Cdrskin_timestamP "2010.01.14.160633" diff --git a/libburn/drive.c b/libburn/drive.c index 65c0c3b..2c97550 100644 --- a/libburn/drive.c +++ b/libburn/drive.c @@ -908,20 +908,27 @@ static int drive_getcaps(struct burn_drive *d, struct burn_drive_info *out) out->c2_errors = !!d->mdata->c2_pointers; out->drive = d; -#ifdef Libburn_pioneer_dvr_216d_dummy_probe_wM +#ifdef Libburn_dummy_probe_write_modeS /* ts A91112 */ /* Set default block types. The call d->probe_write_modes() is quite obtrusive. It may be performed explicitely by new API call burn_drive_probe_cd_write_modes(). */ - out->tao_block_types = d->block_types[BURN_WRITE_TAO] = - BURN_BLOCK_MODE1 | BURN_BLOCK_RAW0; - out->sao_block_types = d->block_types[BURN_WRITE_SAO] = BURN_BLOCK_SAO; + if (out->write_dvdram || out->write_dvdr || + out->write_cdrw || out->write_cdr) { + out->tao_block_types = d->block_types[BURN_WRITE_TAO] = + BURN_BLOCK_MODE1 | BURN_BLOCK_RAW0; + out->sao_block_types = d->block_types[BURN_WRITE_SAO] = + BURN_BLOCK_SAO; + } else { + out->tao_block_types = d->block_types[BURN_WRITE_TAO] = 0; + out->sao_block_types = d->block_types[BURN_WRITE_SAO] = 0; + } out->raw_block_types = d->block_types[BURN_WRITE_RAW] = 0; out->packet_block_types = 0; -#else /* Libburn_pioneer_dvr_216d_dummy_probe_wM */ +#else /* Libburn_dummy_probe_write_modeS */ /* update available block types for burners */ if (out->write_dvdram || out->write_dvdr || @@ -932,15 +939,14 @@ static int drive_getcaps(struct burn_drive *d, struct burn_drive_info *out) out->raw_block_types = d->block_types[BURN_WRITE_RAW]; out->packet_block_types = d->block_types[BURN_WRITE_PACKET]; -#endif /* ! Libburn_pioneer_dvr_216d_dummy_probe_wM */ +#endif /* ! Libburn_dummy_probe_write_modeS */ return 1; } -#ifdef Libburn_pioneer_dvr_216d_dummy_probe_wM -/* ts A91112 candidate for API */ +/* ts A91112 - B00114 API */ /* Probe available CD write modes and block types. */ int burn_drive_probe_cd_write_modes(struct burn_drive_info *dinfo) @@ -959,8 +965,6 @@ int burn_drive_probe_cd_write_modes(struct burn_drive_info *dinfo) return 1; } -#endif /* Libburn_pioneer_dvr_216d_dummy_probe_wM */ - /* ts A70907 : added parameter flag */ /* @param flag bit0= reset global drive list */ diff --git a/libburn/libburn.h b/libburn/libburn.h index cfed2a7..ff5ae52 100644 --- a/libburn/libburn.h +++ b/libburn/libburn.h @@ -1064,6 +1064,19 @@ int burn_drive_obtain_scsi_adr(char *path, int *bus_no, int *host_no, */ int burn_drive_grab(struct burn_drive *drive, int load); +/* ts B00114 */ +/* Probe available CD write modes and block types. In earlier versions this + was done unconditionally on drive examination or aquiration. But it is + lengthy and obtrusive, up to spoiling burn runs on the examined drives. + So now this probing is omitted by default. All drives which announce to be + capable of CD or DVD writing, get blindly attributed the capability for + SAO and TAO. Applications which are interested in RAW modes or want to + rely on the traditional write mode information, may use this call. + @param drive_info drive object to be inquired + @return >0 indicates success, <=0 means failure + @since 0.7.6 +*/ +int burn_drive_probe_cd_write_modes(struct burn_drive_info *drive_info); /* ts A90824 */ /** Calm down or alert a drive. Some drives stay alert after reading for @@ -2931,16 +2944,9 @@ BURN_END_DECLS For other modes resp. real probing one has to call burn_drive_probe_cd_write_modes(). - # define Libburn_pioneer_dvr_216d_dummy_probe_wM 1 */ -#ifdef Libburn_pioneer_dvr_216d_dummy_probe_wM +#define Libburn_dummy_probe_write_modeS 1 -/* Probe available CD write modes and block types. - @param drive_info drive object to be inquired -*/ -int burn_drive_probe_cd_write_modes(struct burn_drive_info *drive_info) - -#endif /* Libburn_pioneer_dvr_216d_dummy_probe_wM */ #endif /*LIBBURN_H*/