From 8ed28bec4ec8461b3d15de28dbd75ecf7d14d158 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 --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/libburn.h | 11 +++++++++-- libburn/trunk/libburn/structure.c | 6 ++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index 6ea7afaf..2d16b70a 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2012.01.19.210418" +#define Cdrskin_timestamP "2012.01.20.091016" diff --git a/libburn/trunk/libburn/libburn.h b/libburn/trunk/libburn/libburn.h index 93d1cc22..65c81218 100644 --- a/libburn/trunk/libburn/libburn.h +++ b/libburn/trunk/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/trunk/libburn/structure.c b/libburn/trunk/libburn/structure.c index 64bf88b9..5e0c9908 100644 --- a/libburn/trunk/libburn/structure.c +++ b/libburn/trunk/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)