New format with -toc is more concise and shows volume id

This commit is contained in:
Thomas Schmitt 2008-05-07 21:44:28 +00:00
parent f51c13a87f
commit 4c55ac810d
2 changed files with 91 additions and 4 deletions

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.05.07.214343"
#define Xorriso_timestamP "2008.05.07.214442"

View File

@ -2230,13 +2230,17 @@ int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
#define Xorriso_use_isoburn_toC yes
/*
*/
#define Xorriso_new_toc_formaT yes
/* @param flag bit0=short report form
bit1=report about output drive
*/
int Xorriso_toc(struct XorrisO *xorriso, int flag)
{
int num_sessions= 0, num_tracks= 0, lba= 0, nwa= -1, pmin, psec, pframe, ret;
int track_count= 0, session_no, track_no, profile_no= -1;
int track_count= 0, session_no, track_no, profile_no= -1, track_size;
int last_track_start= 0, last_track_size= -1, num_data= 0, is_data= 0;
int is_inout_drive= 0, drive_role;
int num_payload= 0, num_wasted= 0, num_nondata= 0;
@ -2258,6 +2262,12 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
struct burn_track **tracks;
#endif /* ! Xorriso_use_isoburn_toC */
#ifdef Xorriso_new_toc_formaT
int image_blocks;
char volume_id[33];
struct burn_toc_entry next_toc_entry;
#endif
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to print Table Of Content", flag&2);
if(ret<=0)
@ -2323,6 +2333,15 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
disc= burn_drive_get_disc(drive);
#endif
#ifdef Xorriso_new_toc_formaT
sprintf(respt, "TOC layout : %3s , %9s , %10s , %s\n",
"Idx", "Start LBA", "Size", "Volume Id");
if(!(flag&1))
Xorriso_result(xorriso,0);
#endif
if (disc==NULL) {
Xorriso_process_msg_queues(xorriso,0);
ret= isoburn_get_min_start_byte(drive, &start_byte, 0);
@ -2335,14 +2354,32 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
return(0);
}
/* fabricate TOC */
#ifdef Xorriso_new_toc_formaT
ret= isoburn_read_iso_head(drive, 0, &image_blocks, volume_id, 1);
if(ret>0) {
sprintf(respt, "ISO session : %3d , %9d , %9ds , %s\n",
1, 0, image_blocks, volume_id);
} else {
sprintf(respt, "Other session: %3d , %9d , %9ds , \n",
1, 0, nwa);
}
#else /* Xorriso_new_toc_formaT */
sprintf(respt, "Media content: session %2d ", 1);
sprintf(respt+strlen(respt), "track %2d %s lba: %9d\n", 1, "data ", 0);
sprintf(respt+strlen(respt), "track %2d %s lba: %8d\n", 1, "data ", 0);
if(!(flag&1))
Xorriso_result(xorriso,0);
last_track_start= lba;
sprintf(respt, "Media content: session %2d ", 1);
sprintf(respt+strlen(respt), "leadout lba: %9d\n", nwa);
#endif /* ! Xorriso_new_toc_formaT */
if(!(flag&1))
Xorriso_result(xorriso,0);
num_payload= num_data= last_track_size= nwa;
@ -2379,12 +2416,58 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
if (toc_entry.extensions_valid & 1) {
/* DVD extension valid */
lba= toc_entry.start_lba;
track_size= toc_entry.track_blocks;
} else {
lba= burn_msf_to_lba(toc_entry.pmin, toc_entry.psec, toc_entry.pframe);
lba= burn_msf_to_lba(toc_entry.pmin, toc_entry.psec,
toc_entry.pframe);
if(track_no==num_tracks-1) {
#ifdef Xorriso_use_isoburn_toC
isoburn_toc_session_get_leadout_entry(sessions[session_no],
&next_toc_entry);
#else
burn_session_get_leadout_entry(sessions[session_no],
&next_toc_entry);
#endif
} else {
#ifdef Xorriso_use_isoburn_toC
isoburn_toc_track_get_entry(tracks[track_no+1], &next_toc_entry);
#else
burn_track_get_entry(tracks[track_no+1], &next_toc_entry);
#endif
}
track_size= burn_msf_to_lba(next_toc_entry.pmin, next_toc_entry.psec,
next_toc_entry.pframe) - lba;
}
#ifdef Xorriso_new_toc_formaT
ret= isoburn_read_iso_head(drive, lba, &image_blocks, volume_id, 1);
if(ret>0 && track_no==num_tracks-1) {
sprintf(respt, "ISO session : %3d , %9d , %9ds , %s\n",
session_no+1, lba, image_blocks , volume_id);
} else if(ret>0 && track_no==num_tracks-1) {
sprintf(respt, "ISO track : %3d , %9d , %9ds , %s\n",
track_count, lba, image_blocks , volume_id);
} else if(track_no==num_tracks-1) {
sprintf(respt, "Other session: %3d , %9d , %9ds , \n",
session_no+1, lba, track_size);
} else {
sprintf(respt, "Other track : %3d , %9d , %9ds , \n",
track_count, lba, track_size);
}
#else /* Xorriso_new_toc_formaT */
sprintf(respt, "Media content: session %2d ", session_no+1);
sprintf(respt+strlen(respt), "track %2d %s lba: %9d\n",
track_count, ((toc_entry.control&7)<4?"audio":"data "), lba);
#endif /* ! Xorriso_new_toc_formaT */
if(!(flag&1))
Xorriso_result(xorriso,0);
if(track_no>0)
@ -2407,10 +2490,14 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
lba= burn_msf_to_lba(pmin, psec, pframe);
lba= burn_msf_to_lba(toc_entry.pmin, toc_entry.psec, toc_entry.pframe);
}
#ifndef Xorriso_new_toc_formaT
sprintf(respt, "Media content: session %2d ", session_no+1);
sprintf(respt+strlen(respt), "leadout lba: %9d\n", lba);
if(!(flag&1))
Xorriso_result(xorriso,0);
#endif /* ! Xorriso_new_toc_formaT */
last_track_size= lba - last_track_start;
num_payload+= last_track_size;
if(is_data)