New format with -toc is more concise and shows volume id
This commit is contained in:
parent
e92b796215
commit
252521f930
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2008.05.07.214343"
|
#define Xorriso_timestamP "2008.05.07.214442"
|
||||||
|
@ -2230,13 +2230,17 @@ int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
|
|||||||
|
|
||||||
#define Xorriso_use_isoburn_toC yes
|
#define Xorriso_use_isoburn_toC yes
|
||||||
|
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
#define Xorriso_new_toc_formaT yes
|
||||||
|
|
||||||
/* @param flag bit0=short report form
|
/* @param flag bit0=short report form
|
||||||
bit1=report about output drive
|
bit1=report about output drive
|
||||||
*/
|
*/
|
||||||
int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
||||||
{
|
{
|
||||||
int num_sessions= 0, num_tracks= 0, lba= 0, nwa= -1, pmin, psec, pframe, ret;
|
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 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;
|
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;
|
struct burn_track **tracks;
|
||||||
#endif /* ! Xorriso_use_isoburn_toC */
|
#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,
|
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
|
||||||
"on attempt to print Table Of Content", flag&2);
|
"on attempt to print Table Of Content", flag&2);
|
||||||
if(ret<=0)
|
if(ret<=0)
|
||||||
@ -2323,6 +2333,15 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|||||||
disc= burn_drive_get_disc(drive);
|
disc= burn_drive_get_disc(drive);
|
||||||
#endif
|
#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) {
|
if (disc==NULL) {
|
||||||
Xorriso_process_msg_queues(xorriso,0);
|
Xorriso_process_msg_queues(xorriso,0);
|
||||||
ret= isoburn_get_min_start_byte(drive, &start_byte, 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);
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fabricate TOC */
|
/* 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, "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))
|
if(!(flag&1))
|
||||||
Xorriso_result(xorriso,0);
|
Xorriso_result(xorriso,0);
|
||||||
last_track_start= lba;
|
last_track_start= lba;
|
||||||
sprintf(respt, "Media content: session %2d ", 1);
|
sprintf(respt, "Media content: session %2d ", 1);
|
||||||
sprintf(respt+strlen(respt), "leadout lba: %9d\n", nwa);
|
sprintf(respt+strlen(respt), "leadout lba: %9d\n", nwa);
|
||||||
|
|
||||||
|
#endif /* ! Xorriso_new_toc_formaT */
|
||||||
|
|
||||||
if(!(flag&1))
|
if(!(flag&1))
|
||||||
Xorriso_result(xorriso,0);
|
Xorriso_result(xorriso,0);
|
||||||
num_payload= num_data= last_track_size= nwa;
|
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) {
|
if (toc_entry.extensions_valid & 1) {
|
||||||
/* DVD extension valid */
|
/* DVD extension valid */
|
||||||
lba= toc_entry.start_lba;
|
lba= toc_entry.start_lba;
|
||||||
|
track_size= toc_entry.track_blocks;
|
||||||
} else {
|
} 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, "Media content: session %2d ", session_no+1);
|
||||||
sprintf(respt+strlen(respt), "track %2d %s lba: %9d\n",
|
sprintf(respt+strlen(respt), "track %2d %s lba: %9d\n",
|
||||||
track_count, ((toc_entry.control&7)<4?"audio":"data "), lba);
|
track_count, ((toc_entry.control&7)<4?"audio":"data "), lba);
|
||||||
|
|
||||||
|
#endif /* ! Xorriso_new_toc_formaT */
|
||||||
|
|
||||||
if(!(flag&1))
|
if(!(flag&1))
|
||||||
Xorriso_result(xorriso,0);
|
Xorriso_result(xorriso,0);
|
||||||
if(track_no>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(pmin, psec, pframe);
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef Xorriso_new_toc_formaT
|
||||||
sprintf(respt, "Media content: session %2d ", session_no+1);
|
sprintf(respt, "Media content: session %2d ", session_no+1);
|
||||||
sprintf(respt+strlen(respt), "leadout lba: %9d\n", lba);
|
sprintf(respt+strlen(respt), "leadout lba: %9d\n", lba);
|
||||||
if(!(flag&1))
|
if(!(flag&1))
|
||||||
Xorriso_result(xorriso,0);
|
Xorriso_result(xorriso,0);
|
||||||
|
#endif /* ! Xorriso_new_toc_formaT */
|
||||||
|
|
||||||
last_track_size= lba - last_track_start;
|
last_track_size= lba - last_track_start;
|
||||||
num_payload+= last_track_size;
|
num_payload+= last_track_size;
|
||||||
if(is_data)
|
if(is_data)
|
||||||
|
Loading…
Reference in New Issue
Block a user