Displaying free space rather than "non-data" on drive aquiry and -toc

This commit is contained in:
Thomas Schmitt 2008-04-20 11:15:07 +00:00
parent e1c46f5023
commit b937313bb5
3 changed files with 23 additions and 5 deletions

View File

@ -433,13 +433,21 @@ off_t isoburn_disc_available_space(struct burn_drive *d,
{
int ret;
struct isoburn *o;
struct burn_write_opts *eff_opts= NULL, *local_opts= NULL;
off_t avail;
eff_opts= opts;
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);
if(o->emulation_mode!=0) {
local_opts= burn_write_opts_new(d);
eff_opts= local_opts;
burn_write_opts_set_start_byte(eff_opts, ((off_t) o->nwa) * (off_t) 2048);
}
avail= burn_disc_available_space(d, eff_opts);
if(local_opts!=NULL)
burn_write_opts_free(local_opts);
local_opts= NULL;
return(avail);
}

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.04.20.111054"
#define Xorriso_timestamP "2008.04.20.111419"

View File

@ -2214,7 +2214,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
struct burn_drive *drive;
enum burn_disc_status s;
char mem_text[80];
off_t start_byte= 0;
off_t start_byte= 0, num_free= 0;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to print Table Of Content", flag&2);
@ -2352,12 +2352,22 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
num_wasted= lba - num_payload;
num_nondata= lba - num_data;
Sfile_scale(((double) num_data) * 2048.0, mem_text,5,1e4,1);
#ifdef NIX
sprintf(respt, "Media summary: %d session%s, %d data blocks, %s",
num_sessions, (num_sessions==1 ? "" : "s"), num_data, mem_text);
if(num_nondata>0) {
Sfile_scale(((double) num_nondata) * 2048.0, mem_text,5,1e4,1);
sprintf(respt+strlen(respt), ", %s non-data", mem_text);
}
#else
sprintf(respt, "Media summary: %d session%s, %d data blocks, %s data",
num_sessions, (num_sessions==1 ? "" : "s"), num_data, mem_text);
num_free= isoburn_disc_available_space(drive, NULL);
Sfile_scale((double) num_free, mem_text,5,1e4,1);
sprintf(respt+strlen(respt), ", %s free", mem_text);
#endif
sprintf(respt+strlen(respt), "\n");
Xorriso_result(xorriso,0);