Making use of new isoburn_toc_* functions
This commit is contained in:
parent
e9171b5133
commit
585445ccc8
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2008.05.07.175508"
|
#define Xorriso_timestamP "2008.05.07.175640"
|
||||||
|
@ -2228,6 +2228,8 @@ int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define Xorriso_use_isoburn_toC yes
|
||||||
|
|
||||||
/* @param flag bit0=short report form
|
/* @param flag bit0=short report form
|
||||||
bit1=report about output drive
|
bit1=report about output drive
|
||||||
*/
|
*/
|
||||||
@ -2239,9 +2241,6 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|||||||
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;
|
||||||
char profile_name[80],*respt,*devadr;
|
char profile_name[80],*respt,*devadr;
|
||||||
struct burn_disc *disc= NULL;
|
|
||||||
struct burn_session **sessions;
|
|
||||||
struct burn_track **tracks;
|
|
||||||
struct burn_toc_entry toc_entry;
|
struct burn_toc_entry toc_entry;
|
||||||
struct burn_drive_info *dinfo;
|
struct burn_drive_info *dinfo;
|
||||||
struct burn_drive *drive;
|
struct burn_drive *drive;
|
||||||
@ -2249,6 +2248,16 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|||||||
char mem_text[80];
|
char mem_text[80];
|
||||||
off_t start_byte= 0, num_free= 0;
|
off_t start_byte= 0, num_free= 0;
|
||||||
|
|
||||||
|
#ifdef Xorriso_use_isoburn_toC
|
||||||
|
struct isoburn_toc_disc *disc= NULL;
|
||||||
|
struct isoburn_toc_session **sessions;
|
||||||
|
struct isoburn_toc_track **tracks;
|
||||||
|
#else
|
||||||
|
struct burn_disc *disc= NULL;
|
||||||
|
struct burn_session **sessions;
|
||||||
|
struct burn_track **tracks;
|
||||||
|
#endif /* ! Xorriso_use_isoburn_toC */
|
||||||
|
|
||||||
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)
|
||||||
@ -2308,11 +2317,16 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|||||||
if(xorriso->request_to_abort)
|
if(xorriso->request_to_abort)
|
||||||
return(1);
|
return(1);
|
||||||
|
|
||||||
|
#ifdef Xorriso_use_isoburn_toC
|
||||||
|
disc= isoburn_toc_drive_get_disc(drive);
|
||||||
|
#else
|
||||||
disc= burn_drive_get_disc(drive);
|
disc= burn_drive_get_disc(drive);
|
||||||
|
#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);
|
||||||
nwa= start_byte / 2048;
|
nwa= start_byte / 2048;
|
||||||
if(ret<=0) {
|
if(ret<=0) {
|
||||||
Xorriso_process_msg_queues(xorriso,0);
|
Xorriso_process_msg_queues(xorriso,0);
|
||||||
if(flag&1)
|
if(flag&1)
|
||||||
@ -2334,17 +2348,34 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|||||||
num_payload= num_data= last_track_size= nwa;
|
num_payload= num_data= last_track_size= nwa;
|
||||||
num_sessions= 1;
|
num_sessions= 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
#ifdef Xorriso_use_isoburn_toC
|
||||||
|
sessions= isoburn_toc_disc_get_sessions(disc, &num_sessions);
|
||||||
|
#else
|
||||||
sessions= burn_disc_get_sessions(disc, &num_sessions);
|
sessions= burn_disc_get_sessions(disc, &num_sessions);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (session_no= 0; session_no<num_sessions && !(xorriso->request_to_abort);
|
for (session_no= 0; session_no<num_sessions && !(xorriso->request_to_abort);
|
||||||
session_no++) {
|
session_no++) {
|
||||||
tracks = burn_session_get_tracks(sessions[session_no], &num_tracks);
|
|
||||||
|
#ifdef Xorriso_use_isoburn_toC
|
||||||
|
tracks= isoburn_toc_session_get_tracks(sessions[session_no], &num_tracks);
|
||||||
|
#else
|
||||||
|
tracks= burn_session_get_tracks(sessions[session_no], &num_tracks);
|
||||||
|
#endif
|
||||||
if (tracks==NULL)
|
if (tracks==NULL)
|
||||||
continue;
|
continue;
|
||||||
for(track_no= 0; track_no<num_tracks && !(xorriso->request_to_abort);
|
for(track_no= 0; track_no<num_tracks && !(xorriso->request_to_abort);
|
||||||
track_no++) {
|
track_no++) {
|
||||||
track_count++;
|
track_count++;
|
||||||
is_data= 0;
|
is_data= 0;
|
||||||
|
|
||||||
|
#ifdef Xorriso_use_isoburn_toC
|
||||||
|
isoburn_toc_track_get_entry(tracks[track_no], &toc_entry);
|
||||||
|
#else
|
||||||
burn_track_get_entry(tracks[track_no], &toc_entry);
|
burn_track_get_entry(tracks[track_no], &toc_entry);
|
||||||
|
#endif
|
||||||
|
|
||||||
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;
|
||||||
@ -2362,7 +2393,13 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|||||||
if((toc_entry.control&7)>=4) /* data track */
|
if((toc_entry.control&7)>=4) /* data track */
|
||||||
is_data= 1;
|
is_data= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Xorriso_use_isoburn_toC
|
||||||
|
isoburn_toc_session_get_leadout_entry(sessions[session_no], &toc_entry);
|
||||||
|
#else
|
||||||
burn_session_get_leadout_entry(sessions[session_no], &toc_entry);
|
burn_session_get_leadout_entry(sessions[session_no], &toc_entry);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (toc_entry.extensions_valid & 1) {
|
if (toc_entry.extensions_valid & 1) {
|
||||||
lba= toc_entry.start_lba;
|
lba= toc_entry.start_lba;
|
||||||
burn_lba_to_msf(lba, &pmin, &psec, &pframe);
|
burn_lba_to_msf(lba, &pmin, &psec, &pframe);
|
||||||
@ -2386,20 +2423,11 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|||||||
num_nondata= lba - num_data;
|
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);
|
||||||
|
|
||||||
#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",
|
sprintf(respt, "Media summary: %d session%s, %d data blocks, %s data",
|
||||||
num_sessions, (num_sessions==1 ? "" : "s"), num_data, mem_text);
|
num_sessions, (num_sessions==1 ? "" : "s"), num_data, mem_text);
|
||||||
num_free= isoburn_disc_available_space(drive, NULL);
|
num_free= isoburn_disc_available_space(drive, NULL);
|
||||||
Sfile_scale((double) num_free, mem_text,5,1e4,1);
|
Sfile_scale((double) num_free, mem_text,5,1e4,1);
|
||||||
sprintf(respt+strlen(respt), ", %s free", mem_text);
|
sprintf(respt+strlen(respt), ", %s free", mem_text);
|
||||||
#endif
|
|
||||||
|
|
||||||
sprintf(respt+strlen(respt), "\n");
|
sprintf(respt+strlen(respt), "\n");
|
||||||
Xorriso_result(xorriso,0);
|
Xorriso_result(xorriso,0);
|
||||||
@ -2414,7 +2442,13 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (disc!=NULL)
|
if (disc!=NULL)
|
||||||
|
|
||||||
|
#ifdef Xorriso_use_isoburn_toC
|
||||||
|
isoburn_toc_disc_free(disc);
|
||||||
|
#else
|
||||||
burn_disc_free(disc);
|
burn_disc_free(disc);
|
||||||
|
#endif
|
||||||
|
|
||||||
Xorriso_process_msg_queues(xorriso,0);
|
Xorriso_process_msg_queues(xorriso,0);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user