From a28dcd45ef7790693e9e9b4195b29d03dd346d08 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 20 Apr 2008 11:15:07 +0000 Subject: [PATCH] Displaying free space rather than "non-data" on drive aquiry and -toc --- libisoburn/trunk/libisoburn/burn_wrap.c | 14 +++++++++++--- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- libisoburn/trunk/xorriso/xorrisoburn.c | 12 +++++++++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/libisoburn/trunk/libisoburn/burn_wrap.c b/libisoburn/trunk/libisoburn/burn_wrap.c index de8c4a68..abe00807 100644 --- a/libisoburn/trunk/libisoburn/burn_wrap.c +++ b/libisoburn/trunk/libisoburn/burn_wrap.c @@ -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); } diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 770947b3..ab668c24 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.04.20.111054" +#define Xorriso_timestamP "2008.04.20.111419" diff --git a/libisoburn/trunk/xorriso/xorrisoburn.c b/libisoburn/trunk/xorriso/xorrisoburn.c index daf5f0be..73916902 100644 --- a/libisoburn/trunk/xorriso/xorrisoburn.c +++ b/libisoburn/trunk/xorriso/xorrisoburn.c @@ -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);