Reporting "Media product:" with xorriso option -toc

This commit is contained in:
Thomas Schmitt 2009-09-06 11:27:47 +00:00
parent b43d90d736
commit 18438856c8
2 changed files with 58 additions and 1 deletions

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.09.06.094209"
#define Xorriso_timestamP "2009.09.06.112851"

View File

@ -5150,12 +5150,63 @@ no_boot:;
}
/* @param flag
bit1=report about output drive
bit3=report to info channel (else to result channel)
bit4=do no report failure if no drive aquired
*/
int Xorriso_media_product(struct XorrisO *xorriso, int flag)
{
int ret, profile_no;
struct burn_drive_info *dinfo;
struct burn_drive *drive;
char *product_id= NULL, *media_code1= NULL, *media_code2= NULL;
char *book_type= NULL, *manuf= NULL, profile_name[80], *respt;
respt= xorriso->result_line;
ret= Xorriso_get_drive_handles(xorriso, &dinfo, &drive,
"on attempt to print media product info",
flag & (2 | 16));
if(ret <= 0)
return(ret);
ret= burn_disc_get_media_id(drive, &product_id, &media_code1, &media_code2,
&book_type, 0);
if(ret > 0) {
ret= burn_disc_get_profile(drive, &profile_no, profile_name);
if(ret <= 0)
return(ret);
sprintf(respt, "Media product: %s , ", product_id);
manuf= burn_guess_manufacturer(profile_no, media_code1, media_code2, 0);
if(manuf != NULL) {
if(strncmp(manuf, "Unknown ", 8) == 0)
sprintf(respt + strlen(respt), "(not found in manufacturer list)\n");
else
sprintf(respt + strlen(respt), "%s\n", manuf);
} else
sprintf(respt + strlen(respt), "(error during manufacturer lookup)\n");
free(product_id);
free(media_code1);
free(media_code2);
if(book_type != NULL)
free(book_type);
if(manuf != NULL)
free(manuf);
Xorriso_toc_line(xorriso, flag & 8);
}
Xorriso_process_msg_queues(xorriso,0);
return(1);
}
/* @param flag bit0=short report form
bit1=report about output drive
bit2=do not try to read ISO heads
bit3=report to info channel (else to result channel)
bit4=do no report failure if no drive aquired
bit5=only report "Drive current" and "Drive type"
bit6=report "Media product" with bit0
*/
int Xorriso_toc(struct XorrisO *xorriso, int flag)
{
@ -5224,6 +5275,12 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag)
sprintf(respt+strlen(respt), "is not recognizable\n");
Xorriso_toc_line(xorriso, flag & 8);
if((flag & 64) || !(flag & 1)) {
Xorriso_media_product(xorriso, flag & (2 | 8 | 16));
if(xorriso->request_to_abort)
return(1);
}
sprintf(respt, "Media status : ");
if (s == BURN_DISC_FULL) {
sprintf(respt+strlen(respt), "is written , is closed\n");