diff --git a/cdrskin/cdrskin_timestamp.h b/cdrskin/cdrskin_timestamp.h index beb63d8..6ec7691 100644 --- a/cdrskin/cdrskin_timestamp.h +++ b/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.02.01.191638" +#define Cdrskin_timestamP "2007.02.02.151327" diff --git a/libburn/mmc.c b/libburn/mmc.c index 464fd6c..daa597f 100644 --- a/libburn/mmc.c +++ b/libburn/mmc.c @@ -786,28 +786,59 @@ void mmc_read_toc(struct burn_drive *d) } -/* ts A70131 : If no TOC is at hand, this tries to get the start of the - last complete session (mksifs -c first parameter) */ +/* ts A70131 : This tries to get the start of the last complete session */ +/* man mkisofs , option -C : + The first number is the sector number of the first sector in + the last session of the disk that should be appended to. +*/ int mmc_read_multi_session_c1(struct burn_drive *d, int *trackno, int *start) { struct buffer buf; struct command c; unsigned char *tdata; + int num_sessions, session_no, num_tracks; + struct burn_disc *disc; + struct burn_session **sessions; + struct burn_track **tracks; + struct burn_toc_entry toc_entry; - mmc_function_spy("mmc_read_multi_session_c"); + mmc_function_spy("mmc_read_multi_session_c1"); + /* First try to evaluate the eventually loaded TOC before issueing + a MMC command. This search obtains the first track of the last + complete session which has a track. + */ + *trackno = 0; + disc = burn_drive_get_disc(d); + if (disc == NULL) + goto inquire_drive; + sessions = burn_disc_get_sessions(disc, &num_sessions); + for (session_no = 0; session_no 0) + return 1; + +inquire_drive:; /* mmc5r03.pdf 6.26.3.3.3 states that with non-CD this would be a useless fake always starting at track 1, lba 0. My drives return useful data, though. - MMC-3 states that DVD had not tracks. So maybe this fake is - a legacy ? + MMC-3 states that DVD had no tracks. So maybe this mandatory fake + is a forgotten legacy ? */ - - /* >>> - mmc_fake_toc() meanwhile tries to establish a useable TOC. - Evaluate this first before issueing a MMC command. - */ - memcpy(c.opcode, MMC_GET_MSINFO, sizeof(MMC_GET_MSINFO)); c.retry = 1; c.oplen = sizeof(MMC_GET_MSINFO); @@ -822,8 +853,7 @@ int mmc_read_multi_session_c1(struct burn_drive *d, int *trackno, int *start) tdata = c.page->data + 4; *trackno = tdata[2]; - *start = (tdata[4] << 24) | (tdata[5] << 16) - | (tdata[6] << 8) | tdata[7]; + *start = mmc_four_char_to_int(tdata + 4); return 1; } diff --git a/test/telltoc.c b/test/telltoc.c index 98037f6..c7fdfe3 100644 --- a/test/telltoc.c +++ b/test/telltoc.c @@ -437,13 +437,8 @@ int telltoc_toc(struct burn_drive *drive) int telltoc_msinfo(struct burn_drive *drive, int msinfo_explicit, int msinfo_alone) { - int num_sessions, session_no, ret, num_tracks; - int nwa = -123456789, lba = -123456789, aux_lba, lout_lba; + int ret, lba, nwa = -123456789, aux_lba; enum burn_disc_status s; - struct burn_disc *disc= NULL; - struct burn_session **sessions; - struct burn_track **tracks; - struct burn_toc_entry toc_entry; struct burn_write_opts *o= NULL; s = burn_disc_get_status(drive); @@ -459,29 +454,12 @@ int telltoc_msinfo(struct burn_drive *drive, The first number is the sector number of the first sector in the last session of the disk that should be appended to. */ - disc = burn_drive_get_disc(drive); - if (disc==NULL) { - fprintf(stderr,"SORRY: Cannot obtain info about CD content\n"); - return 2; - } - sessions = burn_disc_get_sessions(disc, &num_sessions); - for (session_no = 0; session_no0) - nwa= lout_lba+6900; - else - nwa= lout_lba+11400; + "SORRY: Cannot obtain next writeable address\n"); + { ret = 0; goto ex; } } if (!msinfo_alone) printf("Media msinfo : mkisofs ... -C "); printf("%d,%d\n",lba,nwa); - ret = 1; ex:; - if (disc!=NULL) - burn_disc_free(disc); if (o!=NULL) burn_write_opts_free(o); return ret;