From 2145161863b8842187e895f1a39fdf7b67102125 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 8 Jan 2012 15:48:47 +0000 Subject: [PATCH] Corrected display of track number offset with -toc and -minfo --- libburn/trunk/cdrskin/cdrskin.c | 30 ++++++++++++++++------- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin.c b/libburn/trunk/cdrskin/cdrskin.c index 33b80d99..8d2b68c1 100644 --- a/libburn/trunk/cdrskin/cdrskin.c +++ b/libburn/trunk/cdrskin/cdrskin.c @@ -4803,6 +4803,7 @@ int Cdrskin_toc(struct CdrskiN *skin, int flag) { int num_sessions= 0,num_tracks= 0,lba= 0,track_count= 0,total_tracks= 0; int session_no, track_no, pmin, psec, pframe, ret, final_ret= 1; + int track_offset = 1; struct burn_drive *drive; struct burn_disc *disc= NULL; struct burn_session **sessions; @@ -4838,19 +4839,26 @@ int Cdrskin_toc(struct CdrskiN *skin, int flag) goto cannot_read; } sessions= burn_disc_get_sessions(disc,&num_sessions); + if(num_sessions > 0) + track_offset = burn_session_get_start_tno(sessions[0], 0); + if(track_offset <= 0) + track_offset= 1; if(flag&1) { for(session_no= 0; session_no>> From where does cdrecord take "mode" ? */ @@ -4947,7 +4955,7 @@ int Cdrskin_minfo(struct CdrskiN *skin, int flag) { int num_sessions= 0,num_tracks= 0,lba= 0,track_count= 0,total_tracks= 0; int session_no, track_no, pmin, psec, pframe, ret, size= 0, nwa= 0; - int last_leadout= 0, ovwrt_full= 0; + int last_leadout= 0, ovwrt_full= 0, track_offset= 1; struct burn_drive *drive; struct burn_disc *disc= NULL; struct burn_session **sessions= NULL; @@ -5017,8 +5025,12 @@ int Cdrskin_minfo(struct CdrskiN *skin, int flag) ftils= ltils= 1; } else { - first_track= 1; sessions= burn_disc_get_sessions(disc, &num_sessions); + if(num_sessions > 0) + track_offset= burn_session_get_start_tno(sessions[0], 0); + if(track_offset <= 0) + track_offset= 1; + first_track= track_offset; nominal_sessions= num_sessions; if(s == BURN_DISC_APPENDABLE) nominal_sessions++; @@ -5038,8 +5050,8 @@ int Cdrskin_minfo(struct CdrskiN *skin, int flag) } printf("first track: %d\n", first_track); printf("number of sessions: %d\n", nominal_sessions); - printf("first track in last sess: %d\n", ftils); - printf("last track in last sess: %d\n", ltils); + printf("first track in last sess: %d\n", ftils + track_offset - 1); + printf("last track in last sess: %d\n", ltils + track_offset - 1); burn_disc_get_cd_info(drive, disc_type, &disc_id, bar_code, &app_code, &cd_info_valid); @@ -5110,7 +5122,7 @@ int Cdrskin_minfo(struct CdrskiN *skin, int flag) #endif /* Cdrskin_with_last_recorded_addresS */ printf("%5d %5d %-6s %-10d %-10d %-10d\n", - track_count, session_no + 1, + track_count + track_offset - 1, session_no + 1, ((toc_entry.control&7)<4) ? "Audio" : "Data", lba, lra, size); last_leadout= lba + size; diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index c7d18ee8..27ca08fb 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2012.01.08.141104" +#define Cdrskin_timestamP "2012.01.08.154822"