Implemented cdrskin -toc

This commit is contained in:
2006-10-22 13:03:28 +00:00
parent 6a68e1ed69
commit 24bd1bada5
7 changed files with 96 additions and 18 deletions

View File

@ -87,6 +87,8 @@ static int Cleanup_handler_exit(int exit_value, int signum, int flag)
{
int ret;
if(cleanup_msg[0]!=0)
fprintf(stderr,"\n%s\n",cleanup_msg);
if(cleanup_perform_app_handler_first)
if(cleanup_app_handler!=NULL) {
ret= (*cleanup_app_handler)(cleanup_app_handle,signum,0);
@ -94,15 +96,11 @@ static int Cleanup_handler_exit(int exit_value, int signum, int flag)
return(2);
}
if(cleanup_exiting) {
if(cleanup_msg[0]!=0)
fprintf(stderr,"%s\n",cleanup_msg);
fprintf(stderr,"cleanup: ABORT : repeat by pid=%d, signum=%d\n",
getpid(),signum);
return(0);
}
cleanup_exiting= 1;
if(cleanup_msg[0]!=0)
fprintf(stderr,"\n%s\n",cleanup_msg);
alarm(0);
if(!cleanup_perform_app_handler_first)
if(cleanup_app_handler!=NULL) {

View File

@ -662,6 +662,10 @@ int burn_drive_info_forget(struct burn_drive_info *info, int force)
struct burn_disc *burn_drive_get_disc(struct burn_drive *d)
{
/* ts A61022: SIGSEGV on calling this function with blank media */
if(d->disc == NULL)
return NULL;
d->disc->refcnt++;
return d->disc;
}

View File

@ -868,7 +868,7 @@ void burn_session_hide_first_track(struct burn_session *s, int onoff);
/** Get the drive's disc struct - free when done
@param d drive to query
@return the disc struct
@return the disc struct or NULL on failure
*/
struct burn_disc *burn_drive_get_disc(struct burn_drive *d);

View File

@ -272,7 +272,7 @@ void mmc_read_toc(struct burn_drive *d)
struct buffer buf;
struct command c;
int dlen;
int i;
int i, bpl= 12;
unsigned char *tdata;
mmc_function_spy("mmc_read_toc");
@ -326,12 +326,21 @@ void mmc_read_toc(struct burn_drive *d)
burn_disc_add_session(d->disc, session, BURN_POS_END);
burn_session_free(session);
}
/* ts A61022 */
burn_print(bpl, "-----------------------------------\n");
for (i = 0; i < d->toc_entries; i++, tdata += 11) {
burn_print(12, "S %d, PT %d, TNO %d : ", tdata[0], tdata[3],
/* ts A61022: was burn_print level 12 */
burn_print(bpl, "S %d, PT %2.2Xh, TNO %d :", tdata[0],tdata[3],
tdata[2]);
burn_print(12, "(%d:%d:%d)", tdata[8], tdata[9], tdata[10]);
burn_print(12, "A(%d:%d:%d)", tdata[4], tdata[5], tdata[6]);
burn_print(12, " - control %d, adr %d\n", tdata[1] & 0xF,
burn_print(bpl, " MSF(%d:%d:%d)", tdata[4],tdata[5],tdata[6]);
burn_print(bpl, " PMSF(%d:%d:%d %d)",
tdata[8], tdata[9], tdata[10],
burn_msf_to_lba(tdata[8], tdata[9], tdata[10])
);
burn_print(bpl, " - control %d, adr %d\n", tdata[1] & 0xF,
tdata[1] >> 4);
/*
@ -376,6 +385,10 @@ void mmc_read_toc(struct burn_drive *d)
d->disc->session[tdata[0] - 1]->leadout_entry =
&d->toc_entry[i];
}
/* ts A61022 */
burn_print(bpl, "-----------------------------------\n");
if (d->status != BURN_DISC_APPENDABLE)
d->status = BURN_DISC_FULL;
toc_find_modes(d);