From 4bd8c8d136df4675fd43a3774deea9eea5d81bbc Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 26 May 2011 15:18:41 +0000 Subject: [PATCH] Report damaged track with "Media status :" --- xorriso/drive_mgt.c | 28 +++++++++++++++++++++++----- xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/xorriso/drive_mgt.c b/xorriso/drive_mgt.c index 84a92856..cec66c4d 100644 --- a/xorriso/drive_mgt.c +++ b/xorriso/drive_mgt.c @@ -804,6 +804,7 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag) char profile_name[80],*respt,*devadr, *typetext= ""; struct burn_toc_entry toc_entry; struct burn_drive_info *dinfo; + struct burn_multi_caps *caps= NULL; struct burn_drive *drive; enum burn_disc_status s; char mem_text[80]; @@ -880,15 +881,32 @@ int Xorriso_toc(struct XorrisO *xorriso, int flag) if(not_reconizable) sprintf(respt+strlen(respt), "is not recognizable\n"); else - sprintf(respt+strlen(respt), "is written , is closed\n"); + sprintf(respt+strlen(respt), "is written , is closed"); } else if (s == BURN_DISC_APPENDABLE) { - sprintf(respt+strlen(respt), "is written , is appendable\n"); + sprintf(respt+strlen(respt), "is written , is appendable"); } else if (s == BURN_DISC_BLANK) { - sprintf(respt+strlen(respt), "is blank\n"); + sprintf(respt+strlen(respt), "is blank"); } else if (s == BURN_DISC_EMPTY) - sprintf(respt+strlen(respt), "is not present\n"); + sprintf(respt+strlen(respt), "is not present"); else - sprintf(respt+strlen(respt), "is not recognizable\n"); + sprintf(respt+strlen(respt), "is not recognizable"); + if(s == BURN_DISC_APPENDABLE || s == BURN_DISC_BLANK) { + ret= burn_disc_next_track_is_damaged(drive, 0); + if(ret & 1) + sprintf(respt+strlen(respt), " , but next track is damaged"); + else if(ret & 2) + sprintf(respt+strlen(respt), " , but no writable address"); + else if(profile_no == 0x14) { /* DVD-RW sequential */ + ret= burn_disc_get_multi_caps(drive, BURN_WRITE_TAO, &caps, 0); + if(ret == 0) + sprintf(respt+strlen(respt), " , but will need -close \"on\""); + if(caps != NULL) + burn_disc_free_multi_caps(&caps); + } else if(profile_no == 0x15) { /* DVD-RW DL */ + sprintf(respt+strlen(respt), " , but will need -close \"on\""); + } + } + strcat(respt, "\n"); Xorriso_toc_line(xorriso, flag & 8); if(s == BURN_DISC_BLANK) { diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 5e645304..10f0abd9 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2011.05.26.151635" +#define Xorriso_timestamP "2011.05.26.151744"