Implemented libburn builtin fine granulated drive buffer min-fill recording

ZeroThreeEight
Thomas Schmitt 16 years ago
parent ebb94ee212
commit 4daed7c4a9
  1. 13
      cdrskin/cdrskin.c
  2. 2
      cdrskin/cdrskin_timestamp.h
  3. 14
      libburn/libburn.h
  4. 8
      libburn/mmc.c
  5. 2
      libburn/sector.c
  6. 9
      libburn/write.c

@ -177,6 +177,7 @@ or
#define Cdrskin_libburn_has_buffer_progresS 1
#define Cdrskin_libburn_has_pretend_fulL 1
#define Cdrskin_libburn_has_multI 1
#define Cdrskin_libburn_has_buffer_min_filL 1
#endif
#ifndef Cdrskin_libburn_versioN
@ -3245,7 +3246,7 @@ int Cdrskin_report_disc_status(struct CdrskiN *skin, enum burn_disc_status s,
int flag)
{
printf("cdrskin: status %d ",s);
if (s==BURN_DISC_FULL) {
if(s==BURN_DISC_FULL) {
printf("burn_disc_full \"There is a disc with data on it in the drive\"\n");
} else if(s==BURN_DISC_BLANK) {
printf("burn_disc_blank \"The drive holds a blank disc\"\n");
@ -4624,6 +4625,16 @@ fifo_full_at_end:;
"Cdrskin: fifo was %.f times empty and %.f times full, min fill was %d%%.\n",
empty_counter,full_counter,fifo_percent);
}
drive_status= burn_drive_get_status(drive, &p);
#ifdef Cdrskin_libburn_has_buffer_min_filL
/* cdrskin recorded its own coarse min_buffer_fill.
libburn's is finer - if enough bytes were processed so it is available.*/
if(p.buffer_min_fill<=p.buffer_capacity && p.buffer_capacity>0)
min_buffer_fill= 100.0 *
((double) p.buffer_min_fill)/(double) p.buffer_capacity;
#endif /* Cdrskin_libburn_has_buffer_min_filL */
if(min_buffer_fill>100)
min_buffer_fill= 50;
printf("Min drive buffer fill was %d%%\n", min_buffer_fill);

@ -1 +1 @@
#define Cdrskin_timestamP "2006.11.18.194606"
#define Cdrskin_timestamP "2006.11.19.114413"

@ -388,9 +388,11 @@ struct burn_progress {
int index;
/** The starting logical block address */
int start_sector;
/** The number of sector */
/** On write: The number of sectors.
On blank: 0x10000 as upper limit for relative progress steps */
int sectors;
/** The current sector being processed */
/** On write: The current sector being processed.
On blank: Relative progress steps 0 to 0x10000 */
int sector;
/* ts A61023 */
@ -398,6 +400,14 @@ struct burn_progress {
unsigned buffer_capacity;
/** The free space in the drive buffer (might be slightly outdated) */
unsigned buffer_available;
/* ts A61119 */
/** The number of bytes sent to the drive buffer */
off_t buffered_bytes;
/** The minimum number of buffered bytes. (Caution: Before surely
one buffer size of bytes was processed, this value is 0xffffffff.)
*/
unsigned buffer_min_fill;
};
/** Initialize the library.

@ -874,6 +874,14 @@ int mmc_read_buffer_capacity(struct burn_drive *d)
(data[4]<<24)|(data[5]<<16)|(data[6]<<8)|data[7];
d->progress.buffer_available =
(data[8]<<24)|(data[9]<<16)|(data[10]<<8)|data[11];
if (d->progress.buffered_bytes >= d->progress.buffer_capacity){
double fill;
fill = d->progress.buffer_capacity
- d->progress.buffer_available;
if (fill < d->progress.buffer_min_fill && fill>=0)
d->progress.buffer_min_fill = fill;
}
return 1;
}

@ -228,6 +228,8 @@ static unsigned char *get_sector(struct burn_write_opts *opts,
track->writecount += out->bytes;
track->written_sectors += out->sectors;
}
/* ts A61119 */
d->progress.buffered_bytes += out->bytes;
d->nwa += out->sectors;
out->bytes = 0;

@ -125,6 +125,8 @@ int burn_write_flush(struct burn_write_opts *o, struct burn_track *track)
track->writecount += d->buffer->bytes;
track->written_sectors += d->buffer->sectors;
}
/* ts A61119 */
d->progress.buffered_bytes += d->buffer->bytes;
d->nwa += d->buffer->sectors;
d->buffer->bytes = 0;
@ -178,6 +180,7 @@ int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
d->nwa += d->buffer->sectors;
t->writecount += d->buffer->bytes;
t->written_sectors += d->buffer->sectors;
d->progress.buffered_bytes += d->buffer->bytes;
}
d->cancel = cancelled;
}
@ -651,7 +654,7 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
burn_print(12, "track %d is %d sectors long\n", tnum, sectors);
/* ts A61030 : this cannot happen. tnum is alsways < s-tracks */
/* ts A61030 : this cannot happen. tnum is always < s->tracks */
if (tnum == s->tracks)
tmp = sectors > 150 ? 150 : sectors;
@ -710,6 +713,8 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
/* A61101 : probably this is not all payload data */
/* A61108 : but audio count is short without this */
t->writecount += d->buffer->bytes;
t->written_sectors += d->buffer->sectors;
d->progress.buffered_bytes += d->buffer->bytes;
d->nwa += d->buffer->sectors;
d->buffer->bytes = 0;
@ -815,6 +820,8 @@ return crap. so we send the command, then ignore the result.
/* ts A61023 */
d->progress.buffer_capacity = 0;
d->progress.buffer_available = 0;
d->progress.buffered_bytes = 0;
d->progress.buffer_min_fill = 0xffffffff;
d->busy = BURN_DRIVE_WRITING;

Loading…
Cancel
Save