Reporting amount of non-data with -toc media summary

This commit is contained in:
Thomas Schmitt 2008-04-05 11:20:56 +00:00
parent 41c9e5669e
commit 115f3bc5dd
2 changed files with 14 additions and 3 deletions

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.04.03.204051" #define Xorriso_timestamP "2008.04.05.112055"

View File

@ -2193,6 +2193,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
int track_count= 0, session_no, track_no, profile_no= -1; int track_count= 0, session_no, track_no, profile_no= -1;
int last_track_start= 0, last_track_size= -1, num_data= 0, is_data= 0; int last_track_start= 0, last_track_size= -1, num_data= 0, is_data= 0;
int is_inout_drive= 0, drive_role; int is_inout_drive= 0, drive_role;
int num_payload= 0, num_wasted= 0, num_nondata= 0;
char profile_name[80],*respt,*devadr; char profile_name[80],*respt,*devadr;
struct burn_disc *disc= NULL; struct burn_disc *disc= NULL;
struct burn_session **sessions; struct burn_session **sessions;
@ -2286,7 +2287,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
sprintf(respt+strlen(respt), "leadout lba: %9d\n", nwa); sprintf(respt+strlen(respt), "leadout lba: %9d\n", nwa);
if(!(flag&1)) if(!(flag&1))
Xorriso_result(xorriso,0); Xorriso_result(xorriso,0);
num_data= last_track_size= nwa; num_payload= num_data= last_track_size= nwa;
num_sessions= 1; num_sessions= 1;
} else { } else {
sessions= burn_disc_get_sessions(disc, &num_sessions); sessions= burn_disc_get_sessions(disc, &num_sessions);
@ -2311,6 +2312,8 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
track_count, ((toc_entry.control&7)<4?"audio":"data "), lba); track_count, ((toc_entry.control&7)<4?"audio":"data "), lba);
if(!(flag&1)) if(!(flag&1))
Xorriso_result(xorriso,0); Xorriso_result(xorriso,0);
if(track_no>0)
num_payload+= lba - last_track_start;
last_track_start= lba; last_track_start= lba;
if((toc_entry.control&7)>=4) /* data track */ if((toc_entry.control&7)>=4) /* data track */
is_data= 1; is_data= 1;
@ -2328,15 +2331,23 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
if(!(flag&1)) if(!(flag&1))
Xorriso_result(xorriso,0); Xorriso_result(xorriso,0);
last_track_size= lba - last_track_start; last_track_size= lba - last_track_start;
num_payload+= last_track_size;
if(is_data) if(is_data)
num_data+= last_track_size; num_data+= last_track_size;
} }
} }
if(xorriso->request_to_abort) if(xorriso->request_to_abort)
return(1); return(1);
num_wasted= lba - num_payload;
num_nondata= lba - num_data;
Sfile_scale(((double) num_data) * 2048.0, mem_text,5,1e4,1); Sfile_scale(((double) num_data) * 2048.0, mem_text,5,1e4,1);
sprintf(respt, "Media summary: %d session%s, %d data blocks, %s\n", sprintf(respt, "Media summary: %d session%s, %d data blocks, %s",
num_sessions, (num_sessions==1 ? "" : "s"), num_data, mem_text); 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);
}
sprintf(respt+strlen(respt), "\n");
Xorriso_result(xorriso,0); Xorriso_result(xorriso,0);
if (s == BURN_DISC_APPENDABLE && nwa!=0) { if (s == BURN_DISC_APPENDABLE && nwa!=0) {