Improved reaction on failure of SEND CUE SHEET

1.2.0
Thomas Schmitt 11 years ago
parent 7b5040af17
commit 8f725bab11
  1. 2
      cdrskin/cdrskin_timestamp.h
  2. 9
      libburn/mmc.c
  3. 3
      libburn/mmc.h
  4. 2
      libburn/transport.h
  5. 25
      libburn/write.c

@ -1 +1 @@
#define Cdrskin_timestamP "2011.12.28.104536"
#define Cdrskin_timestamP "2011.12.28.152153"

@ -302,7 +302,7 @@ int mmc_start_if_needed(struct burn_drive *d, int flag)
}
void mmc_send_cue_sheet(struct burn_drive *d, struct cue_sheet *s)
int mmc_send_cue_sheet(struct burn_drive *d, struct cue_sheet *s)
{
struct buffer *buf = NULL;
struct command *c;
@ -310,7 +310,7 @@ void mmc_send_cue_sheet(struct burn_drive *d, struct cue_sheet *s)
c = &(d->casual_command);
mmc_start_if_needed(d, 0);
if (mmc_function_spy(d, "mmc_send_cue_sheet") <= 0)
return;
return 0;
BURN_ALLOC_MEM_VOID(buf, struct buffer, 1);
scsi_init_command(c, MMC_SEND_CUE_SHEET, sizeof(MMC_SEND_CUE_SHEET));
c->retry = 1;
@ -325,6 +325,11 @@ void mmc_send_cue_sheet(struct burn_drive *d, struct cue_sheet *s)
d->issue_command(d, c);
ex:;
BURN_FREE_MEM(buf);
if (c->error) {
d->cancel = 1;
scsi_notify_error(d, c, c->sense, 18, 2);
}
return !c->error;
}

@ -48,7 +48,8 @@ void mmc_get_configuration(struct burn_drive *);
@return 1=nwa is valid , 0=nwa is not valid , -1=error */
int mmc_get_nwa(struct burn_drive *d, int trackno, int *lba, int *nwa);
void mmc_send_cue_sheet(struct burn_drive *, struct cue_sheet *);
/* ts B11228 : changed from void to int */
int mmc_send_cue_sheet(struct burn_drive *, struct cue_sheet *);
/* ts A61023 : get size and free space of drive buffer */
int mmc_read_buffer_capacity(struct burn_drive *d);

@ -383,7 +383,7 @@ struct burn_drive
void (*send_write_parameters) (struct burn_drive *,
struct burn_session *, int tno,
const struct burn_write_opts *);
void (*send_cue_sheet) (struct burn_drive *, struct cue_sheet *);
int (*send_cue_sheet) (struct burn_drive *, struct cue_sheet *);
/* ts A70205 : Announce size of a DVD-R[W] DAO session. */
int (*reserve_track) (struct burn_drive *d, off_t size);

@ -1023,7 +1023,7 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
{ ret = 0; goto ex; }
} else {
o->control = t->entry->control;
d->send_write_parameters(d, o);
d->send_write_parameters(d, s, tnum + 1, o);
/* ts A61103 */
ret = d->get_nwa(d, -1, &lba, &nwa);
@ -1364,7 +1364,7 @@ int burn_disc_open_track_dvd_minus_r(struct burn_write_opts *o,
off_t size;
BURN_ALLOC_MEM(msg, char, 160);
d->send_write_parameters(d, o);
d->send_write_parameters(d, NULL, 0, o);
ret = d->get_nwa(d, -1, &lba, &nwa);
sprintf(msg,
"DVD pre-track %2.2d : get_nwa(%d), ret= %d , d->nwa= %d",
@ -2035,7 +2035,7 @@ int burn_disc_setup_dvd_minus_rw(struct burn_write_opts *o,
5.4.14 finally states that profile 0013h includes feature
002Ch rather than 0026h.
d->send_write_parameters(d, o);
d->send_write_parameters(d, NULL, 0, o);
*/
d->busy = BURN_DRIVE_FORMATTING;
@ -2674,6 +2674,7 @@ void burn_disc_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
struct cue_sheet *sheet;
struct burn_drive *d = o->drive;
struct buffer *buffer_mem = o->drive->buffer;
struct burn_session *s;
struct burn_track *lt, *t;
int first = 1, i, ret, lba, nwa = 0, multi_mem;
off_t default_size;
@ -2786,7 +2787,11 @@ return crap. so we send the command, then ignore the result.
if (o->write_type == BURN_WRITE_TAO) {
nwa = 0; /* get_nwa() will be called in burn_track() */
} else {
d->send_write_parameters(d, o);
if (disc->sessions > 0)
s = disc->session[0];
else
s = NULL;
d->send_write_parameters(d, s, 0, o);
ret = d->get_nwa(d, -1, &lba, &nwa);
sprintf(msg,
@ -2811,7 +2816,7 @@ return crap. so we send the command, then ignore the result.
/* ts A61009 */
if (sheet == NULL)
goto fail;
goto fail_wo_sync;
#ifdef Libburn_write_with_function_print_cuE
print_cue(sheet);
@ -2819,10 +2824,14 @@ return crap. so we send the command, then ignore the result.
#endif /* Libburn_write_with_function_print_cuE */
if (o->write_type == BURN_WRITE_SAO)
d->send_cue_sheet(d, sheet);
ret = d->send_cue_sheet(d, sheet);
if (sheet->data != NULL)
free(sheet->data);
free(sheet);
if (ret <= 0)
goto fail_wo_sync;
/* --- From here on, final sync is needed. --- */
if (o->write_type == BURN_WRITE_RAW) {
if (!burn_write_leadin(o, disc->session[i], first))
@ -3103,7 +3112,7 @@ int burn_disc_close_damaged(struct burn_write_opts *o, int flag)
o->write_type = BURN_WRITE_TAO; /* no action without TAO */
/* Send mode page 5 */;
d->send_write_parameters(d, o);
d->send_write_parameters(d, NULL, 0, o);
ret = burn_write_close_session(o);
if (ret <= 0)
@ -3114,7 +3123,7 @@ int burn_disc_close_damaged(struct burn_write_opts *o, int flag)
o->write_type = BURN_WRITE_TAO; /* no action without TAO */
/* Send mode page 5 */;
d->send_write_parameters(d, o);
d->send_write_parameters(d, NULL, 0, o);
ret = burn_disc_close_track_dvd_minus_r(o, 0);
if (ret <= 0)

Loading…
Cancel
Save