New API function isoburn_disc_available_space() fixes bug with DVD+RW capacity
This commit is contained in:
@ -399,6 +399,22 @@ void isoburn_disc_erase(struct burn_drive *drive, int fast)
|
||||
}
|
||||
|
||||
|
||||
off_t isoburn_disc_available_space(struct burn_drive *d,
|
||||
struct burn_write_opts *opts)
|
||||
{
|
||||
int ret;
|
||||
struct isoburn *o;
|
||||
off_t avail;
|
||||
|
||||
ret= isoburn_find_emulator(&o, d, 0);
|
||||
if(ret>0 && o!=NULL)
|
||||
if(o->emulation_mode!=0)
|
||||
burn_write_opts_set_start_byte(opts, ((off_t) o->nwa) * (off_t) 2048);
|
||||
avail= burn_disc_available_space(d, opts);
|
||||
return(avail);
|
||||
}
|
||||
|
||||
|
||||
int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba)
|
||||
{
|
||||
int ret;
|
||||
|
@ -654,6 +654,21 @@ int isoburn_set_read_pacifier(struct burn_drive *drive,
|
||||
int isoburn_attach_image(struct burn_drive *d, IsoImage *image);
|
||||
|
||||
|
||||
/** Return the best possible estimation of the currently available capacity of
|
||||
the media. This might depend on particular write option settings and on
|
||||
drive state.
|
||||
An eventual start address for emulated multi-session will be subtracted
|
||||
from the capacity estimation given by burn_disc_available_space().
|
||||
Negative results get defaulted to 0.
|
||||
Wrapper for: burn_disc_available_space()
|
||||
@param d The drive to query.
|
||||
@param o If not NULL: write parameters to be set on drive before query
|
||||
@return number of most probably available free bytes
|
||||
*/
|
||||
off_t isoburn_disc_available_space(struct burn_drive *d,
|
||||
struct burn_write_opts *o);
|
||||
|
||||
|
||||
/** Obtain the start block number of the most recent session on media. In
|
||||
case of random access media this will always be 0. Succesfull return is
|
||||
not a guarantee that there is a ISO-9660 image at all. The call will fail,
|
||||
|
Reference in New Issue
Block a user