CD burn_toc_entries now bear extension_valid data

This commit is contained in:
Thomas Schmitt 2008-08-09 07:18:53 +00:00
parent 5a99f9c4d8
commit 6dc9ecbcad
4 changed files with 58 additions and 4 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2008.08.05.175930" #define Cdrskin_timestamP "2008.08.09.071742"

View File

@ -62,7 +62,7 @@ extern struct libdax_msgs *libdax_messenger;
/* ts A80410 : <<< Dangerous experiment: Pretend that DVD-RAM is BD-RE /* ts A80410 : <<< Dangerous experiment: Pretend that DVD-RAM is BD-RE
# define Libburn_dvd_ram_as_bd_rE yes # define Libburn_dvd_ram_as_bd_rE yes
*/ */
/* ts A80509 : <<< Experiment: pretend that DVD-COM and CD-ROM are other media /* ts A80509 : <<< Experiment: pretend that DVD-ROM and CD-ROM are other media
like BD-ROM (0x40), BD-R seq (0x41), BD-R random (0x42) like BD-ROM (0x40), BD-R seq (0x41), BD-R random (0x42)
# define Libburn_rom_as_profilE 0x40 # define Libburn_rom_as_profilE 0x40
*/ */
@ -1293,6 +1293,10 @@ static int mmc_read_toc_al(struct burn_drive *d, int *alloc_len)
if (d->status == BURN_DISC_UNREADY) if (d->status == BURN_DISC_UNREADY)
d->status = BURN_DISC_FULL; d->status = BURN_DISC_FULL;
toc_find_modes(d); toc_find_modes(d);
/* A80808 */
burn_disc_cd_toc_extensions(d->disc, 0);
return 1; return 1;
} }

View File

@ -330,11 +330,19 @@ void burn_track_clear_isrc(struct burn_track *t)
int burn_track_get_sectors(struct burn_track *t) int burn_track_get_sectors(struct burn_track *t)
{ {
/* ts A70125 : was int */ /* ts A70125 : was int */
off_t size; off_t size = 0;
int sectors, seclen; int sectors, seclen;
seclen = burn_sector_length(t->mode); seclen = burn_sector_length(t->mode);
size = t->offset + t->source->get_size(t->source) + t->tail; if (t->source != NULL) /* ts A80808 : mending sigsegv */
size = t->offset + t->source->get_size(t->source) + t->tail;
else if(t->entry != NULL) {
/* ts A80808 : all burn_toc_entry of track starts should now
have (extensions_valid & 1), even those from CD.
*/
if (t->entry->extensions_valid & 1)
size = ((off_t) t->entry->track_blocks) * (off_t) 2048;
}
sectors = size / seclen; sectors = size / seclen;
if (size % seclen) if (size % seclen)
sectors++; sectors++;
@ -468,6 +476,7 @@ int burn_session_get_sectors(struct burn_session *s)
return sectors; return sectors;
} }
int burn_disc_get_sectors(struct burn_disc *d) int burn_disc_get_sectors(struct burn_disc *d)
{ {
int sectors = 0, i; int sectors = 0, i;
@ -515,3 +524,40 @@ int burn_session_get_hidefirst(struct burn_session *session)
{ {
return session->hidefirst; return session->hidefirst;
} }
/* ts A80808 : Enhance CD toc to DVD toc */
int burn_disc_cd_toc_extensions(struct burn_disc *d, int flag)
{
int sidx, tidx;
struct burn_toc_entry *entry, *prev_entry;
for (sidx = 0; sidx < d->sessions; sidx++) {
for (tidx = 0; tidx < d->session[sidx]->tracks + 1; tidx++) {
if (tidx < d->session[sidx]->tracks)
entry = d->session[sidx]->track[tidx]->entry;
else
entry = d->session[sidx]->leadout_entry;
entry->session_msb = 0;
entry->point_msb = 0;
entry->start_lba = burn_msf_to_lba(entry->pmin,
entry->psec, entry->pframe);
if (tidx > 0) {
prev_entry->track_blocks =
entry->start_lba
- prev_entry->start_lba;
prev_entry->extensions_valid |= 1;
}
if (tidx == d->session[sidx]->tracks) {
entry->session_msb = 0;
entry->point_msb = 0;
entry->track_blocks = 0;
entry->extensions_valid |= 1;
}
prev_entry = entry;
}
}
return 1;
}

View File

@ -109,4 +109,8 @@ int burn_track_apply_fillup(struct burn_track *t, off_t max_size, int flag);
off_t burn_track_get_default_size(struct burn_track *t); off_t burn_track_get_default_size(struct burn_track *t);
/* ts A80808 : Enhance CD toc to DVD toc */
int burn_disc_cd_toc_extensions(struct burn_disc *d, int flag);
#endif /* BURN__STRUCTURE_H */ #endif /* BURN__STRUCTURE_H */