Implemented index reporting for struct burn_progress

This commit is contained in:
Thomas Schmitt 2012-01-13 17:10:06 +00:00
parent 6a13187e03
commit 38bbbf2496
3 changed files with 21 additions and 9 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2012.01.13.151126" #define Cdrskin_timestamP "2012.01.13.170914"

View File

@ -228,7 +228,7 @@ ex:;
int sector_write_buffer(struct burn_drive *d, int sector_write_buffer(struct burn_drive *d,
struct burn_track *track, int flag) struct burn_track *track, int flag)
{ {
int err; int err, i;
struct buffer *out; struct buffer *out;
out = d->buffer; out = d->buffer;
@ -242,6 +242,13 @@ int sector_write_buffer(struct burn_drive *d,
if(track != NULL) { if(track != NULL) {
track->writecount += out->bytes; track->writecount += out->bytes;
track->written_sectors += out->sectors; track->written_sectors += out->sectors;
/* Determine index of d->nwa */
for (i = d->progress.index; i + 1 < track->indices; i++) {
if (track->index[i + 1] > d->nwa + out->sectors)
break;
d->progress.index = i + 1;
}
} }
/* ts A61119 */ /* ts A61119 */
d->progress.buffered_bytes += out->bytes; d->progress.buffered_bytes += out->bytes;

View File

@ -1047,15 +1047,13 @@ ex:;
/* ts A61218 : outsourced from burn_write_track() */ /* ts A61218 : outsourced from burn_write_track() */
int burn_disc_init_track_status(struct burn_write_opts *o, int burn_disc_init_track_status(struct burn_write_opts *o,
struct burn_session *s, int tnum, int sectors) struct burn_session *s, struct burn_track *t,
int tnum, int sectors)
{ {
struct burn_drive *d = o->drive; struct burn_drive *d = o->drive;
/* Update progress */ /* Update progress */
/* >>> ts B20113 : This is wrong, because nwa does not count buffered
but yet unwritten sectors.
*/
d->progress.start_sector = d->nwa; d->progress.start_sector = d->nwa;
d->progress.sectors = sectors; d->progress.sectors = sectors;
@ -1065,6 +1063,13 @@ int burn_disc_init_track_status(struct burn_write_opts *o,
by bonfire-app@wanadoo.fr in http://libburn.pykix.org/ticket/58 */ by bonfire-app@wanadoo.fr in http://libburn.pykix.org/ticket/58 */
d->progress.track = tnum; d->progress.track = tnum;
/* ts B20113 */
d->progress.indices = t->indices;
d->progress.index = 0;
if (d->progress.indices > 1)
if (t->index[0] == 0x7fffffff)
d->progress.index = 1;
/* ts A61102 */ /* ts A61102 */
d->busy = BURN_DRIVE_WRITING; d->busy = BURN_DRIVE_WRITING;
@ -1172,7 +1177,7 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
sectors = burn_track_get_sectors(t); sectors = burn_track_get_sectors(t);
open_ended = burn_track_is_open_ended(t); open_ended = burn_track_is_open_ended(t);
burn_disc_init_track_status(o, s, tnum, sectors); burn_disc_init_track_status(o, s, t, tnum, sectors);
/* ts A61030 : this cannot happen. tnum is always < s->tracks */ /* ts A61030 : this cannot happen. tnum is always < s->tracks */
if (tnum == s->tracks) if (tnum == s->tracks)
@ -1821,7 +1826,7 @@ int burn_dvd_write_track(struct burn_write_opts *o,
/* (offset padding is done within sector_data()) */ /* (offset padding is done within sector_data()) */
burn_disc_init_track_status(o, s, tnum, sectors); burn_disc_init_track_status(o, s, t, tnum, sectors);
for (i = 0; open_ended || i < sectors; i++) { for (i = 0; open_ended || i < sectors; i++) {
/* From time to time inquire drive buffer */ /* From time to time inquire drive buffer */
@ -2660,7 +2665,7 @@ int burn_stdio_write_track(struct burn_write_opts *o, struct burn_session *s,
BURN_ALLOC_MEM(buf, char, bufsize); BURN_ALLOC_MEM(buf, char, bufsize);
sectors = burn_track_get_sectors(t); sectors = burn_track_get_sectors(t);
burn_disc_init_track_status(o, s, tnum, sectors); burn_disc_init_track_status(o, s, t, tnum, sectors);
open_ended = burn_track_is_open_ended(t); open_ended = burn_track_is_open_ended(t);
t->end_on_premature_eoi = (o->write_type == BURN_WRITE_TAO); t->end_on_premature_eoi = (o->write_type == BURN_WRITE_TAO);