diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index cb82bc60..5f8ab094 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2007.10.03.084206" +#define Cdrskin_timestamP "2007.10.03.112547" diff --git a/libburn/trunk/libburn/drive.c b/libburn/trunk/libburn/drive.c index eba810c0..867260a8 100644 --- a/libburn/trunk/libburn/drive.c +++ b/libburn/trunk/libburn/drive.c @@ -463,6 +463,8 @@ int burn_drive_release_fl(struct burn_drive *d, int flag) } if (d->drive_role == 1) { + if (d->needs_sync_cache) + d->sync_cache(d); if ((flag & 7) != 2) d->unlock(d); if ((flag & 7) == 1) @@ -470,6 +472,7 @@ int burn_drive_release_fl(struct burn_drive *d, int flag) d->release(d); } + d->needs_sync_cache = 0; /* just to be sure */ d->released = 1; /* ts A61125 : outsourced model aspects */ @@ -1670,6 +1673,12 @@ int burn_abort(int patience, current_time = start_time = pacifier_time = time(0); end_time = start_time + patience; + + /* >>> ts A71002 : are there any threads at work ? + If not, then one can force abort because the drives will not + change status on their own. + */ + while(current_time-end_time < patience) { still_not_done = 0; @@ -2406,12 +2415,19 @@ int burn_drive_find_by_thread_pid(struct burn_drive **d, pid_t pid) { int i; - for (i = 0; i < drivetop + 1; i++) + for (i = 0; i < drivetop + 1; i++) { + +/* + if (drive_array[i].thread_pid_valid) + fprintf(stderr, "libburn_EXPERIMENTAL : drive %d , thread_pid %d\n", i, drive_array[i].thread_pid); +*/ + if (drive_array[i].thread_pid_valid && drive_array[i].thread_pid == pid) { *d = &(drive_array[i]); return 1; } + } return 0; } diff --git a/libburn/trunk/libburn/mmc.c b/libburn/trunk/libburn/mmc.c index 52e9cd47..d1c9faec 100644 --- a/libburn/trunk/libburn/mmc.c +++ b/libburn/trunk/libburn/mmc.c @@ -2308,6 +2308,8 @@ void mmc_sync_cache(struct burn_drive *d) } if (spc_wait_unit_attention(d, 3600, "SYNCHRONIZE CACHE", 0) <= 0) d->cancel = 1; + else + d->needs_sync_cache = 0; } @@ -2949,6 +2951,7 @@ int mmc_setup_drive(struct burn_drive *d) d->current_feat21h_link_size = -1; d->current_feat2fh_byte4 = -1; d->needs_close_session = 0; + d->needs_sync_cache = 0; d->bg_format_status = -1; d->num_format_descr = 0; d->complete_sessions = 0; diff --git a/libburn/trunk/libburn/transport.h b/libburn/trunk/libburn/transport.h index a3e57b35..3b1a33cd 100644 --- a/libburn/trunk/libburn/transport.h +++ b/libburn/trunk/libburn/transport.h @@ -180,9 +180,12 @@ struct burn_drive */ int current_feat2fh_byte4; - /* ts A70114 : wether a DVD-RW media holds an incomplete session + /* ts A70114 : whether a DVD-RW media holds an incomplete session (which could need closing after write) */ int needs_close_session; + /* ts A71003 : whether a random write operation was done and no + synchronize chache has happened yet */ + int needs_sync_cache; /* ts A61218 from 51h READ DISC INFORMATION */ int bg_format_status; /* 0=needs format start, 1=needs format restart*/ diff --git a/libburn/trunk/libburn/write.c b/libburn/trunk/libburn/write.c index af482e44..5da9f3ce 100644 --- a/libburn/trunk/libburn/write.c +++ b/libburn/trunk/libburn/write.c @@ -1793,6 +1793,7 @@ int burn_stdio_sync_cache(int fd, struct burn_drive *d, int flag) d->cancel = 1; return 0; } + d->needs_sync_cache = 0; if (!(flag & 1)) libdax_msgs_submit(libdax_messenger, -1, 0x00000002, LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO, @@ -2322,11 +2323,14 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address, } } + if(d->drive_role == 1) + d->needs_sync_cache = 1; if(flag & 1) { if(d->drive_role == 1) d->sync_cache(d); else burn_stdio_sync_cache(fd, d, 0); + d->needs_sync_cache = 0; } if(fd >= 0)