Banned mixed mode SAO (because broken in libburn and unclear in MMC)

This commit is contained in:
Thomas Schmitt 2007-01-22 11:42:17 +00:00
parent 7ed3bb2992
commit eaec685927
6 changed files with 70 additions and 25 deletions

View File

@ -3900,7 +3900,7 @@ int Cdrskin_blank(struct CdrskiN *skin, int flag)
int ret,loop_counter= 0,hint_force= 0,do_format= 0, profile_number= -1;
int wrote_well= 1;
double start_time;
char *verb= "format", *presperf="blanking", *fmt_text= "format_...";
char *verb= "blank", *presperf="blanking", *fmt_text= "format_...";
char profile_name[80];
static char fmtp[][40]= {
"format_default", "format_overwrite", "format_sequential"};
@ -4407,7 +4407,7 @@ int Cdrskin_activate_write_mode(struct CdrskiN *skin, enum burn_disc_status s,
int flag)
{
int ok, was_still_default= 0, block_type_demand,track_type,sector_size, i;
int profile_number= -1;
int profile_number= -1, track_type_1, mixed_mode= 0;
struct burn_drive_info *drive_info = NULL;
char profile_name[80];
@ -4416,13 +4416,19 @@ int Cdrskin_activate_write_mode(struct CdrskiN *skin, enum burn_disc_status s,
if(skin->grabbed_drive)
burn_disc_get_profile(skin->grabbed_drive,&profile_number,profile_name);
#endif
Cdrtrack_get_track_type(skin->tracklist[0],&track_type_1,&sector_size,0);
for(i=1;i<skin->track_counter;i++) {
Cdrtrack_get_track_type(skin->tracklist[i],&track_type,&sector_size,0);
if(track_type_1!=track_type)
mixed_mode= 1;
}
if(strcmp(skin->preskin->write_mode_name,"DEFAULT")==0) {
was_still_default= 1;
if(s == BURN_DISC_APPENDABLE) {
if(s == BURN_DISC_APPENDABLE || mixed_mode) {
strcpy(skin->preskin->write_mode_name,"TAO");
was_still_default= 2; /*<<< prevents trying of SAO if drive dislikes TAO*/
was_still_default= 2; /* prevents trying of SAO if drive dislikes TAO*/
} else if(profile_number==0x1a || profile_number==0x13 ||
profile_number==0x12) {
/* DVD+RW , DVD-RW Restricted Overwrite , DVD-RAM */
@ -4437,7 +4443,6 @@ int Cdrskin_activate_write_mode(struct CdrskiN *skin, enum burn_disc_status s,
#ifdef Cdrskin_allow_libburn_taO
} else if(strcmp(skin->preskin->write_mode_name,"TAO")==0) {
strcpy(skin->preskin->write_mode_name,"TAO");
skin->write_type= BURN_WRITE_TAO;
skin->block_type= BURN_BLOCK_MODE1;
#endif /* Cdrskin_allow_libburn_taO */
@ -4470,7 +4475,7 @@ check_with_drive:;
ok= 1;
} else if(skin->write_type==BURN_WRITE_RAW)
ok= !!(drive_info->raw_block_types & BURN_BLOCK_RAW96R);
else if(skin->write_type==BURN_WRITE_SAO)
else if(skin->write_type==BURN_WRITE_SAO && !mixed_mode)
ok= !!(drive_info->sao_block_types & BURN_BLOCK_SAO);
else if(skin->write_type==BURN_WRITE_TAO) {
block_type_demand= 0;
@ -4484,6 +4489,14 @@ check_with_drive:;
ok= ((drive_info->tao_block_types & block_type_demand)==block_type_demand);
}
if(skin->write_type==BURN_WRITE_SAO && mixed_mode) {
fprintf(stderr,
"cdrskin: FATAL : Cannot write mix of data and audio in SAO mode\n");
#ifdef Cdrskin_allow_libburn_taO
fprintf(stderr,"cdrskin: HINT : Try with option -tao resp. without -sao\n");
#endif
return(0);
}
if(!ok) {
fprintf(stderr,
"cdrskin: %s : Drive indicated refusal for write mode %s.\n",
@ -4541,6 +4554,10 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
ret= burn_disc_add_session(disc,session,BURN_POS_END);
if(ret==0) {
fprintf(stderr,"cdrskin: FATAL : cannot add session to disc object.\n");
burn_failed:;
if(skin->verbosity>=Cdrskin_verbose_progresS)
printf("cdrskin: burning failed\n");
fprintf(stderr,"cdrskin: FATAL : burning failed.\n");
return(0);
}
@ -4552,7 +4569,7 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
ret= Cdrtrack_add_to_session(skin->tracklist[i],i,session,hflag);
if(ret<=0) {
fprintf(stderr,"cdrskin: FATAL : cannot add track %d to session.\n",i+1);
return(0);
goto burn_failed;
}
Cdrtrack_get_size(skin->tracklist[i],&size,&padding,&sector_size,0);
if(size>0)
@ -4561,7 +4578,7 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
ret= Cdrskin_grab_drive(skin,0);
if(ret<=0)
return(ret);
goto burn_failed;
drive= skin->drives[skin->driveno].drive;
s= burn_disc_get_status(drive);
if(skin->verbosity>=Cdrskin_verbose_progresS)
@ -4570,7 +4587,7 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
if(ret<=0) {
fprintf(stderr,
"cdrskin: FATAL : Cannot activate the desired write mode\n");
ret= 0; goto ex;
goto burn_failed;
}
#ifdef Cdrskin_libburn_has_multI
@ -4582,7 +4599,7 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
if(skin->write_type!=BURN_WRITE_TAO) {
Cdrskin_release_drive(skin,0);
fprintf(stderr,"cdrskin: FATAL : For now only write mode -tao can be used with appendable disks\n");
return(0);
goto burn_failed;
}
#endif /* ! Cdrskin_allow_sao_for_appendablE */
@ -4592,7 +4609,7 @@ int Cdrskin_burn(struct CdrskiN *skin, int flag)
#endif
Cdrskin_release_drive(skin,0);
fprintf(stderr,"cdrskin: FATAL : no writeable media detected.\n");
return(0);
goto burn_failed;
}
@ -4855,13 +4872,14 @@ fifo_full_at_end:;
if(wrote_well) {
if(skin->verbosity>=Cdrskin_verbose_progresS)
printf("cdrskin: burning done\n");
} else {
} else
ret= 0;
ex:;
if(ret<=0) {
if(skin->verbosity>=Cdrskin_verbose_progresS)
printf("cdrskin: burning failed\n");
fprintf(stderr,"cdrskin: FATAL : burning failed.\n");
ret= 0;
}
ex:;
skin->drive_is_busy= 0;
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(printf("cdrskin_debug: do_eject= %d\n",skin->do_eject));

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2007.01.21.191058"
#define Cdrskin_timestamP "2007.01.22.114245"

View File

@ -323,6 +323,7 @@ static void *write_disc_worker_func(struct w_list *w)
void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
{
struct write_opts o;
int i, j, mode, mixed_mode = 0;
/* ts A61006 */
/* a ssert(!SCAN_GOING()); */
@ -347,6 +348,23 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
if (! burn_disc_write_is_ok(opts, disc)) /* issues own msgs */
return;
/* ts A70122 : libburn SAO code mishandles mode changes */
for (i = 0; i < disc->sessions; i++) {
if (disc->session[i]->tracks <= 0)
continue;
mode = disc->session[i]->track[0]->mode;
for (j = 1; j < disc->session[i]->tracks; j++)
if (mode != disc->session[i]->track[j]->mode)
mixed_mode = 1;
}
if (mixed_mode && opts->write_type == BURN_WRITE_SAO) {
libdax_msgs_submit(libdax_messenger,
opts->drive->global_index, 0x00020133,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
"Cannot mix data and audio in SAO mode", 0, 0);
return;
}
o.drive = opts->drive;
o.opts = opts;
o.disc = disc;

View File

@ -110,14 +110,18 @@ enum burn_write_types
currently unsupported
*/
BURN_WRITE_PACKET,
/** Track At Once recording.
2s gaps between tracks, no fonky lead-ins
*/
BURN_WRITE_TAO,
/** Session At Once.
block type MUST be BURN_BLOCK_SAO
Block type MUST be BURN_BLOCK_SAO
ts A70122 : Currently not capable of mixing data and audio tracks.
*/
BURN_WRITE_SAO,
/** Raw disc at once recording.
all subcodes must be provided by lib or user
only raw block types are supported
@ -925,6 +929,9 @@ void burn_disc_read(struct burn_drive *drive, const struct burn_read_opts *o);
/** Write a disc in the drive. The drive must be grabbed successfully before
calling this function. Always ensure that the drive reports a status of
BURN_DISC_BLANK before calling this function.
Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix
of data and audio tracks. You must use BURN_WRITE_TAO for such sessions.
To be set by burn_write_opts_set_write_type().
@param o The options for the writing operation.
@param disc The struct burn_disc * that described the disc to be created
*/
@ -980,7 +987,7 @@ int burn_msf_to_lba(int m, int s, int f);
*/
void burn_lba_to_msf(int lba, int *m, int *s, int *f);
/** Create a new disc (for DAO recording)*/
/** Create a new disc */
struct burn_disc *burn_disc_create(void);
/** Delete disc and decrease the reference count on all its sessions
@ -988,9 +995,7 @@ struct burn_disc *burn_disc_create(void);
*/
void burn_disc_free(struct burn_disc *d);
/** Create a new session (For SAO at once recording, or to be added to a
disc for DAO)
*/
/** Create a new session */
struct burn_session *burn_session_create(void);
/** Free a session (and decrease reference count on all tracks inside)
@ -1145,7 +1150,9 @@ void burn_structure_print_disc(struct burn_disc *d);
void burn_structure_print_session(struct burn_session *s);
void burn_structure_print_track(struct burn_track *t);
/** Sets the write type for the write_opts struct
/** Sets the write type for the write_opts struct.
Note: write_type BURN_WRITE_SAO is currently not capable of writing a mix
of data and audio tracks. You must use BURN_WRITE_TAO for such sessions.
@param opts The write opts to change
@param write_type The write type to use
@param block_type The block type to use

View File

@ -1,7 +1,8 @@
/* libdax_msgs
Message handling facility of libdax.
Copyright (C) 2006 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL
Copyright (C) 2006-2007 Thomas Schmitt <scdbackup@gmx.net>,
provided under GPL
*/
@ -349,7 +350,8 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x00020129 (SORRY,HIGH) = Will not format media type
0x00020130 (SORRY,HIGH) = Drive and media state unsuitable for blanking
0x00020131 (SORRY,HIGH) = No suitable formatting type offered by drive
0x00020132 (SORRY,HIGH) = Selected format is not suitable for libburn
0x00020133 (SORRY,HIGH) = Cannot mix data and audio in SAO mode
libdax_audioxtr:
0x00020200 (SORRY,HIGH) = Cannot open audio source file

View File

@ -428,8 +428,8 @@ struct cue_sheet *burn_create_toc_entries(struct burn_write_opts *o,
show any although 6.33.3.19 would prescribe some.
Nobody seems to have ever tested this situation, up to now.
I shall ban resp. avoid it in cdrskin and libburner. A warning will be
placed in libburn.h . Some ban is needed in burn_disc_write().
It is banned for now in burn_disc_write().
Warning have been placed in libburn.h .
*/
tar[i]->pregap2 = 1;