New -toc report lines "Drive id :" and "Media id :".

This commit is contained in:
2015-10-18 13:00:02 +00:00
parent 54ebdfe339
commit fdf10cadc1
3 changed files with 36 additions and 4 deletions

View File

@ -991,9 +991,8 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
int disk_category, part_version, num_layers, num_blocks;
char *book_name;
int num_data_from_format= 0;
/*
int num_payload= 0, num_wasted= 0, num_nondata= 0;
*/
char *sno = NULL;
int sno_len, i;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to print Table Of Content",
@ -1021,6 +1020,17 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
Xorriso_toc_line(xorriso, flag & 8);
if(flag & 32)
{ret= 1; goto ex;}
if(!(flag & 1)) {
burn_drive_get_serial_no(drive, &sno, &sno_len);
if(sno_len > 0) {
sprintf(respt, "Drive id : '%s'\n", sno);
Xorriso_toc_line(xorriso, flag & 8);
}
if(sno != NULL)
free(sno);
sno= NULL;
}
ret= burn_disc_get_profile(drive, &profile_no, profile_name);
s= isoburn_disc_get_status(drive);
@ -1089,6 +1099,24 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
if((s == BURN_DISC_FULL || s == BURN_DISC_APPENDABLE ||
s == BURN_DISC_BLANK) && !(flag & 1)) {
burn_drive_get_media_sno(drive, &sno, &sno_len);
if(sno_len > 0) {
sprintf(respt, "Media id : ");
respt+= strlen(respt);
for(i= 0; i < sno_len && i < 1024; i++) {
sprintf(respt, "%2.2X", (unsigned int) ((unsigned char *) sno)[i]);
respt+= 2;
}
if(i < sno_len)
strcat(respt, "...");
strcat(respt, "\n");
Xorriso_toc_line(xorriso, flag & 8);
}
if(sno != NULL)
free(sno);
sno= NULL;
respt= xorriso->result_line;
ret= burn_get_read_capacity(drive, &num_data, 0);
if(ret != 1 || s == BURN_DISC_BLANK)
num_data= 0;