Made cdrskin produce "ATIP start of lead" (on non-blank media for now)

This commit is contained in:
Thomas Schmitt 2006-10-20 11:34:52 +00:00
parent 84ecb57b47
commit 8610c9bd1d
7 changed files with 71 additions and 1 deletions

View File

@ -170,6 +170,7 @@ or
#define Cdrskin_libburn_has_burn_msgS 1
#define Cdrskin_libburn_has_burn_aborT 1
#define Cdrskin_libburn_has_audioxtR 1
#define Cdrskin_libburn_has_get_start_end_lbA 1
#endif
#ifndef Cdrskin_libburn_versioN
@ -3405,6 +3406,19 @@ int Cdrskin_atip(struct CdrskiN *skin, int flag)
} else {
printf(" Is not erasable\n");
}
#ifdef Cdrskin_libburn_has_get_start_end_lbA
{ int start_lba,end_lba,min,sec,fr;
ret= burn_drive_get_start_end_lba(drive,&start_lba,&end_lba,0);
if(ret>0) {
burn_lba_to_msf(start_lba,&min,&sec,&fr);
printf(" ATIP start of lead in: %d (%d:%d/%d)\n",start_lba,min,sec,fr);
burn_lba_to_msf(end_lba,&min,&sec,&fr);
printf(" ATIP start of lead out: %d (%d:%d/%d)\n",end_lba,min,sec,fr);
}
}
#endif /* Cdrskin_libburn_has_get_start_end_lbA */
printf(" 1T speed low: %.f 1T speed high: %.f\n",x_speed,x_speed);
ret= 1;
ex:;

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2006.10.19.164742"
#define Cdrskin_timestamP "2006.10.20.113421"

View File

@ -297,6 +297,10 @@ void burn_drive_release(struct burn_drive *d, int le)
return;
}
/* ts A61020 : mark media info as invalid */
d->start_lba= -2000000000;
d->end_lba= -2000000000;
d->unlock(d);
if (le)
d->eject(d);
@ -1103,3 +1107,14 @@ int burn_abort(int patience,
return(still_not_done == 0);
}
/* ts A61020 API function */
int burn_drive_get_start_end_lba(struct burn_drive *d,
int *start_lba, int *end_lba, int flag)
{
if (d->start_lba == -2000000000 || d->end_lba == -2000000000)
return 0;
*start_lba = d->start_lba;
*end_lba= d->end_lba;
return 1;
}

View File

@ -627,6 +627,21 @@ void burn_drive_release(struct burn_drive *drive, int eject);
*/
enum burn_disc_status burn_disc_get_status(struct burn_drive *drive);
/* ts A61020 */
/** Returns start and end lba of the media which is currently inserted
in the given drive. The drive has to be grabbed to have hope for reply.
Shortcomming (not a feature): only blank media will return valid info.
@param drive The drive to query.
@param start_lba Returns the start lba value
@param end_lba Returns the end lba value
@param flag Bitfield for control purposes (unused yet, submit 0)
@return 1 if lba values are valid , 0 if invalid
*/
int burn_drive_get_start_end_lba(struct burn_drive *d,
int *start_lba, int *end_lba, int flag);
/** Tells whether a disc can be erased or not
@return Non-zero means erasable
*/

View File

@ -318,6 +318,10 @@ void mmc_read_toc(struct burn_drive *d)
burn_print(12, " - control %d, adr %d\n", tdata[1] & 0xF,
tdata[1] >> 4);
/*
fprintf(stderr, "libburn_experimental: toc entry #%d : %d %d %d\n",i,tdata[8], tdata[9], tdata[10]);
*/
if (tdata[3] == 1) {
if (burn_msf_to_lba(tdata[8], tdata[9], tdata[10])) {
d->disc->session[0]->hidefirst = 1;
@ -384,11 +388,26 @@ void mmc_read_disc_info(struct burn_drive *d)
data = c.page->data;
d->erasable = !!(data[2] & 16);
/* ts A61020 */
d->start_lba = d->end_lba = -2000000000;
/*
fprintf(stderr, "libburn_experimental: data[2]= %d 0x%x\n",
(unsigned) data[2], (unsigned) data[2]);
*/
switch (data[2] & 3) {
case 0:
d->toc_entries = 0;
d->start_lba = burn_msf_to_lba(data[17], data[18], data[19]);
d->end_lba = burn_msf_to_lba(data[21], data[22], data[23]);
/*
fprintf(stderr, "libburn_experimental: start_lba = %d (%d %d %d) , end_lba = %d (%d %d %d)\n",
d->start_lba, data[17], data[18], data[19],
d->end_lba, data[21], data[22], data[23]);
*/
d->status = BURN_DISC_BLANK;
break;
case 1:

View File

@ -206,6 +206,9 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
out.devname = burn_strdup(fname);
out.cam = NULL;
out.start_lba= -2000000000;
out.end_lba= -2000000000;
out.grab = sg_grab;
out.release = sg_release;
out.issue_command = sg_issue_command;

View File

@ -440,6 +440,10 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
for(i= 0; i<LIBBURN_SG_MAX_SIBLINGS; i++)
out.sibling_fds[i] = -1337;
/* ts A61020 */
out.start_lba= -2000000000;
out.end_lba= -2000000000;
out.grab = sg_grab;
out.release = sg_release;
out.issue_command = sg_issue_command;