From 6549072dcdc6419abc5b2e3a6259bbf0e8b5670f Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Mon, 23 Jan 2012 09:56:53 +0000 Subject: [PATCH] Introduced burn_offst_source_new() flag bit0 which bans size changes --- cdrskin/cdrskin_timestamp.h | 2 +- libburn/libburn.h | 11 +++++++++-- libburn/structure.c | 6 ++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index 6ea7afa..2d16b70 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2012.01.19.210418" +#define Cdrskin_timestamP "2012.01.20.091016" diff --git a/libburn/libburn.h b/libburn/libburn.h index 93d1cc2..65c8121 100644 --- a/libburn/libburn.h +++ b/libburn/libburn.h @@ -2619,8 +2619,15 @@ struct burn_source *burn_fd_source_new(int datafd, int subfd, off_t size); @param start The byte address where to start reading bytes for the consumer. inp bytes may get skipped to reach this address. @param size The number of bytes to be delivered to the consumer. - @param flag Bitfield for control purposes (unused yet, submit 0). ->>> bit0 = allow set_size() to override existing sizes > 0 + If size is <= 0 then it may be set later by a call of method + set_size(). If it is >= 0, then it can only be changed if + flag bit0 was set with burn_offst_source_new(). + @param flag Bitfield for control purposes + bit0 = Prevent set_size() from overriding interval sizes > 0. + If such a size is already set, then the new one will + only affect the reply of get_size(). + See also above struct burn_source. + @since 1.2.0 @return Pointer to a burn_source object, later to be freed by burn_source_free(). NULL indicates failure. @since 0.8.8 diff --git a/libburn/structure.c b/libburn/structure.c index 64bf88b..5e0c990 100644 --- a/libburn/structure.c +++ b/libburn/structure.c @@ -1784,7 +1784,7 @@ overlapping_ba:; else inp_src = crs->file_source; src = burn_offst_source_new(inp_src, crs->offst_source, - (off_t) (file_ba * crs->block_size), (off_t) 0, 0); + (off_t) (file_ba * crs->block_size), (off_t) 0, 1); if (src == NULL) goto out_of_mem; @@ -2051,8 +2051,10 @@ cannot_open:; 0, 0); ret = 0; goto ex; } - burn_track_set_size(crs->track, crs->source_size - + ret = burn_track_set_size(crs->track, crs->source_size - (off_t) (crs->current_file_ba * crs->block_size)); + if (ret <= 0) + goto ex; ret = cue_attach_track(session, crs, 0); if (ret <= 0)