New iso_write_opts_set_system_area() cylinder alignment mode "all".

This commit revokes the statement that rev 1042 is a bug fix.
The old behavior is a feature. The former bug fix is now triggered by
mode "all".
This commit is contained in:
Thomas Schmitt 2012-09-21 13:56:43 +02:00
parent f3e63e3cf7
commit 4673733c4b
4 changed files with 22 additions and 36 deletions

View File

@ -713,6 +713,15 @@ struct ecma119_image
* 0 = auto (align if bit1)
* 1 = always align to cylinder boundary
* 2 = never align to cylinder boundary
* 3 = always align, additionally pad up and align partitions
* which were appended by iso_write_opts_set_partition_img()
* bit10-13= System area sub type
* With type 0 = MBR:
* Gets overridden by bit0 and bit1.
* 0 = no particular sub type
* 1 = CHRP: A single MBR partition of type 0x96 covers the
* ISO image. Not compatible with any other feature
* which needs to have own MBR partition entries.
*/
int system_area_options;

View File

@ -335,6 +335,9 @@ int filesrc_writer_compute_data_blocks(IsoImageWriter *writer)
t = writer->target;
filelist = (IsoFileSrc **) writer->data;
/* >>> HFS: need to align to allocation block size */;
/* >>> HFS: ??? how to handle multi-extent files ? */;
t->filesrc_start = t->curblock;
/* Give all extent addresses their final absolute value */
@ -488,6 +491,8 @@ int iso_filesrc_write_data(Ecma119Image *t, IsoFileSrc *file,
}
#endif
/* >>> HFS: need to align to allocation block size */;
#ifdef Libisofs_with_libjtE
if (t->libjte_handle != NULL) {
res = libjte_begin_data_file(t->libjte_handle, name,

View File

@ -2180,6 +2180,9 @@ int iso_write_opts_set_fifo_size(IsoWriteOpts *opts, size_t fifo_size);
* 0 = auto (align if bit1)
* 1 = always align to cylinder boundary
* 2 = never align to cylinder boundary
* 3 = always align, additionally pad up and align partitions
* which were appended by iso_write_opts_set_partition_img()
* @since 1.2.6
* bit10-13= System area sub type
* @since 1.2.4
* With type 0 = MBR:
@ -7464,42 +7467,12 @@ int iso_image_hfsplus_get_blessed(IsoImage *img, IsoNode ***blessed_nodes,
This allows to use arbitrary program code as provider of track input data.
Objects compliant to this interface are either provided by the application
or by API calls of libburn: burn_fd_source_new() , burn_file_source_new(),
or by API calls of libburn: burn_fd_source_new(), burn_file_source_new(),
and burn_fifo_source_new().
The API calls allow to use any file object as data source. Consider to feed
an eventual custom data stream asynchronously into a pipe(2) and to let
libburn handle the rest.
In this case the following rule applies:
Call burn_source_free() exactly once for every source obtained from
libburn API. You MUST NOT otherwise use or manipulate its components.
libisofs acts as "application" and implements an own class of burn_source.
Instances of that class are handed out by iso_image_create_burn_source().
In general, burn_source objects can be freed as soon as they are attached
to track objects. The track objects will keep them alive and dispose them
when they are no longer needed. With a fifo burn_source it makes sense to
keep the own reference for inquiring its state while burning is in
progress.
---
The following description of burn_source applies only to application
implemented burn_source objects. You need not to know it for API provided
ones.
If you really implement an own passive data producer by this interface,
then beware: it can do anything and it can spoil everything.
In this case the functions (*read), (*get_size), (*set_size), (*free_data)
MUST be implemented by the application and attached to the object at
creation time.
Function (*read_sub) is allowed to be NULL or it MUST be implemented and
attached.
burn_source.refcount MUST be handled properly: If not exactly as many
references are freed as have been obtained, then either memory leaks or
corrupted memory are the consequence.
All objects which are referred to by *data must be kept existent until
(*free_data) is called via burn_source_free() by the last referer.
*/
struct burn_source {

View File

@ -126,8 +126,7 @@ int iso_compute_append_partitions(Ecma119Image *t, int flag)
sa_type = (t->system_area_options >> 2) & 0x3f;
cyl_align = (t->system_area_options >> 8) & 0x3;
if (sa_type == 0 && (cyl_align == 1 ||
(cyl_align == 0 && (t->system_area_options & 3) == 2))) {
if (sa_type == 0 && cyl_align == 3) {
cyl_size = t->partition_heads_per_cyl * t->partition_secs_per_head;
if (cyl_size % 4)
cyl_size = 0;
@ -1682,7 +1681,7 @@ int iso_align_isohybrid(Ecma119Image *t, int flag)
iso_msgs_submit(0, msg, 0, "NOTE", 0);
}
if (always_align >= 2)
if (always_align == 2)
{ret = ISO_SUCCESS; goto ex;}
cylsize = 0;