New capability to redirect program output used for toc in sector map file

This commit is contained in:
2008-08-13 19:08:07 +00:00
parent 9b85bc0fed
commit c0cc40121f
6 changed files with 575 additions and 267 deletions

View File

@ -3455,6 +3455,7 @@ int Xorriso_process_msg_queues(struct XorrisO *xorriso, int flag)
/* @param flag bit0=short report form
bit1=report about output drive
bit2=do not try to read ISO heads
*/
int Xorriso_toc(struct XorrisO *xorriso, int flag)
{
@ -3463,7 +3464,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
int last_track_start= 0, last_track_size= -1, num_data= 0, is_data= 0;
int is_inout_drive= 0, drive_role, status, num_formats;
int num_payload= 0, num_wasted= 0, num_nondata= 0;
char profile_name[80],*respt,*devadr;
char profile_name[80],*respt,*devadr, *typetext= "";
struct burn_toc_entry toc_entry;
struct burn_drive_info *dinfo;
struct burn_drive *drive;
@ -3556,7 +3557,12 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
}
/* fabricate TOC */
ret= isoburn_read_iso_head(drive, 0, &image_blocks, volume_id, 1);
typetext= "Other session";
if(flag & 4) {
ret= 0;
typetext= "Session ";
} else
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);
@ -3567,8 +3573,8 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
&num_formats);
if(ret>0 && status==BURN_FORMAT_IS_FORMATTED)
nwa= size/2048;
sprintf(respt, "Other session: %3d , %9d , %9ds , \n",
1, 0, nwa);
sprintf(respt, "%13s: %3d , %9d , %9ds , \n",
typetext, 1, 0, nwa);
}
if(!(flag&1))
Xorriso_result(xorriso,0);
@ -3603,7 +3609,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
track_size= burn_msf_to_lba(next_toc_entry.pmin, next_toc_entry.psec,
next_toc_entry.pframe) - lba;
}
if(flag&1)
if(flag&(1|4))
ret= 0;
else
ret= isoburn_read_iso_head(drive, lba, &image_blocks, volume_id, 1);
@ -3614,11 +3620,17 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
sprintf(respt, "ISO track : %3d , %9d , %9ds , %s\n",
track_count, lba, image_blocks , volume_id);
} else if(track_no==0) {
sprintf(respt, "Other session: %3d , %9d , %9ds , \n",
session_no+1, lba, track_size);
typetext= "Other session";
if(flag & 4)
typetext= "Session ";
sprintf(respt, "%13s: %3d , %9d , %9ds , \n",
typetext, session_no+1, lba, track_size);
} else {
sprintf(respt, "Other track : %3d , %9d , %9ds , \n",
track_count, lba, track_size);
typetext= "Other track ";
if(flag & 4)
typetext= "Track ";
sprintf(respt, "%13s: %3d , %9d , %9ds , \n",
typetext, track_count, lba, track_size);
}
if(!(flag&1))
Xorriso_result(xorriso,0);
@ -6767,7 +6779,7 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
int blocks, os_errno, i, j, last_track_end= -1, track_blocks, track_lba;
int num_sessions, num_tracks, declare_untested= 0, sector_size, count;
int lba, quality;
char sfe[5*SfileadrL];
char sfe[5*SfileadrL], *toc_info= NULL;
struct burn_drive *drive;
struct burn_drive_info *dinfo;
struct isoburn_toc_disc *isoburn_disc= NULL;
@ -6783,6 +6795,7 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
if(ret<=0)
goto ex;
/* >>> determine media type dependent blocking factor:
2 kB for CD and disk , 32 kB for DVD, 64 kB for BD
eventually adjust min_block_size and read_chunk
@ -6806,6 +6819,7 @@ int Xorriso_check_media(struct XorrisO *xorriso, struct SpotlisT **spotlist,
goto ex;
}
}
Xorriso_toc_to_string(xorriso, &toc_info, 4 * !job->map_with_volid);
}
if(job->data_to_path[0]) {
@ -6925,7 +6939,7 @@ ex:;
ret= Xorriso_spotlist_to_sectormap(xorriso, *spotlist, sector_size,
&(job->sector_map), 0);
if(ret > 0) {
ret= Sectorbitmap_to_file(job->sector_map, job->sector_map_path,
ret= Sectorbitmap_to_file(job->sector_map, job->sector_map_path, toc_info,
xorriso->info_text, &os_errno, 0);
if(ret <= 0) {
if(xorriso->info_text[0])
@ -6934,6 +6948,8 @@ ex:;
}
}
}
if(toc_info != NULL)
free(toc_info);
if(ret < 0)
Spotlist_destroy(spotlist, 0);
return(ret);