New -format types by_index and fast_by_index
This commit is contained in:
parent
073da62d73
commit
8abcf1c238
@ -954,7 +954,7 @@ newly purchased BD-RE, re-format DVD-RAM or BD-RE.
|
|||||||
.br
|
.br
|
||||||
Defined modes are:
|
Defined modes are:
|
||||||
.br
|
.br
|
||||||
as_needed, full, fast
|
as_needed, full, fast, by_index_<num>, fast_by_index_<num>
|
||||||
.br
|
.br
|
||||||
"as_needed" formats yet unformatted DVD-RW, DVD-RAM, BD-RE. Other media
|
"as_needed" formats yet unformatted DVD-RW, DVD-RAM, BD-RE. Other media
|
||||||
are left untouched.
|
are left untouched.
|
||||||
@ -963,26 +963,40 @@ are left untouched.
|
|||||||
.br
|
.br
|
||||||
"fast" does the same as "full" but tries to be quicker.
|
"fast" does the same as "full" but tries to be quicker.
|
||||||
.br
|
.br
|
||||||
This action has no effect on media if -dummy is activated.
|
"by_index_" selects a format out of the descriptor list issued by option
|
||||||
|
-list_formats. The index number from that list is to be appended to the
|
||||||
|
mode word. E.g: "by_index_3".
|
||||||
.br
|
.br
|
||||||
Be warned that re-formatting DVD+RW is considered to be risky
|
"fast_by_index_" does the same as "by_index_" but tries to be quicker.
|
||||||
to the media's health. DVD+RW get formatted as far as needed
|
|
||||||
during writing, but an entirely formatted media might be better
|
|
||||||
readable in some DVD players.
|
|
||||||
.br
|
.br
|
||||||
On the other hand unreliable DVD+RW can sometimes be repaired by
|
The formatting action has no effect on media if -dummy is activated.
|
||||||
re-formatting.
|
.br
|
||||||
|
Formatting is normally needed only once during the lifetime of a media,
|
||||||
|
if ever. But it is a reason for re-formatting if:
|
||||||
|
.br
|
||||||
|
DVD-RW was deformatted by -blank,
|
||||||
|
.br
|
||||||
|
DVD+RW has read failures (re-formatting might help or not),
|
||||||
|
.br
|
||||||
|
DVD-RAM or BD-RE shall change their amount of defect reserve.
|
||||||
.br
|
.br
|
||||||
The progress reports issued by some drives while formatting are
|
The progress reports issued by some drives while formatting are
|
||||||
quite unrealistic. Do not conclude success or failure from the
|
quite unrealistic. Do not conclude success or failure from the
|
||||||
reported percentages. Formatting was successful if no SORRY event
|
reported percentages. Formatting was successful if no SORRY event
|
||||||
or worse occured.
|
or worse occured. Be patient with apparently frozen progress.
|
||||||
.TP
|
.TP
|
||||||
\fB\-list_formats\fR
|
\fB\-list_formats\fR
|
||||||
Put out a list of format descriptors as reported by the output drive for
|
Put out a list of format descriptors as reported by the output drive for
|
||||||
the current media. The list gives a "Format idx" number, a MMC profile
|
the current media. The list gives the index number after "Format idx",
|
||||||
code (like "00h" or "26h"), the announced size in blocks (like "2236704s")
|
a MMC format code, the announced size in blocks (like "2236704s")
|
||||||
and the same size in MiB.
|
and the same size in MiB.
|
||||||
|
.br
|
||||||
|
MMC format codes are manifold. Most important are:
|
||||||
|
"00h" general formatting, "01h" increases reserve space for DVD-RAM,
|
||||||
|
"26h" for DVD+RW, "30h" for BD-RE with reserve space,
|
||||||
|
"31h" for BD-RE without reserve space.
|
||||||
|
.br
|
||||||
|
Smaller format size with DVD-RAM or BD-RE means more reserve space.
|
||||||
.TP
|
.TP
|
||||||
.B Settings for data insertion:
|
.B Settings for data insertion:
|
||||||
.TP
|
.TP
|
||||||
|
@ -7712,7 +7712,7 @@ int Xorriso_option_ban_stdio_write(struct XorrisO *xorriso, int flag)
|
|||||||
int Xorriso_option_blank(struct XorrisO *xorriso, char *mode, int flag)
|
int Xorriso_option_blank(struct XorrisO *xorriso, char *mode, int flag)
|
||||||
{
|
{
|
||||||
char drive_name[SfileadrL], *cmd= "-blank";
|
char drive_name[SfileadrL], *cmd= "-blank";
|
||||||
int aq_ret, ret, aq_flag= 2, mode_flag, as_needed= 0;
|
int aq_ret, ret, aq_flag= 2, mode_flag, as_needed= 0, idx;
|
||||||
|
|
||||||
if(flag&1)
|
if(flag&1)
|
||||||
cmd= "-format";
|
cmd= "-format";
|
||||||
@ -7748,7 +7748,28 @@ int Xorriso_option_blank(struct XorrisO *xorriso, char *mode, int flag)
|
|||||||
mode_flag= 3;
|
mode_flag= 3;
|
||||||
else if(strcmp(mode, "fast")==0)
|
else if(strcmp(mode, "fast")==0)
|
||||||
mode_flag= 1;
|
mode_flag= 1;
|
||||||
else if(mode[0]==0)
|
else if(strncmp(mode, "by_index_", 9)==0 && (flag&1)) {
|
||||||
|
mode_flag= 128;
|
||||||
|
idx= -1;
|
||||||
|
if(strlen(mode)>9)
|
||||||
|
sscanf(mode+9, "%d", &idx);
|
||||||
|
if(idx<0 || idx>255) {
|
||||||
|
unusable_index:;
|
||||||
|
sprintf(xorriso->info_text,
|
||||||
|
"-format: mode '%s' provides unusable index number", mode);
|
||||||
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
mode_flag|= (idx<<8);
|
||||||
|
} else if(strncmp(mode, "fast_by_index_", 14)==0 && (flag&1)) {
|
||||||
|
mode_flag= 1 | 128;
|
||||||
|
idx= -1;
|
||||||
|
if(strlen(mode)>14)
|
||||||
|
sscanf(mode+14, "%d", &idx);
|
||||||
|
if(idx<0 || idx>255)
|
||||||
|
goto unusable_index;
|
||||||
|
mode_flag|= (idx<<8);
|
||||||
|
} else if(mode[0]==0)
|
||||||
mode_flag= !(flag&1);
|
mode_flag= !(flag&1);
|
||||||
else {
|
else {
|
||||||
sprintf(xorriso->info_text,
|
sprintf(xorriso->info_text,
|
||||||
@ -7760,7 +7781,7 @@ int Xorriso_option_blank(struct XorrisO *xorriso, char *mode, int flag)
|
|||||||
if(as_needed)
|
if(as_needed)
|
||||||
ret= Xorriso_blank_as_needed(xorriso, (flag&1)<<2);
|
ret= Xorriso_blank_as_needed(xorriso, (flag&1)<<2);
|
||||||
else if(flag&1)
|
else if(flag&1)
|
||||||
ret= Xorriso_format_media(xorriso, mode_flag&1);
|
ret= Xorriso_format_media(xorriso, mode_flag & 0xff81);
|
||||||
else
|
else
|
||||||
ret= Xorriso_blank_media(xorriso, mode_flag&3);
|
ret= Xorriso_blank_media(xorriso, mode_flag&3);
|
||||||
if(ret==0)
|
if(ret==0)
|
||||||
@ -9020,8 +9041,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
|
|||||||
" Allow for writing only the usage of optical drives.",
|
" Allow for writing only the usage of optical drives.",
|
||||||
" -blank \"fast\"|\"all\"|\"deformat\"|\"deformat_quickest\"",
|
" -blank \"fast\"|\"all\"|\"deformat\"|\"deformat_quickest\"",
|
||||||
" Blank media resp. invalidate ISO image on media.",
|
" Blank media resp. invalidate ISO image on media.",
|
||||||
" -format \"full\"",
|
" -format \"as_needed\"|\"full\"|\"fast\"|\"by_index_#\"|\"fast_by_index_#\"",
|
||||||
" Format DVD-RW to overwriteable state or de-ice DVD+RW.",
|
" Format BD-RE, DVD-RAM, DVD-RW, DVD+RW.",
|
||||||
" -volid volume_id",
|
" -volid volume_id",
|
||||||
" Specifies the volume ID text. (32 chars out of [A-Z0-9_])",
|
" Specifies the volume ID text. (32 chars out of [A-Z0-9_])",
|
||||||
" -publisher name",
|
" -publisher name",
|
||||||
|
@ -1 +1 @@
|
|||||||
#define Xorriso_timestamP "2008.05.13.180912"
|
#define Xorriso_timestamP "2008.05.14.114548"
|
||||||
|
@ -2753,12 +2753,15 @@ int Xorriso_blank_media(struct XorrisO *xorriso, int flag)
|
|||||||
|
|
||||||
|
|
||||||
/* @param flag bit0= try to achieve faster formatting
|
/* @param flag bit0= try to achieve faster formatting
|
||||||
|
bit7= by_index mode:
|
||||||
|
bit8 to bit15 contain the index of the format to use.
|
||||||
@return 0=failure, did not touch media , -1=failure, altered media
|
@return 0=failure, did not touch media , -1=failure, altered media
|
||||||
1=success, altered media , 2=success, did not touch media
|
1=success, altered media , 2=success, did not touch media
|
||||||
*/
|
*/
|
||||||
int Xorriso_format_media(struct XorrisO *xorriso, int flag)
|
int Xorriso_format_media(struct XorrisO *xorriso, int flag)
|
||||||
{
|
{
|
||||||
int ret, mode_flag= 0;
|
int ret, mode_flag= 0, index, status, num_formats;
|
||||||
|
unsigned dummy;
|
||||||
struct burn_drive_info *dinfo;
|
struct burn_drive_info *dinfo;
|
||||||
struct burn_drive *drive;
|
struct burn_drive *drive;
|
||||||
struct burn_progress p;
|
struct burn_progress p;
|
||||||
@ -2776,7 +2779,27 @@ int Xorriso_format_media(struct XorrisO *xorriso, int flag)
|
|||||||
mode_flag= 4; /* format to full size */
|
mode_flag= 4; /* format to full size */
|
||||||
burn_disc_get_profile(drive, ¤t_profile, current_profile_name);
|
burn_disc_get_profile(drive, ¤t_profile, current_profile_name);
|
||||||
|
|
||||||
if(current_profile == 0x12) { /* DVD+RAM */
|
if(flag&128) { /* by_index */
|
||||||
|
index= (flag>>8) & 0xff;
|
||||||
|
ret= burn_disc_get_formats(drive, &status, &size, &dummy, &num_formats);
|
||||||
|
if(ret<=0)
|
||||||
|
num_formats= 0;
|
||||||
|
if(ret<=0 || index<0 || index>=num_formats) {
|
||||||
|
if(num_formats>0)
|
||||||
|
sprintf(xorriso->info_text,
|
||||||
|
"-format by_index_%d: format descriptors range from index 0 to %d",
|
||||||
|
index, num_formats-1);
|
||||||
|
else
|
||||||
|
sprintf(xorriso->info_text,
|
||||||
|
"-format by_index_%d: no format descriptors available", index);
|
||||||
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
mode_flag= (flag & 0xff80) | 4; /* with size taken from descriptor */
|
||||||
|
if(flag&1)
|
||||||
|
mode_flag|= (1<<6);
|
||||||
|
|
||||||
|
} else if(current_profile == 0x12) { /* DVD+RAM */
|
||||||
mode_flag= 6; /* format to default payload size */
|
mode_flag= 6; /* format to default payload size */
|
||||||
if(flag&1)
|
if(flag&1)
|
||||||
mode_flag|= (1<<6);
|
mode_flag|= (1<<6);
|
||||||
@ -2815,7 +2838,7 @@ int Xorriso_format_media(struct XorrisO *xorriso, int flag)
|
|||||||
sprintf(xorriso->info_text,"Media current: %s (%4.4xh)",
|
sprintf(xorriso->info_text,"Media current: %s (%4.4xh)",
|
||||||
current_profile_name, current_profile);
|
current_profile_name, current_profile);
|
||||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0);
|
||||||
return 0;
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(xorriso->do_dummy) {
|
if(xorriso->do_dummy) {
|
||||||
|
Loading…
Reference in New Issue
Block a user