Avoided to report "Supported modes: SAO TAO" with xorrecord -atip on ROM drives

This commit is contained in:
Thomas Schmitt 2011-10-25 16:01:11 +00:00
parent d08d619a8c
commit eec01e5bfc
2 changed files with 26 additions and 4 deletions

View File

@ -1670,6 +1670,8 @@ int Xorriso_list_profiles(struct XorrisO *xorriso, int flag)
int Xorriso_atip(struct XorrisO *xorriso, int flag)
{
int ret, profile_number= 0;
int num_profiles= 0, profiles[64], i, can_write= 0, pf;
char is_current[64];
char *respt, profile_name[80];
double x_speed_max, x_speed_min= -1.0;
struct burn_drive_info *dinfo;
@ -1709,9 +1711,29 @@ int Xorriso_atip(struct XorrisO *xorriso, int flag)
Xorriso_result(xorriso,1);
if(flag&1)
return(1);
sprintf(respt, "Driver flags : BURNFREE\n");
sprintf(respt+strlen(respt), "Supported modes: SAO TAO\n");
Xorriso_result(xorriso,1);
/* Do not report "Supported modes: SAO TAO" with -ROM drives */
burn_drive_get_all_profiles(drive, &num_profiles, profiles, is_current);
if(num_profiles > 0) {
for(i= 0; i < num_profiles; i++) {
pf= profiles[i];
if(pf == 0x09 || pf == 0x0a || pf == 0x11 || pf == 0x12 || pf == 0x13 ||
pf == 0x14 || pf == 0x15 || pf == 0x1a || pf == 0x1b || pf == 0x2b ||
pf == 0x41 || pf == 0x43 || pf == 0xffff) {
can_write= 1;
break;
}
}
} else
can_write= 1;
if(can_write) {
sprintf(respt, "Driver flags : BURNFREE\n");
sprintf(respt+strlen(respt), "Supported modes: SAO TAO\n");
Xorriso_result(xorriso,1);
} else if(flag & 2) {
sprintf(xorriso->info_text, "Not a CD/DVD/BD recorder");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
}
if(flag&2)
return(1);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.10.25.103839"
#define Xorriso_timestamP "2011.10.25.160042"