Optional padding up to full media size when closing (incomplete yet)

This commit is contained in:
2007-02-14 20:32:56 +00:00
parent 3ec93316e0
commit e639cd5bbb
8 changed files with 118 additions and 4 deletions

View File

@ -113,6 +113,10 @@ struct burn_track *burn_track_create(void)
t->mode = BURN_MODE1;
t->isrc.has_isrc = 0;
t->pad = 1;
/* ts A70213 */
t->fill_up_media = 0;
t->entry = NULL;
t->source = NULL;
t->eos = 0;
@ -346,6 +350,36 @@ int burn_track_set_sectors(struct burn_track *t, int sectors)
}
/* ts A70213 */
int burn_track_set_fillup(struct burn_track *t, int fill_up_media)
{
t->fill_up_media = fill_up_media;
return 1;
}
/* ts A70213 */
/**
@param flag bit0= force new size even if existing track size is larger
*/
int burn_track_apply_fillup(struct burn_track *t, off_t max_size, int flag)
{
int max_sectors, ret;
if (t->fill_up_media <= 0)
return 2;
max_sectors = max_size / 2048;
if (burn_track_get_sectors(t) < max_sectors || (flag & 1)) {
ret = burn_track_set_sectors(t, max_sectors);
/* <<< */
fprintf(stderr, "LIBBURN_DEBUG: Setting total track size to %ds (payload %ds)\n", max_sectors, (int) (t->source->get_size(t->source)/2048));
}
return ret;
}
/* ts A61031 */
int burn_track_is_open_ended(struct burn_track *t)
{