From b8b67164b48e353e1995e771e23e217268801785 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 4 Mar 2013 21:13:32 +0000 Subject: [PATCH] Bug fix: On some drives the request for minimum speed yielded maximum speed --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/mmc.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index 8fd4bbc3..0d643796 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2013.02.26.080127" +#define Cdrskin_timestamP "2013.03.04.211258" diff --git a/libburn/trunk/libburn/mmc.c b/libburn/trunk/libburn/mmc.c index 33a84888..65e80d50 100644 --- a/libburn/trunk/libburn/mmc.c +++ b/libburn/trunk/libburn/mmc.c @@ -4250,14 +4250,22 @@ int mmc_get_write_performance(struct burn_drive *d) return 0; /* first command execution to learn number of descriptors and - dxfer_len */ + dxfer_len + */ ret = mmc_get_write_performance_al(d, &alloc_len, &max_descr); + if (max_descr > 0 && ret > 0) { + /* Some drives announce only 1 descriptor if asked for 0. + So ask twice for non-0 descriptors. + */ + ret = mmc_get_write_performance_al(d, &alloc_len, &max_descr); + } /* fprintf(stderr,"LIBBURN_DEBUG: ACh alloc_len = %d , ret = %d\n", alloc_len, ret); */ if (max_descr > 0 && ret > 0) - /* second execution with announced length */ + /* final execution with announced length */ + max_descr = (alloc_len - 8) / 16; ret = mmc_get_write_performance_al(d, &alloc_len, &max_descr); return ret; }