From 4cd1627acb007ba276f61cae2ff5c89fd58e7ce9 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 13 Oct 2011 10:59:48 +0000 Subject: [PATCH] Improved plausibility of xorriso media summary in case of unreliable readbility --- libisoburn/trunk/xorriso/drive_mgt.c | 8 +++++++- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libisoburn/trunk/xorriso/drive_mgt.c b/libisoburn/trunk/xorriso/drive_mgt.c index 11f2e7e7..89dc2a3f 100644 --- a/libisoburn/trunk/xorriso/drive_mgt.c +++ b/libisoburn/trunk/xorriso/drive_mgt.c @@ -897,6 +897,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag) struct burn_toc_entry next_toc_entry; int disk_category, part_version, num_layers, num_blocks; char *book_name; + int num_data_from_format= 0; /* int num_payload= 0, num_wasted= 0, num_nondata= 0; */ @@ -1110,6 +1111,8 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag) ret= burn_get_read_capacity(drive, &num_data, 0); if(ret == 1) size= ((off_t) num_data) * (off_t) 2048; + } else { + num_data_from_format= 1; } nwa= lba + size / 2048; num_data= nwa - lba; @@ -1223,7 +1226,10 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag) Sfile_scale(((double) num_data) * 2048.0, mem_text,5,1e4,1); 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); + if(num_data_from_format) + num_free= 0; + else + 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); diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 7dc07be1..906c3483 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2011.10.09.162439" +#define Xorriso_timestamP "2011.10.13.105921"