Made burn_disc_available_space() take into respect burn_write_opts_set_start_byte()

This commit is contained in:
Thomas Schmitt 2007-02-22 11:30:12 +00:00
parent 64ae333863
commit 0ddeb01502
3 changed files with 12 additions and 3 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2007.02.22.094939" #define Cdrskin_timestamP "2007.02.22.113016"

View File

@ -1445,12 +1445,18 @@ off_t burn_disc_available_space(struct burn_drive *d,
int lba, nwa; int lba, nwa;
if (burn_drive_is_released(d)) if (burn_drive_is_released(d))
return d->media_capacity_remaining; goto ex;
if (d->busy != BURN_DRIVE_IDLE) if (d->busy != BURN_DRIVE_IDLE)
return d->media_capacity_remaining; goto ex;
if (o != NULL) if (o != NULL)
d->send_write_parameters(d, o); d->send_write_parameters(d, o);
d->get_nwa(d, -1, &lba, &nwa); d->get_nwa(d, -1, &lba, &nwa);
ex:;
if (o->start_byte > 0) {
if (o->start_byte > d->media_capacity_remaining)
return 0;
return d->media_capacity_remaining - o->start_byte;
}
return d->media_capacity_remaining; return d->media_capacity_remaining;
} }

View File

@ -847,6 +847,9 @@ int burn_disc_get_msc1(struct burn_drive *d, int *start_lba);
inquiring the space with such a set of options, the drive has to be inquiring the space with such a set of options, the drive has to be
grabbed and BURN_DRIVE_IDLE. If not, then one will only get a canned value grabbed and BURN_DRIVE_IDLE. If not, then one will only get a canned value
from the most recent automatic inquiry (e.g. during last drive grabbing). from the most recent automatic inquiry (e.g. during last drive grabbing).
An eventual start address from burn_write_opts_set_start_byte() will be
subtracted from the obtained capacity estimation. Negative results get
defaulted to 0.
@param d The drive to query. @param d The drive to query.
@param o If not NULL: write parameters to be set on drive before query @param o If not NULL: write parameters to be set on drive before query
@return number of most probably available free bytes @return number of most probably available free bytes