-rom_toc_scan nonrom_off disables toc emulation on overwriteables

This commit is contained in:
2008-10-05 07:55:20 +00:00
parent c61358cd16
commit 943d196710
7 changed files with 61 additions and 22 deletions

View File

@ -58,7 +58,7 @@ extern void *libisoburn_default_msgs_submit_handle;
extern int libisoburn_default_msgs_submit_flag;
int isoburn_emulate_toc(struct burn_drive *d, int flag);
static int isoburn_emulate_toc(struct burn_drive *d, int flag);
int isoburn_initialize(char msg[1024], int flag)
@ -263,6 +263,7 @@ int isoburn_is_intermediate_dvd_rw(struct burn_drive *d, int flag)
@param flag bit0= pretent blank on overwriteable media
bit3= if the drive reports a -ROM profile then try to read
table of content by scanning for ISO image headers.
bit4= do not emulate TOC on overwriteable media
*/
static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
int flag)
@ -312,11 +313,13 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
(*o)->emulation_mode= -1;
goto ex;
}
/* try to read emulated toc */
ret= isoburn_emulate_toc(d, 0);
if(ret<0) {
(*o)->emulation_mode= -1;
goto ex;
if(!(flag & 16)) {
/* try to read emulated toc */
ret= isoburn_emulate_toc(d, 0);
if(ret<0) {
(*o)->emulation_mode= -1;
goto ex;
}
}
}
@ -326,9 +329,13 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
if(readonly) {
/* This might be overwriteable media in a -ROM drive */
ret= isoburn_emulate_toc(d, 1);
if(ret<0)
goto ex;
if((flag & 16)) {
ret= 0;
} else {
ret= isoburn_emulate_toc(d, 1);
if(ret<0)
goto ex;
}
if(ret==0 && profile !=0x08 && (flag&8)) {
/* This might also be multi-session media which do not
get shown with a decent TOC.
@ -373,24 +380,38 @@ ex:
table of content by scanning for ISO image headers.
(depending on media type and drive state this might
help or it might make the resulting toc even worse)
bit4= do not emulate TOC on overwriteable media
*/
int isoburn_drive_aquire(struct burn_drive_info *drive_infos[],
char *adr, int flag)
{
int ret, conv_ret, drive_grabbed= 0;
char libburn_drive_adr[BURN_DRIVE_ADR_LEN];
int ret, drive_grabbed= 0;
struct isoburn *o= NULL;
#ifndef NIX
/* <<< should be obsolete by new drive addressing of libburn-0.5.2 */
/* >>> but helps with kernel 2.4 to use /dev/sr */
int conv_ret;
char libburn_drive_adr[BURN_DRIVE_ADR_LEN];
conv_ret= burn_drive_convert_fs_adr(adr, libburn_drive_adr);
if(conv_ret<=0)
strcpy(libburn_drive_adr, adr);
ret= burn_drive_scan_and_grab(drive_infos, libburn_drive_adr, flag&1);
#else
ret= burn_drive_scan_and_grab(drive_infos, adr, flag & 1);
#endif /* ! NIX */
if(ret<=0)
goto ex;
drive_grabbed= 1;
ret= isoburn_welcome_media(&o, (*drive_infos)[0].drive,
(flag&8) | !!(flag&2));
(flag & 24) | !!(flag&2));
if(ret<=0)
goto ex;

View File

@ -364,6 +364,7 @@ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
table of content by scanning for ISO image headers.
(depending on media type and drive this might
help or it might make the resulting toc even worse)
bit4= do not emulate table of content on overwriteable media
@return 1 = success , 0 = drive not found , <0 = other error
*/
int isoburn_drive_aquire(struct burn_drive_info *drive_infos[],