Compare commits
15 Commits
release-1.
...
master
Author | SHA1 | Date |
---|---|---|
Thomas Schmitt | 6fb158b56d | |
Thomas Schmitt | 51f43127ac | |
Thomas Schmitt | f84d038121 | |
Thomas Schmitt | e5a8d91e4d | |
Thomas Schmitt | f0d9795cd1 | |
Thomas Schmitt | 29bfd7e5e7 | |
Thomas Schmitt | d48bbb4b66 | |
Thomas Schmitt | 17a020e9fc | |
Thomas Schmitt | 069b4edecd | |
Thomas Schmitt | 84e8efeb0a | |
Thomas Schmitt | ddebbf1b60 | |
Thomas Schmitt | ca29b77091 | |
Thomas Schmitt | 046f581baa | |
Thomas Schmitt | c8ceb73b5f | |
Thomas Schmitt | f4a09e9536 |
|
@ -1,3 +1,9 @@
|
|||
git clone git@dev.lovelyhq.com:libburnia/libburn.git
|
||||
(to become libburn-1.5.8 or higher)
|
||||
===============================================================================
|
||||
- no novelties yet -
|
||||
|
||||
|
||||
libburn-1.5.6.tar.gz Wed Jun 07 2023
|
||||
===============================================================================
|
||||
* Bug fix: Overburning with cdrskin option -force ended by a libburn error
|
||||
|
|
|
@ -116,7 +116,7 @@ test_poll_SOURCES = test/poll.c
|
|||
|
||||
## cdrskin construction site - ts A60816 - C30607
|
||||
cdrskin_cdrskin_CPPFLAGS = -Ilibburn
|
||||
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_1_5_6
|
||||
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_1_5_7
|
||||
|
||||
# cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
|
||||
# ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
cdrskin. By Thomas Schmitt <scdbackup@gmx.net>
|
||||
Integrated sub project of libburnia-project.org but also published via:
|
||||
http://scdbackup.sourceforge.net/cdrskin_eng.html
|
||||
http://scdbackup.sourceforge.net/cdrskin-1.5.6.tar.gz
|
||||
http://scdbackup.sourceforge.net/cdrskin-1.5.7.tar.gz
|
||||
|
||||
Copyright (C) 2006-2023 Thomas Schmitt, provided under GPL version 2 or later.
|
||||
------------------------------------------------------------------------------
|
||||
|
@ -26,10 +26,10 @@ By using this software you agree to the disclaimer at the end of this text
|
|||
|
||||
Compilation, First Glimpse, Installation
|
||||
|
||||
Obtain cdrskin-1.5.6.tar.gz, take it to a directory of your choice and do:
|
||||
Obtain cdrskin-1.5.7.tar.gz, take it to a directory of your choice and do:
|
||||
|
||||
tar xzf cdrskin-1.5.6.tar.gz
|
||||
cd cdrskin-1.5.6
|
||||
tar xzf cdrskin-1.5.7.tar.gz
|
||||
cd cdrskin-1.5.7
|
||||
|
||||
Within that directory execute:
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH CDRSKIN 1 "Version 1.5.6, Jun 07, 2023"
|
||||
.TH CDRSKIN 1 "Version 1.5.7, Jun 07, 2023"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
|
|
|
@ -87,7 +87,7 @@ or
|
|||
|
||||
/** The official program version */
|
||||
#ifndef Cdrskin_prog_versioN
|
||||
#define Cdrskin_prog_versioN "1.5.6"
|
||||
#define Cdrskin_prog_versioN "1.5.7"
|
||||
#endif
|
||||
|
||||
/** The official libburn interface revision to use.
|
||||
|
@ -4461,6 +4461,13 @@ int Cdrskin_driveno_to_btldev(struct CdrskiN *skin, int driveno,
|
|||
loc= adr;
|
||||
ret= burn_drive_get_drive_role(skin->drives[driveno].drive);
|
||||
if(ret!=1) {
|
||||
if(strlen(adr) > Cdrskin_adrleN - 7) {
|
||||
fprintf(stderr,
|
||||
"cdrskin : FAILURE : File path too long for \"stdio:\" prefix: %s\n",
|
||||
adr);
|
||||
sprintf(btldev, "stdio:"); /* Address of the null drive */
|
||||
return(-1);
|
||||
}
|
||||
sprintf(btldev,"stdio:%s",adr);
|
||||
{ret= 2; goto adr_translation;}
|
||||
}
|
||||
|
|
|
@ -210,7 +210,7 @@ Standalone ISO 9660 multi-session CD/DVD/BD tool
|
|||
(detached GPG signature for verification by
|
||||
<KBD>gpg --verify cdrskin-1.5.6.tar.gz.sig cdrskin-1.5.6.tar.gz</KBD>
|
||||
<BR>
|
||||
after <KBD>gpg --keyserver keys.gnupg.net --recv-keys ABC0A854</KBD>).
|
||||
after <KBD>gpg --keyserver keyserver.ubuntu.com --recv-keys ABC0A854</KBD>).
|
||||
</DD>
|
||||
<DD>
|
||||
The cdrskin tarballs are source code identical with libburn releases
|
||||
|
@ -302,9 +302,10 @@ Bug fixes towards cdrskin-1.5.6:
|
|||
<DD><A HREF="cdrskin_help_devel">cdrskin-1.5.7 -help</A></DD>
|
||||
<DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 1.5.7)</A></DD>
|
||||
<DD> </DD>
|
||||
<DT>Maintainers of cdrskin unstable packages please use SVN of
|
||||
<DT>Maintainers of cdrskin unstable packages please use git of
|
||||
<A HREF="http://libburnia-project.org"> libburnia-project.org</A></DT>
|
||||
<DD>Download: <KBD><B>svn co http://svn.libburnia-project.org/libburn/trunk libburn</B>
|
||||
<DD>Download: <KBD>
|
||||
<B>git clone https://dev.lovelyhq.com/libburnia/libburn.git</B>
|
||||
</KBD></DD>
|
||||
<DD>Build: <KBD><B>cd libburn ; ./bootstrap ; ./configure --prefix /usr ; make ; cdrskin/compile_cdrskin.sh</B>
|
||||
</KBD></DD>
|
||||
|
|
|
@ -1 +1 @@
|
|||
#define Cdrskin_timestamP "2023.06.07.143001"
|
||||
#define Cdrskin_timestamP "2024.04.27.162735"
|
||||
|
|
|
@ -14230,7 +14230,7 @@ Updated cdrskin tarball generator
|
|||
cdrskin/cdrskin_eng.html
|
||||
Last minute correction in cdrskin web page
|
||||
|
||||
07 Jun 2023 []
|
||||
07 Jun 2023 [4628231]
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Updated change log
|
||||
|
@ -14242,6 +14242,21 @@ Updated change log
|
|||
* Bug fix: Overburning with cdrskin option -force ended by a libburn error
|
||||
|
||||
|
||||
2023.06.07.183206 []
|
||||
Makefile.am
|
||||
configure.ac
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/cdrskin.1
|
||||
cdrskin/README
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
Made number transition to 1.5.7
|
||||
|
||||
07 Jun 2023 []
|
||||
ChangeLog
|
||||
cdrskin/changelog.txt
|
||||
Updated change log
|
||||
|
||||
|
||||
[]
|
||||
libburn/cleanup.c
|
||||
|
|
18
configure.ac
18
configure.ac
|
@ -1,4 +1,4 @@
|
|||
AC_INIT([libburn], [1.5.6], [http://libburnia-project.org])
|
||||
AC_INIT([libburn], [1.5.7], [http://libburnia-project.org])
|
||||
AC_PREREQ([2.50])
|
||||
dnl AC_CONFIG_HEADER([config.h])
|
||||
|
||||
|
@ -139,7 +139,7 @@ dnl
|
|||
dnl As said: Only copies. Original in libburn/libburn.h : burn_header_version_*
|
||||
BURN_MAJOR_VERSION=1
|
||||
BURN_MINOR_VERSION=5
|
||||
BURN_MICRO_VERSION=6
|
||||
BURN_MICRO_VERSION=7
|
||||
BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
|
||||
|
||||
AC_SUBST(BURN_MAJOR_VERSION)
|
||||
|
@ -150,14 +150,14 @@ AC_SUBST(BURN_VERSION)
|
|||
dnl Libtool versioning
|
||||
LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
|
||||
dnl
|
||||
dnl This is the release version libburn-1.5.6
|
||||
dnl ### This is the development version after above release version
|
||||
dnl LT_CURRENT++, LT_AGE++ has not yet happened.
|
||||
dnl ### LT_CURRENT++, LT_AGE++ has happened meanwhile.
|
||||
dnl ### This is the release version libburn-1.5.6
|
||||
dnl This is the development version after above release version
|
||||
dnl ### LT_CURRENT++, LT_AGE++ has not yet happened.
|
||||
dnl LT_CURRENT++, LT_AGE++ has happened meanwhile.
|
||||
dnl
|
||||
dnl SONAME = 113 - 109 = 4 . Linux library name = libburn.so.4.109.0
|
||||
LT_CURRENT=113
|
||||
LT_AGE=109
|
||||
dnl SONAME = 114 - 110 = 4 . Linux library name = libburn.so.4.110.0
|
||||
LT_CURRENT=114
|
||||
LT_AGE=110
|
||||
LT_REVISION=0
|
||||
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2017 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2024 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
|
@ -279,7 +279,7 @@ static void *scan_worker_func(struct w_list *w)
|
|||
}
|
||||
|
||||
static void reset_progress(struct burn_drive *d, int sessions, int tracks,
|
||||
int indices, int sectors, int flag)
|
||||
int indices, off_t sectors, int flag)
|
||||
{
|
||||
/* reset the progress indicator */
|
||||
d->progress.session = 0;
|
||||
|
@ -412,7 +412,7 @@ void burn_disc_erase(struct burn_drive *drive, int fast)
|
|||
return;
|
||||
}
|
||||
|
||||
reset_progress(drive, 1, 1, 1, 0x10000, 0);
|
||||
reset_progress(drive, 1, 1, 1, (off_t) 0x10000, 0);
|
||||
|
||||
/* A70103 : will be set to 0 by burn_disc_erase_sync() */
|
||||
drive->cancel = 1;
|
||||
|
@ -494,7 +494,7 @@ void burn_disc_format(struct burn_drive *drive, off_t size, int flag)
|
|||
int ok = 0, ret;
|
||||
char msg[40];
|
||||
|
||||
reset_progress(drive, 1, 1, 1, 0x10000, 0);
|
||||
reset_progress(drive, 1, 1, 1, (off_t) 0x10000, 0);
|
||||
|
||||
if ((SCAN_GOING()) || find_worker(drive) != NULL) {
|
||||
libdax_msgs_submit(libdax_messenger, drive->global_index,
|
||||
|
@ -652,7 +652,7 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
|||
}
|
||||
|
||||
reset_progress(d, disc->sessions, disc->session[0]->tracks,
|
||||
disc->session[0]->track[0]->indices, 0, 0);
|
||||
disc->session[0]->track[0]->indices, (off_t) 0, 0);
|
||||
|
||||
/* For the next lines any return indicates failure */
|
||||
d->cancel = 1;
|
||||
|
|
129
libburn/drive.c
129
libburn/drive.c
|
@ -1,7 +1,7 @@
|
|||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2021 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2024 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
|
@ -1136,12 +1136,13 @@ int burn_disc_erasable(struct burn_drive *d)
|
|||
{
|
||||
return d->erasable;
|
||||
}
|
||||
enum burn_drive_status burn_drive_get_status(struct burn_drive *d,
|
||||
struct burn_progress *p)
|
||||
|
||||
|
||||
void burn_drive_get_status_sig_handling(void)
|
||||
{
|
||||
/* --- Part of asynchronous signal handling --- */
|
||||
/* This frequently used call may be used to react on messages from
|
||||
the libburn built-in signal handler.
|
||||
/* The frequently used call burn_drive_get_status*() may be used
|
||||
to react on messages from the libburn built-in signal handler.
|
||||
*/
|
||||
|
||||
/* ts B00225 :
|
||||
|
@ -1165,11 +1166,61 @@ enum burn_drive_status burn_drive_get_status(struct burn_drive *d,
|
|||
}
|
||||
|
||||
/* --- End of asynchronous signal handling --- */
|
||||
}
|
||||
|
||||
|
||||
enum burn_drive_status burn_drive_get_status(struct burn_drive *d,
|
||||
struct burn_progress *p)
|
||||
{
|
||||
burn_drive_get_status_sig_handling();
|
||||
|
||||
if (p != NULL) {
|
||||
memcpy(p, &(d->progress), sizeof(struct burn_progress));
|
||||
/* TODO: add mutex */
|
||||
|
||||
p->sessions = d->progress.sessions;
|
||||
p->session = d->progress.session;
|
||||
p->tracks = d->progress.tracks;
|
||||
p->track = d->progress.track;
|
||||
p->indices = d->progress.indices;
|
||||
p->index = d->progress.index;
|
||||
if(d->progress.start_sector < 0x80000000)
|
||||
p->start_sector = d->progress.start_sector;
|
||||
else
|
||||
p->start_sector = 0x7fffffff;
|
||||
if(d->progress.sectors < 0x80000000)
|
||||
p->sectors = d->progress.sectors;
|
||||
else
|
||||
p->sectors = 0x7fffffff;
|
||||
if(d->progress.sector < 0x80000000)
|
||||
p->sector = d->progress.sector;
|
||||
else
|
||||
p->sector = 0x7fffffff;
|
||||
if(d->progress.buffer_capacity < 0x100000000)
|
||||
p->buffer_capacity = d->progress.buffer_capacity;
|
||||
else
|
||||
p->buffer_capacity = 0xffffffff;
|
||||
if(d->progress.buffer_available < 0x100000000)
|
||||
p->buffer_available = d->progress.buffer_available;
|
||||
else
|
||||
p->buffer_available = 0xffffffff;
|
||||
p->buffered_bytes = d->progress.buffered_bytes;
|
||||
if(d->progress.buffer_min_fill < 0x100000000)
|
||||
p->buffer_min_fill = d->progress.buffer_min_fill;
|
||||
else
|
||||
p->buffer_min_fill = 0xffffffff;
|
||||
}
|
||||
return d->busy;
|
||||
}
|
||||
|
||||
|
||||
enum burn_drive_status burn_drive_get_status_v2(struct burn_drive *d,
|
||||
struct burn_progress_v2 *p)
|
||||
{
|
||||
burn_drive_get_status_sig_handling();
|
||||
if (p != NULL) {
|
||||
/* TODO: add mutex */
|
||||
|
||||
memcpy(p, &(d->progress), sizeof(struct burn_progress_v2));
|
||||
}
|
||||
return d->busy;
|
||||
}
|
||||
|
@ -2275,12 +2326,12 @@ int burn_drive_find_scsi_equiv(char *path, char adr[])
|
|||
burn_drive_adr_debug_msg(msg, NULL);
|
||||
return 0;
|
||||
}
|
||||
sprintf(msg, "burn_drive_find_scsi_equiv( %s ) : (%d),%d,%d,%d,%d",
|
||||
sprintf(msg, "burn_drive_find_scsi_equiv( %s ) : %d,%d,%d,%d,%d",
|
||||
path, bus_no, host_no, channel_no, target_no, lun_no);
|
||||
burn_drive_adr_debug_msg(msg, NULL);
|
||||
|
||||
ret= burn_drive_convert_scsi_adr(-1, host_no, channel_no, target_no,
|
||||
lun_no, adr);
|
||||
ret= burn_drive_convert_scsi_adr(bus_no, host_no, channel_no,
|
||||
target_no, lun_no, adr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2642,10 +2693,10 @@ int burn_disc_read_atip(struct burn_drive *d)
|
|||
}
|
||||
|
||||
/* ts A61110 : new API function */
|
||||
int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
|
||||
int trackno, int *lba, int *nwa)
|
||||
int burn_disc_track_lba_nwa_v2(struct burn_drive *d, struct burn_write_opts *o,
|
||||
int trackno, off_t *lba, off_t *nwa)
|
||||
{
|
||||
int ret;
|
||||
int ret, int_lba, int_nwa;
|
||||
|
||||
if (burn_drive_is_released(d)) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
|
@ -2673,11 +2724,38 @@ int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
|
|||
return 0;
|
||||
if (o != NULL)
|
||||
d->send_write_parameters(d, NULL, -1, o);
|
||||
ret = d->get_nwa(d, trackno, lba, nwa);
|
||||
ret = d->get_nwa(d, trackno, &int_lba, &int_nwa);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
*lba = int_lba;
|
||||
*nwa = int_nwa;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* ts A61110 / C40302 : API */
|
||||
int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
|
||||
int trackno, int *lba, int *nwa)
|
||||
{
|
||||
int ret;
|
||||
off_t off_lba, off_nwa;
|
||||
|
||||
ret = burn_disc_track_lba_nwa_v2(d, o, trackno, &off_lba, &off_nwa);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
if (off_lba > 0x7fffffff)
|
||||
*lba = 0x7fffffff;
|
||||
else
|
||||
*lba = off_lba;
|
||||
if (off_nwa > 0x7fffffff) {
|
||||
*nwa = 0x7fffffff;
|
||||
return 0;
|
||||
} else {
|
||||
*nwa = off_nwa;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* ts A70131 : new API function */
|
||||
int burn_disc_get_msc1(struct burn_drive *d, int *start)
|
||||
{
|
||||
|
@ -3416,15 +3494,32 @@ int burn_drive_set_media_capacity_remaining(struct burn_drive *d, off_t value)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* ts C40303 : API */
|
||||
int burn_get_read_capacity_v2(struct burn_drive *d, off_t *capacity, int flag)
|
||||
{
|
||||
*capacity = d->media_read_capacity +
|
||||
(d->media_read_capacity != 0x7fffffffffffffff);
|
||||
return (d->media_read_capacity != 0x7fffffffffffffff);
|
||||
}
|
||||
|
||||
/* ts A81215 : API */
|
||||
int burn_get_read_capacity(struct burn_drive *d, int *capacity, int flag)
|
||||
{
|
||||
*capacity = d->media_read_capacity +
|
||||
(d->media_read_capacity != 0x7fffffff);
|
||||
return (d->media_read_capacity != 0x7fffffff);
|
||||
}
|
||||
int ret;
|
||||
off_t cap;
|
||||
|
||||
ret= burn_get_read_capacity_v2(d, &cap, flag);
|
||||
if (cap < -0x7fffffff) {
|
||||
*capacity = -0x7fffffff;
|
||||
ret = 0;
|
||||
} else if (cap > 0x7fffffff) {
|
||||
*capacity = 0x7fffffff;
|
||||
ret = 0;
|
||||
} else {
|
||||
*capacity = cap;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* ts A90903 : API */
|
||||
int burn_disc_get_media_id(struct burn_drive *d,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2021 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2024 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
|
@ -172,9 +172,10 @@ int burn_drive_grab_stdio(struct burn_drive *d, int flag);
|
|||
|
||||
/* ts C10213 */
|
||||
/* The size of limitless or oversized devices as pseudo drives */
|
||||
/* Do not change this value because of its meaning to
|
||||
/* Do not lightheartedly change this value because of its meaning to
|
||||
burn_drive.media_read_capacity in libburn/transport.h
|
||||
64 TiB = 2 exp 46 = 2 exp 35 blocks
|
||||
*/
|
||||
#define BURN_DRIVE_MAX_BYTES ((off_t) (0x7ffffff0) * (off_t) 2048)
|
||||
#define BURN_DRIVE_MAX_BYTES ((off_t) (0x800000000) * (off_t) 2048)
|
||||
|
||||
#endif /* __DRIVE */
|
||||
|
|
|
@ -88,7 +88,7 @@ struct burn_source_offst {
|
|||
int size_adjustable;
|
||||
|
||||
/* for set_size/get_size */
|
||||
int nominal_size;
|
||||
off_t nominal_size;
|
||||
|
||||
/* To help offst_free() */
|
||||
struct burn_source *next;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2023 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2024 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
|
||||
This is the official API definition of libburn.
|
||||
|
@ -9,6 +9,8 @@
|
|||
*/
|
||||
/* Important: If you add a public API function then add its name to file
|
||||
libburn/libburn.ver
|
||||
in the node LIBBURN4_Major.Minor.Micro with the numbers of
|
||||
the next release version, citing the previous node.
|
||||
*/
|
||||
|
||||
|
||||
|
@ -376,6 +378,9 @@ struct burn_toc_entry
|
|||
@since 0.5.2 : DVD extensions are made valid for CD too
|
||||
bit1= LRA extension is valid @since 0.7.2
|
||||
bit2= Track status bits extension is valid @since 1.2.8
|
||||
bit3= Long block address is valid:
|
||||
long_start_lba, long_track_blocks, long_last_rec_adr
|
||||
@since 1.5.8
|
||||
*/
|
||||
unsigned char extensions_valid;
|
||||
|
||||
|
@ -386,8 +391,10 @@ struct burn_toc_entry
|
|||
unsigned char session_msb;
|
||||
unsigned char point_msb;
|
||||
/* pmin, psec, and pframe may be too small if DVD extension is valid */
|
||||
/* -1 means that only long_start_lba is valid */
|
||||
int start_lba;
|
||||
/* min, sec, and frame may be too small if DVD extension is valid */
|
||||
/* -1 means that only long_track_blocks is valid */
|
||||
int track_blocks;
|
||||
|
||||
/* ts A90909 : LRA extension. extensions_valid:bit1 */
|
||||
|
@ -396,6 +403,7 @@ struct burn_toc_entry
|
|||
DVD-R DL when LJRS = 00b, DVD-RW, HD DVD-R, and BD-R.
|
||||
This would mean profiles: 0x11, 0x15, 0x13, 0x14, 0x51, 0x41, 0x42
|
||||
*/
|
||||
/* -1 means that only long_last_rec_adr is valid */
|
||||
int last_recorded_address;
|
||||
|
||||
/* ts B30112 : Track status bits extension. extensions_valid:bit2 */
|
||||
|
@ -415,6 +423,12 @@ struct burn_toc_entry
|
|||
*/
|
||||
int track_status_bits;
|
||||
|
||||
/* ts C40221 : Long block address extension. extensions_valid:bit3 */
|
||||
/* @since 1.5.8 */
|
||||
off_t long_start_lba;
|
||||
off_t long_track_blocks;
|
||||
off_t long_last_rec_adr;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -666,7 +680,8 @@ struct burn_drive_info
|
|||
|
||||
|
||||
/** Operation progress report. All values are 0 based indices.
|
||||
* */
|
||||
Handed out by burn_drive_get_status().
|
||||
**/
|
||||
struct burn_progress {
|
||||
/** The total number of sessions */
|
||||
int sessions;
|
||||
|
@ -708,6 +723,52 @@ struct burn_progress {
|
|||
};
|
||||
|
||||
|
||||
/** Operation progress report with long block numbers.
|
||||
All values are 0 based indices.
|
||||
Handed out by burn_drive_get_status_v2().
|
||||
@since 1.5.8
|
||||
**/
|
||||
struct burn_progress_v2 {
|
||||
/** Revision of the struct format.
|
||||
0= Elements up to .buffer_min_fill */
|
||||
int revision;
|
||||
|
||||
/** The total number of sessions */
|
||||
int sessions;
|
||||
/** Current session.*/
|
||||
int session;
|
||||
/** The total number of tracks */
|
||||
int tracks;
|
||||
/** Current track. */
|
||||
int track;
|
||||
/** The total number of indices */
|
||||
int indices;
|
||||
/** Current index. */
|
||||
int index;
|
||||
/** The starting logical block address */
|
||||
off_t start_sector;
|
||||
/** On write: The number of sectors.
|
||||
On blank: 0x10000 as upper limit for relative progress steps */
|
||||
off_t sectors;
|
||||
/** On write: The current sector being processed.
|
||||
On blank: Relative progress steps 0 to 0x10000 */
|
||||
off_t sector;
|
||||
|
||||
/** The capacity of the drive buffer */
|
||||
off_t buffer_capacity;
|
||||
/** The free space in the drive buffer (might be slightly outdated) */
|
||||
off_t buffer_available;
|
||||
|
||||
/** The number of bytes sent to the drive buffer */
|
||||
off_t buffered_bytes;
|
||||
/** The minimum number of bytes stored in buffer during write.
|
||||
(Caution: Before surely one buffer size of bytes was processed,
|
||||
this value is 0x7fffffffffffffff.)
|
||||
*/
|
||||
off_t buffer_min_fill;
|
||||
};
|
||||
|
||||
|
||||
/* ts A61226 */
|
||||
/* @since 0.3.0 */
|
||||
/** Description of a speed capability as reported by the drive in conjunction
|
||||
|
@ -1481,6 +1542,13 @@ int burn_disc_get_phys_format_info(struct burn_drive *d, int *disk_category,
|
|||
int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
|
||||
int trackno, int *lba, int *nwa);
|
||||
|
||||
/* ts C40302 */
|
||||
/** Like burn_disc_track_lba_nwa(), but with off_t results.
|
||||
@since 1.5.8
|
||||
*/
|
||||
int burn_disc_track_lba_nwa_v2(struct burn_drive *d, struct burn_write_opts *o,
|
||||
int trackno, off_t *lba, off_t *nwa);
|
||||
|
||||
/* ts B10525 */
|
||||
/** Tells whether a previous attempt to determine the Next Writeable Address
|
||||
of the upcoming track reveiled that the READ TRACK INFORMATION Damage Bit
|
||||
|
@ -1653,6 +1721,15 @@ int burn_disc_erasable(struct burn_drive *d);
|
|||
enum burn_drive_status burn_drive_get_status(struct burn_drive *drive,
|
||||
struct burn_progress *p);
|
||||
|
||||
/** Returns the progress with long block numbers and the status of the drive.
|
||||
@param drive The drive to query busy state for.
|
||||
@param p Returns the progress of the operation, NULL if you don't care
|
||||
@return the current status of the drive. See also burn_drive_status.
|
||||
@since 1.5.8
|
||||
*/
|
||||
enum burn_drive_status burn_drive_get_status_v2(struct burn_drive *drive,
|
||||
struct burn_progress_v2 *p);
|
||||
|
||||
/** Creates a write_opts struct for burning to the specified drive.
|
||||
The returned object must later be freed with burn_write_opts_free().
|
||||
@param drive The drive to write with
|
||||
|
@ -2986,6 +3063,11 @@ int burn_track_set_size(struct burn_track *t, off_t size);
|
|||
*/
|
||||
int burn_track_get_sectors(struct burn_track *);
|
||||
|
||||
/* ts C40302 */
|
||||
/** Like burn_track_get_sectors(), but with return type off_t.
|
||||
@since 1.5.8
|
||||
*/
|
||||
off_t burn_track_get_sectors_v2(struct burn_track *);
|
||||
|
||||
/* ts A61101 */
|
||||
/** Tells how many source bytes have been read and how many data bytes have
|
||||
|
@ -3779,8 +3861,19 @@ struct burn_session **burn_disc_get_sessions(struct burn_disc *d,
|
|||
int burn_disc_get_incomplete_sessions(struct burn_disc *d);
|
||||
|
||||
|
||||
/** Tells how many sectors a disc will have, or already has.
|
||||
This is the sum of all burn_session_get_sectors() results of the disc.
|
||||
The result is NOT RELIABLE with tracks of undefined length
|
||||
*/
|
||||
int burn_disc_get_sectors(struct burn_disc *d);
|
||||
|
||||
/* ts C40302 */
|
||||
/** Like burn_disc_get_sectors(), but with return type off_t.
|
||||
@since 1.5.8
|
||||
*/
|
||||
off_t burn_disc_get_sectors_v2(struct burn_disc *d);
|
||||
|
||||
|
||||
/** Gets an array of all the tracks for a session
|
||||
THIS IS NO LONGER VALID AFTER YOU ADD OR REMOVE A TRACK
|
||||
@param s session to get track array for
|
||||
|
@ -3790,8 +3883,19 @@ int burn_disc_get_sectors(struct burn_disc *d);
|
|||
struct burn_track **burn_session_get_tracks(struct burn_session *s,
|
||||
int *num);
|
||||
|
||||
/** Tells how many sectors a session will have, or already has on disc.
|
||||
This is the sum of all burn_track_get_sectors() results of the session.
|
||||
The result is NOT RELIABLE with tracks of undefined length
|
||||
*/
|
||||
int burn_session_get_sectors(struct burn_session *s);
|
||||
|
||||
/* ts C40302 */
|
||||
/** Like burn_session_get_sectors(), but with return type off_t.
|
||||
@since 1.5.8
|
||||
*/
|
||||
off_t burn_session_get_sectors_v2(struct burn_session *s);
|
||||
|
||||
|
||||
/** Gets the mode of a track
|
||||
@param track the track to query
|
||||
@return the track's mode
|
||||
|
@ -3834,7 +3938,7 @@ void burn_version(int *major, int *minor, int *micro);
|
|||
*/
|
||||
#define burn_header_version_major 1
|
||||
#define burn_header_version_minor 5
|
||||
#define burn_header_version_micro 6
|
||||
#define burn_header_version_micro 7
|
||||
/** Note:
|
||||
Above version numbers are also recorded in configure.ac because libtool
|
||||
wants them as parameters at build time.
|
||||
|
@ -4147,6 +4251,12 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
|||
*/
|
||||
int burn_get_read_capacity(struct burn_drive *d, int *capacity, int flag);
|
||||
|
||||
/* ts C40303 */
|
||||
/** Like burn_get_read_capacity(), but with off_t result.
|
||||
@since 1.5.8
|
||||
*/
|
||||
int burn_get_read_capacity_v2(struct burn_drive *d, off_t *capacity, int flag);
|
||||
|
||||
|
||||
/* ts A70812 */
|
||||
/** Read data in random access mode.
|
||||
|
|
|
@ -213,3 +213,13 @@ libdax_audioxtr_new;
|
|||
libdax_audioxtr_read;
|
||||
local: *;
|
||||
};
|
||||
|
||||
LIBBURN4_1.5.8 {
|
||||
burn_disc_get_sectors_v2;
|
||||
burn_disc_track_lba_nwa_v2;
|
||||
burn_drive_get_status_v2;
|
||||
burn_get_read_capacity_v2;
|
||||
burn_session_get_sectors_v2;
|
||||
burn_track_get_sectors_v2;
|
||||
} LIBBURN4;
|
||||
|
||||
|
|
193
libburn/mmc.c
193
libburn/mmc.c
|
@ -1,7 +1,7 @@
|
|||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2016 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2024 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
|
@ -300,6 +300,14 @@ int mmc_four_char_to_int(unsigned char *data)
|
|||
}
|
||||
|
||||
|
||||
/* ts C40226 */
|
||||
unsigned int mmc_four_char_to_uint(unsigned char *data)
|
||||
{
|
||||
return (((unsigned int) data[0]) << 24) | (data[1] << 16) |
|
||||
(data[2] << 8) | data[3];
|
||||
}
|
||||
|
||||
|
||||
/* ts A70201 */
|
||||
int mmc_int_to_four_char(unsigned char *data, int num)
|
||||
{
|
||||
|
@ -311,6 +319,17 @@ int mmc_int_to_four_char(unsigned char *data, int num)
|
|||
}
|
||||
|
||||
|
||||
/* ts C40226 */
|
||||
int mmc_uint_to_four_char(unsigned char *data, unsigned int num)
|
||||
{
|
||||
data[0] = (num >> 24) & 0xff;
|
||||
data[1] = (num >> 16) & 0xff;
|
||||
data[2] = (num >> 8) & 0xff;
|
||||
data[3] = num & 0xff;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int mmc_start_for_bit0 = 0;
|
||||
|
||||
/* @param flag bit0= the calling function should need no START UNIT.
|
||||
|
@ -747,7 +766,8 @@ ex:;
|
|||
*/
|
||||
static int mmc_wait_for_buffer_free(struct burn_drive *d, struct buffer *buf)
|
||||
{
|
||||
int usec= 0, need, reported_3s = 0, first_wait = 1;
|
||||
int usec= 0, reported_3s = 0, first_wait = 1;
|
||||
off_t need;
|
||||
struct timeval t0,tnow;
|
||||
double max_fac, min_fac, waiting;
|
||||
|
||||
|
@ -926,11 +946,11 @@ static int print_time(int flag)
|
|||
#endif /* Libburn_write_time_debuG */
|
||||
|
||||
|
||||
int mmc_write(struct burn_drive *d, int start, struct buffer *buf)
|
||||
int mmc_write(struct burn_drive *d, off_t start_long, struct buffer *buf)
|
||||
{
|
||||
int cancelled;
|
||||
struct command *c;
|
||||
int len, key, asc, ascq;
|
||||
int len, key, asc, ascq, start;
|
||||
char *msg = NULL;
|
||||
|
||||
#ifdef Libburn_write_time_debuG
|
||||
|
@ -942,6 +962,16 @@ fprintf(stderr, "libburn_DEBUG: buffer sectors= %d bytes= %d\n",
|
|||
buf->sectors, buf->bytes);
|
||||
*/
|
||||
|
||||
if (start_long > (off_t) 0x7fffffff) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x0002012d,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Exceeding range of signed integer block addresses",
|
||||
0, 0);
|
||||
d->cancel = 1;
|
||||
return BE_CANCELLED;
|
||||
}
|
||||
start = start_long;
|
||||
|
||||
c = &(d->casual_command);
|
||||
|
||||
|
@ -971,19 +1001,10 @@ fprintf(stderr, "libburn_DEBUG: buffer sectors= %d bytes= %d\n",
|
|||
sprintf(msg,
|
||||
"Exceeding range of permissible write addresses (%d >= %d)",
|
||||
start, d->media_lba_limit);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x0002012d,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
strcpy(msg, "CDB= ");
|
||||
if (spc_human_readable_cmd(c, msg + strlen(msg),
|
||||
320 - strlen(msg), 1) > 0) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x0002012d,
|
||||
LIBDAX_MSGS_SEV_FATAL,
|
||||
LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
}
|
||||
free(msg);
|
||||
}
|
||||
d->cancel = 1; /* No need for mutexing because atomic */
|
||||
|
@ -1055,7 +1076,7 @@ fprintf(stderr, "libburn_DEBUG: buffer sectors= %d bytes= %d\n",
|
|||
*/
|
||||
if (d->current_profile == 0x14 && d->write_opts != NULL &&
|
||||
(d->progress.buffer_capacity == 0 ||
|
||||
start < (int) d->progress.buffer_capacity / 2048) &&
|
||||
start < (off_t) d->progress.buffer_capacity / 2048) &&
|
||||
key == 5 && asc == 0x64 && ascq == 0) {
|
||||
if (d->write_opts->write_type == BURN_WRITE_TAO) {
|
||||
d->was_feat21h_failure = 1 + (start == 0);
|
||||
|
@ -1096,10 +1117,11 @@ int mmc_fake_toc_entry(struct burn_toc_entry *entry, int session_number,
|
|||
unsigned char *size_data, unsigned char *start_data,
|
||||
unsigned char *last_adr_data)
|
||||
{
|
||||
int min, sec, frames, num;
|
||||
int min, sec, frames;
|
||||
unsigned int num;
|
||||
|
||||
/* mark DVD extensions and Track Info extension as valid */
|
||||
entry->extensions_valid |= (1 | 2);
|
||||
/* mark extensions as valid: DVD, Track Info, Long block address */
|
||||
entry->extensions_valid |= (1 | 2 | 8);
|
||||
|
||||
/* defaults are as of mmc5r03.pdf 6.26.3.2.4 Fabricated TOC */
|
||||
entry->session = session_number & 0xff;
|
||||
|
@ -1109,9 +1131,16 @@ int mmc_fake_toc_entry(struct burn_toc_entry *entry, int session_number,
|
|||
entry->tno = 0;
|
||||
entry->point = track_number & 0xff;
|
||||
entry->point_msb = (track_number >> 8) & 0xff;
|
||||
num = mmc_four_char_to_int(size_data);
|
||||
entry->track_blocks = num;
|
||||
burn_lba_to_msf(num, &min, &sec, &frames);
|
||||
num = mmc_four_char_to_uint(size_data);
|
||||
if (num < 0x80000000) {
|
||||
entry->track_blocks = num;
|
||||
burn_lba_to_msf(num, &min, &sec, &frames);
|
||||
} else {
|
||||
entry->track_blocks = -1;
|
||||
min = 477218; /* ~=LBA 0x7fffffff */
|
||||
sec = frames = 0;
|
||||
}
|
||||
entry->long_track_blocks = num;
|
||||
if (min > 255) {
|
||||
min = 255;
|
||||
sec = 255;
|
||||
|
@ -1121,9 +1150,16 @@ int mmc_fake_toc_entry(struct burn_toc_entry *entry, int session_number,
|
|||
entry->sec = sec;
|
||||
entry->frame = frames;
|
||||
entry->zero = 0;
|
||||
num = mmc_four_char_to_int(start_data);
|
||||
entry->start_lba = num;
|
||||
burn_lba_to_msf(num, &min, &sec, &frames);
|
||||
num = mmc_four_char_to_uint(start_data);
|
||||
if (num < 0x80000000) {
|
||||
entry->start_lba = num;
|
||||
burn_lba_to_msf(num, &min, &sec, &frames);
|
||||
} else {
|
||||
entry->start_lba = -1;
|
||||
min = 477218;
|
||||
sec = frames = 0;
|
||||
}
|
||||
entry->long_start_lba = num;
|
||||
if (min > 255) {
|
||||
min = 255;
|
||||
sec = 255;
|
||||
|
@ -1132,7 +1168,13 @@ int mmc_fake_toc_entry(struct burn_toc_entry *entry, int session_number,
|
|||
entry->pmin = min;
|
||||
entry->psec = sec;
|
||||
entry->pframe = frames;
|
||||
entry->last_recorded_address = mmc_four_char_to_int(last_adr_data);
|
||||
num = mmc_four_char_to_uint(last_adr_data);
|
||||
if (num < 0x80000000) {
|
||||
entry->last_recorded_address = num;
|
||||
} else {
|
||||
entry->last_recorded_address = -1;
|
||||
}
|
||||
entry->long_last_rec_adr = num;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1146,7 +1188,7 @@ static int mmc_read_toc_fmt0_al(struct burn_drive *d, int *alloc_len)
|
|||
struct buffer *buf = NULL;
|
||||
struct command *c = NULL;
|
||||
int dlen, i, old_alloc_len, session_number, prev_session = -1, ret;
|
||||
int lba, size;
|
||||
unsigned int lba, size;
|
||||
unsigned char *tdata, size_data[4], start_data[4], end_data[4];
|
||||
|
||||
if (*alloc_len < 4)
|
||||
|
@ -1225,11 +1267,11 @@ err_ex:;
|
|||
if (session_number != prev_session && prev_session > 0) {
|
||||
/* leadout entry previous session */
|
||||
entry = &(d->toc_entry[(i - 1) + prev_session]);
|
||||
lba = mmc_four_char_to_int(start_data) +
|
||||
mmc_four_char_to_int(size_data);
|
||||
mmc_int_to_four_char(start_data, lba);
|
||||
mmc_int_to_four_char(size_data, 0);
|
||||
mmc_int_to_four_char(end_data, lba - 1);
|
||||
lba = mmc_four_char_to_uint(start_data) +
|
||||
mmc_four_char_to_uint(size_data);
|
||||
mmc_uint_to_four_char(start_data, lba);
|
||||
mmc_uint_to_four_char(size_data, 0);
|
||||
mmc_uint_to_four_char(end_data, lba - 1);
|
||||
mmc_fake_toc_entry(entry, prev_session, 0xA2,
|
||||
size_data, start_data, end_data);
|
||||
entry->min= entry->sec= entry->frame= 0;
|
||||
|
@ -1254,11 +1296,11 @@ err_ex:;
|
|||
memcpy(start_data, tdata + 4, 4);
|
||||
/* size_data are estimated from next track start */
|
||||
memcpy(size_data, tdata + 8 + 4, 4);
|
||||
mmc_int_to_four_char(end_data,
|
||||
mmc_four_char_to_int(size_data) - 1);
|
||||
size = mmc_four_char_to_int(size_data) -
|
||||
mmc_four_char_to_int(start_data);
|
||||
mmc_int_to_four_char(size_data, size);
|
||||
mmc_uint_to_four_char(end_data,
|
||||
mmc_four_char_to_uint(size_data) - 1);
|
||||
size = mmc_four_char_to_uint(size_data) -
|
||||
mmc_four_char_to_uint(start_data);
|
||||
mmc_uint_to_four_char(size_data, size);
|
||||
mmc_fake_toc_entry(entry, session_number, i + 1,
|
||||
size_data, start_data, end_data);
|
||||
if (prev_session != session_number)
|
||||
|
@ -1271,9 +1313,9 @@ err_ex:;
|
|||
tdata = c->page->data + 4 + d->last_track_no * 8;
|
||||
entry = &(d->toc_entry[(d->last_track_no - 1) + prev_session]);
|
||||
memcpy(start_data, tdata + 4, 4);
|
||||
mmc_int_to_four_char(size_data, 0);
|
||||
mmc_int_to_four_char(end_data,
|
||||
mmc_four_char_to_int(start_data) - 1);
|
||||
mmc_uint_to_four_char(size_data, 0);
|
||||
mmc_uint_to_four_char(end_data,
|
||||
mmc_four_char_to_uint(start_data) - 1);
|
||||
mmc_fake_toc_entry(entry, prev_session, 0xA2,
|
||||
size_data, start_data, end_data);
|
||||
entry->min= entry->sec= entry->frame= 0;
|
||||
|
@ -1310,7 +1352,8 @@ int mmc_fake_toc(struct burn_drive *d)
|
|||
struct burn_session *session;
|
||||
struct burn_toc_entry *entry;
|
||||
struct buffer *buf = NULL;
|
||||
int i, session_number, prev_session = -1, ret, lba, alloc_len = 34;
|
||||
int i, session_number, prev_session = -1, ret, alloc_len = 34;
|
||||
unsigned int lba;
|
||||
unsigned char *tdata, size_data[4], start_data[4], end_data[4];
|
||||
char *msg = NULL;
|
||||
|
||||
|
@ -1415,11 +1458,11 @@ int mmc_fake_toc(struct burn_drive *d)
|
|||
if (session_number != prev_session && prev_session > 0) {
|
||||
/* leadout entry previous session */
|
||||
entry = &(d->toc_entry[(i - 1) + prev_session]);
|
||||
lba = mmc_four_char_to_int(start_data) +
|
||||
mmc_four_char_to_int(size_data);
|
||||
mmc_int_to_four_char(start_data, lba);
|
||||
mmc_int_to_four_char(size_data, 0);
|
||||
mmc_int_to_four_char(end_data, lba - 1);
|
||||
lba = mmc_four_char_to_uint(start_data) +
|
||||
mmc_four_char_to_uint(size_data);
|
||||
mmc_uint_to_four_char(start_data, lba);
|
||||
mmc_uint_to_four_char(size_data, 0);
|
||||
mmc_uint_to_four_char(end_data, lba - 1);
|
||||
mmc_fake_toc_entry(entry, prev_session, 0xA2,
|
||||
size_data, start_data, end_data);
|
||||
entry->min= entry->sec= entry->frame= 0;
|
||||
|
@ -1440,7 +1483,7 @@ int mmc_fake_toc(struct burn_drive *d)
|
|||
if (i == d->last_track_no - 1) {
|
||||
/* ts A70212 : Last track field Free Blocks */
|
||||
burn_drive_set_media_capacity_remaining(d,
|
||||
((off_t) mmc_four_char_to_int(tdata + 16)) *
|
||||
((off_t) mmc_four_char_to_uint(tdata + 16)) *
|
||||
((off_t) 2048));
|
||||
d->media_lba_limit = 0;
|
||||
}
|
||||
|
@ -1486,11 +1529,11 @@ int mmc_fake_toc(struct burn_drive *d)
|
|||
if (prev_session > 0 && prev_session <= d->disc->sessions) {
|
||||
/* leadout entry of last session of closed disc */
|
||||
entry = &(d->toc_entry[(d->last_track_no - 1) + prev_session]);
|
||||
lba = mmc_four_char_to_int(start_data) +
|
||||
mmc_four_char_to_int(size_data);
|
||||
mmc_int_to_four_char(start_data, lba);
|
||||
mmc_int_to_four_char(size_data, 0);
|
||||
mmc_int_to_four_char(end_data, lba - 1);
|
||||
lba = mmc_four_char_to_uint(start_data) +
|
||||
mmc_four_char_to_uint(size_data);
|
||||
mmc_uint_to_four_char(start_data, lba);
|
||||
mmc_uint_to_four_char(size_data, 0);
|
||||
mmc_uint_to_four_char(end_data, lba - 1);
|
||||
mmc_fake_toc_entry(entry, prev_session, 0xA2,
|
||||
size_data, start_data, end_data);
|
||||
entry->min= entry->sec= entry->frame= 0;
|
||||
|
@ -1741,8 +1784,8 @@ static int mmc_read_toc_al(struct burn_drive *d, int *alloc_len)
|
|||
TOC format 2 always reports 2 blocks more than are readable.
|
||||
So here it is possible to check and mark as trusted.
|
||||
*/
|
||||
if (highest_leadout > 0 && d->media_read_capacity != 0x7fffffff &&
|
||||
!d->mr_capacity_trusted) {
|
||||
if (highest_leadout > 0 && d->media_read_capacity != 0x7fffffffffffffff
|
||||
&& !d->mr_capacity_trusted) {
|
||||
if (highest_leadout - 3 == d->media_read_capacity) {
|
||||
d->mr_capacity_trusted = 1;
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
|
@ -1783,12 +1826,12 @@ void mmc_read_toc(struct burn_drive *d)
|
|||
}
|
||||
|
||||
|
||||
/* ts A70131 : This tries to get the start of the last complete session */
|
||||
/* ts C40226 : long address reply version of mmc_read_multi_session_c1 */
|
||||
/* man mkisofs , option -C :
|
||||
The first number is the sector number of the first sector in
|
||||
the last session of the disk that should be appended to.
|
||||
*/
|
||||
int mmc_read_multi_session_c1(struct burn_drive *d, int *trackno, int *start)
|
||||
int mmc_read_msc1_long(struct burn_drive *d, int *trackno, off_t *start)
|
||||
{
|
||||
struct buffer *buf = NULL;
|
||||
struct command *c = NULL;
|
||||
|
@ -1821,7 +1864,11 @@ int mmc_read_multi_session_c1(struct burn_drive *d, int *trackno, int *start)
|
|||
continue;
|
||||
burn_track_get_entry(tracks[0], &toc_entry);
|
||||
if (toc_entry.extensions_valid & 1) { /* DVD extension valid */
|
||||
*start = toc_entry.start_lba;
|
||||
if (toc_entry.extensions_valid & 8) { /* Long adr */
|
||||
*start = toc_entry.long_start_lba;
|
||||
} else {
|
||||
*start = toc_entry.start_lba;
|
||||
}
|
||||
*trackno = (toc_entry.point_msb << 8)| toc_entry.point;
|
||||
} else {
|
||||
*start = burn_msf_to_lba(toc_entry.pmin,
|
||||
|
@ -1856,7 +1903,7 @@ inquire_drive:;
|
|||
|
||||
tdata = c->page->data + 4;
|
||||
*trackno = tdata[2];
|
||||
*start = mmc_four_char_to_int(tdata + 4);
|
||||
*start = mmc_four_char_to_uint(tdata + 4);
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
|
@ -1865,6 +1912,24 @@ ex:;
|
|||
}
|
||||
|
||||
|
||||
/* ts A70131 : This tries to get the start of the last complete session */
|
||||
int mmc_read_multi_session_c1(struct burn_drive *d, int *trackno, int *start)
|
||||
{
|
||||
int ret;
|
||||
off_t num;
|
||||
|
||||
ret = mmc_read_msc1_long(d, trackno, &num);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
if(num >= 0x80000000) {
|
||||
*start = 0x7fffffff;
|
||||
return 0;
|
||||
}
|
||||
*start = num;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* ts A61201 */
|
||||
char *mmc_obtain_profile_name(int profile_number)
|
||||
{
|
||||
|
@ -1960,7 +2025,7 @@ static int mmc_read_disc_info_al(struct burn_drive *d, int *alloc_len)
|
|||
d->media_lba_limit = 0;
|
||||
|
||||
/* ts A81210 */
|
||||
d->media_read_capacity = 0x7fffffff;
|
||||
d->media_read_capacity = 0x7fffffffffffffff;
|
||||
d->mr_capacity_trusted = -1;
|
||||
|
||||
/* ts A61202 */
|
||||
|
@ -3652,7 +3717,7 @@ int mmc_read_buffer_capacity(struct burn_drive *d)
|
|||
d->pessimistic_buffer_free = d->progress.buffer_available;
|
||||
d->pbf_altered = 0;
|
||||
if (d->progress.buffered_bytes >= d->progress.buffer_capacity){
|
||||
double fill;
|
||||
off_t fill;
|
||||
|
||||
fill = d->progress.buffer_capacity
|
||||
- d->progress.buffer_available;
|
||||
|
@ -4912,7 +4977,7 @@ int mmc_read_capacity(struct burn_drive *d)
|
|||
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
BURN_ALLOC_MEM(c, struct command, 1);
|
||||
d->media_read_capacity = 0x7fffffff;
|
||||
d->media_read_capacity = 0x7fffffffffffffff;
|
||||
d->mr_capacity_trusted = -1;
|
||||
mmc_start_if_needed(d, 1);
|
||||
if (mmc_function_spy(d, "mmc_read_capacity") <= 0)
|
||||
|
@ -4926,11 +4991,7 @@ int mmc_read_capacity(struct burn_drive *d)
|
|||
c->page->sectors = 0;
|
||||
c->dir = FROM_DRIVE;
|
||||
d->issue_command(d, c);
|
||||
d->media_read_capacity = mmc_four_char_to_int(c->page->data);
|
||||
if (d->media_read_capacity < 0) {
|
||||
d->media_read_capacity = 0x7fffffff;
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
d->media_read_capacity = mmc_four_char_to_uint(c->page->data);
|
||||
if (d->current_profile >= 0x08 && d->current_profile <= 0x0A)
|
||||
d->mr_capacity_trusted = 0;
|
||||
else
|
||||
|
@ -5450,7 +5511,7 @@ int mmc_setup_drive(struct burn_drive *d)
|
|||
d->last_track_no = 1;
|
||||
d->media_capacity_remaining = 0;
|
||||
d->media_lba_limit = 0;
|
||||
d->media_read_capacity = 0x7fffffff;
|
||||
d->media_read_capacity = 0x7fffffffffffffff;
|
||||
d->mr_capacity_trusted = 0;
|
||||
d->pessimistic_buffer_free = 0;
|
||||
d->pbf_altered = 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2014 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2024 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
|
@ -27,7 +27,7 @@ void mmc_close_disc(struct burn_write_opts *o);
|
|||
|
||||
void mmc_close(struct burn_drive *, int session, int track);
|
||||
void mmc_get_event(struct burn_drive *);
|
||||
int mmc_write(struct burn_drive *, int start, struct buffer *buf);
|
||||
int mmc_write(struct burn_drive *, off_t start, struct buffer *buf);
|
||||
void mmc_write_12(struct burn_drive *d, int start, struct buffer *buf);
|
||||
void mmc_sync_cache(struct burn_drive *);
|
||||
void mmc_load(struct burn_drive *);
|
||||
|
@ -78,6 +78,8 @@ int mmc_compose_mode_page_5(struct burn_drive *d,
|
|||
|
||||
/* ts A70201 */
|
||||
int mmc_four_char_to_int(unsigned char *data);
|
||||
/* ts C40226 */
|
||||
unsigned int mmc_four_char_to_uint(unsigned char *data);
|
||||
|
||||
/* ts A70201 :
|
||||
Common track info fetcher for mmc_get_nwa() and mmc_fake_toc()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2014 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2024 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
|
@ -492,13 +492,13 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
|||
msg, 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if (d->media_read_capacity != 0x7fffffff && byte_address >=
|
||||
((off_t) d->media_read_capacity + (off_t) 1) * (off_t) 2048) {
|
||||
if (d->media_read_capacity != 0x7fffffffffffffff &&
|
||||
byte_address >= (d->media_read_capacity + 1) * (off_t) 2048) {
|
||||
if (!(flag & 2)) {
|
||||
sprintf(msg,
|
||||
"Read start address %ds larger than number of readable blocks %d",
|
||||
(int) (byte_address / 2048 + !!(byte_address % 2048)),
|
||||
d->media_read_capacity + 1);
|
||||
"Read start address %.fs larger than number of readable blocks %.f",
|
||||
(double) (byte_address / 2048 + !!(byte_address % 2048)),
|
||||
(double) (d->media_read_capacity + 1));
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020172, (flag & 32) ?
|
||||
LIBDAX_MSGS_SEV_DEBUG : LIBDAX_MSGS_SEV_SORRY,
|
||||
|
|
|
@ -193,7 +193,7 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data)
|
|||
off_t missing, inp_block_size, track_blocks;
|
||||
|
||||
inp_block_size = burn_sector_length(track->mode);
|
||||
track_blocks = burn_track_get_sectors_2(track, 1);
|
||||
track_blocks = burn_track_get_sectors_2_v2(track, 1);
|
||||
if (track_blocks < 0)
|
||||
track_blocks = 0;
|
||||
missing = track_blocks * inp_block_size - track->sourcecount;
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "util.h"
|
||||
#include "transport.h"
|
||||
#include "mmc.h"
|
||||
#include "drive.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
|
@ -319,8 +320,8 @@ void burn_structure_print_track(struct burn_track *t)
|
|||
{
|
||||
char msg[80];
|
||||
|
||||
sprintf(msg, " track size %d sectors",
|
||||
burn_track_get_sectors(t));
|
||||
sprintf(msg, " track size %.f sectors",
|
||||
(double) burn_track_get_sectors_v2(t));
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
|
@ -506,14 +507,14 @@ int burn_track_set_postgap_size(struct burn_track *t, int size, int flag)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* ts B20119: outsourced from burn_track_get_sectors()
|
||||
/* ts B20119 / C40302: outsourced from burn_track_get_sectors()
|
||||
@param flag bit0= do not add post-gap
|
||||
*/
|
||||
int burn_track_get_sectors_2(struct burn_track *t, int flag)
|
||||
off_t burn_track_get_sectors_2_v2(struct burn_track *t, int flag)
|
||||
{
|
||||
/* ts A70125 : was int */
|
||||
off_t size = 0;
|
||||
int sectors, seclen;
|
||||
off_t size = 0, sectors;
|
||||
int seclen;
|
||||
|
||||
seclen = burn_sector_length(t->mode);
|
||||
|
||||
|
@ -529,14 +530,22 @@ int burn_track_get_sectors_2(struct burn_track *t, int flag)
|
|||
} else if(t->entry != NULL) {
|
||||
/* ts A80808 : all burn_toc_entry of track starts should now
|
||||
have (extensions_valid & 1), even those from CD.
|
||||
ts C40302 : Now there should be long_track_blocks.
|
||||
*/
|
||||
if (t->entry->extensions_valid & 1)
|
||||
if (t->entry->extensions_valid & 8) {
|
||||
size = t->entry->long_track_blocks * (off_t) 2048;
|
||||
} else if (t->entry->extensions_valid & 1) {
|
||||
size = ((off_t) t->entry->track_blocks) * (off_t) 2048;
|
||||
}
|
||||
}
|
||||
if (size > ((off_t) 0x7ffffff0) * (off_t) 2048) {
|
||||
if (size > BURN_DRIVE_MAX_BYTES) {
|
||||
char msg[80];
|
||||
|
||||
sprintf(msg, "Track size exceeds limit of %.f bytes",
|
||||
(double) (BURN_DRIVE_MAX_BYTES));
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x000201ae,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Track size exceeds 4 TiB - 32 KiB", 0, 0);
|
||||
msg, 0, 0);
|
||||
return -1;
|
||||
}
|
||||
sectors = size / seclen;
|
||||
|
@ -545,14 +554,34 @@ int burn_track_get_sectors_2(struct burn_track *t, int flag)
|
|||
return sectors;
|
||||
}
|
||||
|
||||
int burn_track_get_sectors_2(struct burn_track *t, int flag)
|
||||
{
|
||||
/* ts A70125 : was int */
|
||||
off_t sectors = 0;
|
||||
|
||||
sectors = burn_track_get_sectors_2_v2(t, flag);
|
||||
if (sectors > (off_t) 0x7ffffff0) {
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x000201ae,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Track size exceeds 4 TiB - 32 KiB", 0, 0);
|
||||
return -1;
|
||||
}
|
||||
return (int) sectors;
|
||||
}
|
||||
|
||||
int burn_track_get_sectors(struct burn_track *t)
|
||||
{
|
||||
return burn_track_get_sectors_2(t, 0);
|
||||
}
|
||||
|
||||
/* ts C40302 : API */
|
||||
off_t burn_track_get_sectors_v2(struct burn_track *t)
|
||||
{
|
||||
return burn_track_get_sectors_2_v2(t, 0);
|
||||
}
|
||||
|
||||
/* ts A70125 */
|
||||
int burn_track_set_sectors(struct burn_track *t, int sectors)
|
||||
int burn_track_set_sectors(struct burn_track *t, off_t sectors)
|
||||
{
|
||||
off_t size, seclen;
|
||||
int ret;
|
||||
|
@ -595,26 +624,29 @@ int burn_track_set_fillup(struct burn_track *t, int fill_up_media)
|
|||
*/
|
||||
int burn_track_apply_fillup(struct burn_track *t, off_t max_size, int flag)
|
||||
{
|
||||
int max_sectors, ret = 2, track_sectors;
|
||||
int ret = 2;
|
||||
off_t max_sectors, track_sectors;
|
||||
char msg[80];
|
||||
|
||||
if (t->fill_up_media <= 0)
|
||||
return 2;
|
||||
if (max_size > (off_t) 0x7ffffff0 * (off_t) 2048) {
|
||||
if (max_size > BURN_DRIVE_MAX_BYTES) {
|
||||
sprintf(msg, "Track size exceeds limit of %.f bytes",
|
||||
(double) (BURN_DRIVE_MAX_BYTES));
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x000201ae,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Track size exceeds 4 TiB - 32 KiB", 0, 0);
|
||||
msg, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
max_sectors = max_size / 2048;
|
||||
track_sectors = burn_track_get_sectors(t);
|
||||
track_sectors = burn_track_get_sectors_v2(t);
|
||||
if (track_sectors < 0)
|
||||
return 0;
|
||||
if (track_sectors < max_sectors || (flag & 1)) {
|
||||
sprintf(msg, "Setting total track size to %ds (payload %ds)\n",
|
||||
max_sectors & 0x7fffffff,
|
||||
(int) ((t->source->get_size(t->source) / 2048)
|
||||
& 0x7fffffff));
|
||||
sprintf(msg,
|
||||
"Setting total track size to %.fs (payload %.fs)\n",
|
||||
(double) max_sectors,
|
||||
(double) (t->source->get_size(t->source) / 2048));
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||
msg, 0, 0);
|
||||
|
@ -668,7 +700,7 @@ int burn_track_is_data_done(struct burn_track *t)
|
|||
|
||||
int burn_track_get_shortage(struct burn_track *t)
|
||||
{
|
||||
int size;
|
||||
off_t size;
|
||||
int seclen;
|
||||
|
||||
seclen = burn_sector_length(t->mode);
|
||||
|
@ -691,6 +723,20 @@ int burn_session_get_sectors(struct burn_session *s)
|
|||
return sectors;
|
||||
}
|
||||
|
||||
/* ts C40302: API */
|
||||
off_t burn_session_get_sectors_v2(struct burn_session *s)
|
||||
{
|
||||
int i;
|
||||
off_t sectors = 0, track_sectors;
|
||||
|
||||
for (i = 0; i < s->tracks; i++) {
|
||||
track_sectors = burn_track_get_sectors_v2(s->track[i]);
|
||||
if (track_sectors < 0)
|
||||
track_sectors = 0;
|
||||
sectors += track_sectors;
|
||||
}
|
||||
return sectors;
|
||||
}
|
||||
|
||||
int burn_disc_get_sectors(struct burn_disc *d)
|
||||
{
|
||||
|
@ -701,6 +747,17 @@ int burn_disc_get_sectors(struct burn_disc *d)
|
|||
return sectors;
|
||||
}
|
||||
|
||||
/* ts C40302: API */
|
||||
off_t burn_disc_get_sectors_v2(struct burn_disc *d)
|
||||
{
|
||||
int i;
|
||||
off_t sectors = 0;
|
||||
|
||||
for (i = 0; i < d->sessions; i++)
|
||||
sectors += burn_session_get_sectors_v2(d->session[i]);
|
||||
return sectors;
|
||||
}
|
||||
|
||||
void burn_track_get_entry(struct burn_track *t, struct burn_toc_entry *entry)
|
||||
{
|
||||
if (t->entry == NULL)
|
||||
|
@ -768,7 +825,7 @@ int burn_session_get_hidefirst(struct burn_session *session)
|
|||
}
|
||||
|
||||
|
||||
/* ts A80808 : Enhance CD toc to DVD toc */
|
||||
/* ts A80808,C40226 : Enhance CD toc to DVD toc with Long block addresses */
|
||||
int burn_disc_cd_toc_extensions(struct burn_drive *drive, int flag)
|
||||
{
|
||||
int sidx= 0, tidx= 0, ret, track_offset, alloc_len = 34;
|
||||
|
@ -836,6 +893,7 @@ int burn_disc_cd_toc_extensions(struct burn_drive *drive, int flag)
|
|||
entry->point_msb = 0;
|
||||
entry->start_lba = burn_msf_to_lba(entry->pmin,
|
||||
entry->psec, entry->pframe);
|
||||
entry->long_start_lba = entry->start_lba;
|
||||
if (tidx > 0) {
|
||||
prev_entry->track_blocks =
|
||||
entry->start_lba
|
||||
|
@ -855,13 +913,16 @@ int burn_disc_cd_toc_extensions(struct burn_drive *drive, int flag)
|
|||
ret < prev_entry->track_blocks - 2))
|
||||
prev_entry->track_blocks = ret;
|
||||
}
|
||||
prev_entry->extensions_valid |= 1;
|
||||
prev_entry->long_track_blocks =
|
||||
prev_entry->track_blocks;
|
||||
prev_entry->extensions_valid |= 1 | 8;
|
||||
}
|
||||
if (tidx == d->session[sidx]->tracks) {
|
||||
entry->session_msb = 0;
|
||||
entry->point_msb = 0;
|
||||
entry->track_blocks = 0;
|
||||
entry->extensions_valid |= 1;
|
||||
entry->long_track_blocks = entry->track_blocks;
|
||||
entry->extensions_valid |= 1 | 8;
|
||||
}
|
||||
prev_entry = entry;
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ int burn_track_is_open_ended(struct burn_track *t);
|
|||
int burn_track_is_data_done(struct burn_track *t);
|
||||
|
||||
/* ts A70125 : sets overall sectors of a track: offset+payload+padding */
|
||||
int burn_track_set_sectors(struct burn_track *t, int sectors);
|
||||
int burn_track_set_sectors(struct burn_track *t, off_t sectors);
|
||||
|
||||
/* ts A70218 : sets the payload size alone */
|
||||
int burn_track_set_size(struct burn_track *t, off_t size);
|
||||
|
@ -185,6 +185,7 @@ void burn_cdtext_free(struct burn_cdtext **cdtext);
|
|||
/* @param flag bit0= do not add post-gap
|
||||
*/
|
||||
int burn_track_get_sectors_2(struct burn_track *t, int flag);
|
||||
off_t burn_track_get_sectors_2_v2(struct burn_track *t, int flag);
|
||||
|
||||
|
||||
#endif /* BURN__STRUCTURE_H */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2020 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2024 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
|
@ -335,7 +335,7 @@ struct burn_drive
|
|||
|
||||
int stdio_fd;
|
||||
|
||||
int nwa; /* next writeable address */
|
||||
off_t nwa; /* next writeable address */
|
||||
int alba; /* absolute lba */
|
||||
int rlba; /* relative lba in section */
|
||||
int start_lba;
|
||||
|
@ -371,21 +371,21 @@ struct burn_drive
|
|||
/* ts A70215 : if > 0 : first lba on media that is too high for write*/
|
||||
int media_lba_limit;
|
||||
|
||||
/* ts A81210 : Upper limit of readable data size,
|
||||
0x7fffffff = unknown
|
||||
0x7ffffff0 = BURN_DRIVE_MAX_BYTES / 2048
|
||||
possibly truncated to prevent 32 bit
|
||||
overflow, or unknown stdio size
|
||||
/* ts A81210 / C40303 : Upper limit of readable data size,
|
||||
0x7fffffffffffffff = unknown
|
||||
BURN_DRIVE_MAX_BYTES / 2048 = possibly truncated
|
||||
or unknown stdio size
|
||||
*/
|
||||
int media_read_capacity;
|
||||
off_t media_read_capacity;
|
||||
|
||||
/* ts B60305 : Whether READ CAPACITY of CD is credible:
|
||||
-1= no READ CAPACITY yet , 0= untrusted READ CAPACITY
|
||||
1= READ CAPACITY confirmed or corrected by other commands
|
||||
*/
|
||||
int mr_capacity_trusted;
|
||||
|
||||
/* ts B10314 : Next Writeable Address for drive_role == 5 */
|
||||
int role_5_nwa;
|
||||
/* ts B10314 / C40302 : Next Writeable Address for drive_role == 5 */
|
||||
off_t role_5_nwa;
|
||||
|
||||
/* ts B60730 */
|
||||
int do_no_immed;
|
||||
|
@ -394,7 +394,7 @@ struct burn_drive
|
|||
struct burn_disc *disc; /* disc structure */
|
||||
int block_types[4];
|
||||
struct buffer *buffer;
|
||||
struct burn_progress progress;
|
||||
struct burn_progress_v2 progress;
|
||||
|
||||
/* To be used by mmc.c, sbc.c, spc.c for SCSI commands where the struct
|
||||
content surely does not have to persist while another command gets
|
||||
|
@ -467,7 +467,7 @@ struct burn_drive
|
|||
/* ts A61021 */
|
||||
void (*read_atip) (struct burn_drive *);
|
||||
|
||||
int (*write) (struct burn_drive *, int, struct buffer *);
|
||||
int (*write) (struct burn_drive *, off_t, struct buffer *);
|
||||
void (*read_toc) (struct burn_drive *);
|
||||
void (*lock) (struct burn_drive *);
|
||||
void (*unlock) (struct burn_drive *);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2021 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2024 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
|
@ -636,7 +636,7 @@ struct cue_sheet *burn_create_toc_entries(struct burn_write_opts *o,
|
|||
track_length = 300;
|
||||
if (!tar[i]->pad)
|
||||
tar[i]->pad = 1;
|
||||
burn_track_set_sectors(tar[i], track_length);
|
||||
burn_track_set_sectors(tar[i], (off_t) track_length);
|
||||
}
|
||||
|
||||
type_to_form(tar[i]->mode, &ctladr, &form);
|
||||
|
@ -1027,7 +1027,7 @@ static int burn_write_leadin_cdtext(struct burn_write_opts *o,
|
|||
}
|
||||
#endif /* Libburn_debug_cd_texT */
|
||||
|
||||
err = d->write(d, write_lba, buf);
|
||||
err = d->write(d, (off_t) write_lba, buf);
|
||||
if (err == BE_CANCELLED)
|
||||
{ ret = 0; goto ex; }
|
||||
write_lba += sectors;
|
||||
|
@ -1074,10 +1074,10 @@ ex:;
|
|||
}
|
||||
|
||||
|
||||
/* ts A61218 : outsourced from burn_write_track() */
|
||||
/* ts A61218 / C40303 : outsourced from burn_write_track() */
|
||||
int burn_disc_init_track_status(struct burn_write_opts *o,
|
||||
struct burn_session *s, struct burn_track *t,
|
||||
int tnum, int sectors)
|
||||
int tnum, off_t sectors)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
|
||||
|
@ -1179,8 +1179,8 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
|
|||
|
||||
/* <<< */
|
||||
sprintf(msg,
|
||||
"TAO pre-track %2.2d : get_nwa(%d)=%d, d=%d , demand=%.f , cap=%.f\n",
|
||||
tnum+1, nwa, ret, d->nwa,
|
||||
"TAO pre-track %2.2d : get_nwa(%d)=%d, d=%.f , demand=%.f , cap=%.f\n",
|
||||
tnum+1, nwa, ret, (double) d->nwa,
|
||||
(double) burn_track_get_sectors_2(t, 1) * 2048.0,
|
||||
(double) d->media_capacity_remaining);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
|
@ -1209,7 +1209,7 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
|
|||
{ ret = 0; goto ex; }
|
||||
open_ended = burn_track_is_open_ended(t);
|
||||
|
||||
burn_disc_init_track_status(o, s, t, tnum, sectors);
|
||||
burn_disc_init_track_status(o, s, t, tnum, (off_t) sectors);
|
||||
|
||||
/* ts A61030 : this cannot happen. tnum is always < s->tracks */
|
||||
if (tnum == s->tracks)
|
||||
|
@ -1358,7 +1358,7 @@ int burn_disc_init_write_status(struct burn_write_opts *o,
|
|||
d->progress.buffer_capacity = 0;
|
||||
d->progress.buffer_available = 0;
|
||||
d->progress.buffered_bytes = 0;
|
||||
d->progress.buffer_min_fill = 0xffffffff;
|
||||
d->progress.buffer_min_fill = 0x7fffffffffffffff;
|
||||
|
||||
/* ts A70711 */
|
||||
d->pessimistic_buffer_free = 0;
|
||||
|
@ -1570,8 +1570,8 @@ int burn_disc_open_track_dvd_minus_r(struct burn_write_opts *o,
|
|||
d->send_write_parameters(d, NULL, -1, o);
|
||||
ret = d->get_nwa(d, -1, &lba, &nwa);
|
||||
sprintf(msg,
|
||||
"DVD pre-track %2.2d : get_nwa(%d), ret= %d , d->nwa= %d",
|
||||
tnum+1, nwa, ret, d->nwa);
|
||||
"DVD pre-track %2.2d : get_nwa(%d), ret= %d , d->nwa= %.f",
|
||||
tnum+1, nwa, ret, (double) d->nwa);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO, msg,0,0);
|
||||
if (nwa > d->nwa)
|
||||
|
@ -1632,8 +1632,8 @@ int burn_disc_open_track_dvd_plus_r(struct burn_write_opts *o,
|
|||
BURN_ALLOC_MEM(msg, char, 160);
|
||||
ret = d->get_nwa(d, -1, &lba, &nwa);
|
||||
sprintf(msg,
|
||||
"DVD+R pre-track %2.2d : get_nwa(%d), ret= %d , d->nwa= %d",
|
||||
tnum+1, nwa, ret, d->nwa);
|
||||
"DVD+R pre-track %2.2d : get_nwa(%d), ret= %d , d->nwa= %.f",
|
||||
tnum+1, nwa, ret, (double) d->nwa);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO, msg,0,0);
|
||||
if (nwa > d->nwa)
|
||||
|
@ -1897,7 +1897,7 @@ int burn_dvd_write_track(struct burn_write_opts *o,
|
|||
struct buffer *out = d->buffer;
|
||||
int sectors;
|
||||
int i, open_ended = 0, ret= 0, is_flushed = 0, track_open = 0;
|
||||
int first_buf_cap = 0, further_cap = 0, buf_cap_step = 1024;
|
||||
off_t first_buf_cap = 0, further_cap = 0, buf_cap_step = 1024;
|
||||
|
||||
/* ts A70213 : eventually expand size of track to max */
|
||||
burn_track_apply_fillup(t, d->media_capacity_remaining, 0);
|
||||
|
@ -1936,7 +1936,7 @@ int burn_dvd_write_track(struct burn_write_opts *o,
|
|||
|
||||
/* (offset padding is done within sector_data()) */
|
||||
|
||||
burn_disc_init_track_status(o, s, t, tnum, sectors);
|
||||
burn_disc_init_track_status(o, s, t, tnum, (off_t) sectors);
|
||||
for (i = 0; open_ended || i < sectors; i++) {
|
||||
|
||||
/* From time to time inquire drive buffer */
|
||||
|
@ -2233,7 +2233,8 @@ int burn_disc_setup_dvd_minus_rw(struct burn_write_opts *o,
|
|||
if (o->start_byte >= 0) {
|
||||
d->nwa = o->start_byte / 32768; /* align to 32 kB */
|
||||
|
||||
sprintf(msg, "Write start address is %d * 32768", d->nwa);
|
||||
sprintf(msg, "Write start address is %.f * 32768",
|
||||
(double) d->nwa);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020127,
|
||||
LIBDAX_MSGS_SEV_NOTE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
|
@ -2335,8 +2336,8 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
|
|||
d->nwa = 0;
|
||||
if (o->start_byte >= 0) {
|
||||
d->nwa = o->start_byte / 2048;
|
||||
sprintf(msg, "Write start address is %d * 2048",
|
||||
d->nwa);
|
||||
sprintf(msg, "Write start address is %.f * 2048",
|
||||
(double) d->nwa);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020127,
|
||||
LIBDAX_MSGS_SEV_NOTE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
|
@ -2658,7 +2659,7 @@ ex:;
|
|||
|
||||
|
||||
/* ts A70910 : to be used as burn_drive.write(), emulating mmc_write() */
|
||||
int burn_stdio_mmc_write(struct burn_drive *d, int start, struct buffer *buf)
|
||||
int burn_stdio_mmc_write(struct burn_drive *d, off_t start, struct buffer *buf)
|
||||
{
|
||||
int ret;
|
||||
off_t start_byte;
|
||||
|
@ -2701,7 +2702,7 @@ int burn_stdio_mmc_write(struct burn_drive *d, int start, struct buffer *buf)
|
|||
|
||||
/* ts A70910 : to be used as burn_drive.write(),
|
||||
emulating mmc_write() with simulated writing. */
|
||||
int burn_stdio_mmc_dummy_write(struct burn_drive *d, int start,
|
||||
int burn_stdio_mmc_dummy_write(struct burn_drive *d, off_t start,
|
||||
struct buffer *buf)
|
||||
{
|
||||
if (d->cancel)
|
||||
|
@ -2832,17 +2833,18 @@ int burn_nominal_slowdown(int kb_per_second, int max_corr,
|
|||
int burn_stdio_write_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
int tnum, int flag)
|
||||
{
|
||||
int open_ended, bufsize = 16 * 2048, ret, sectors;
|
||||
int open_ended, bufsize = 16 * 2048, ret;
|
||||
struct burn_track *t = s->track[tnum];
|
||||
struct burn_drive *d = o->drive;
|
||||
char *buf = NULL;
|
||||
int i, prev_sync_sector = 0, us_corr = 0, max_corr = 250000;
|
||||
int us_corr = 0, max_corr = 250000;
|
||||
off_t prev_sync_sector = 0, sectors, i;
|
||||
struct buffer *out = d->buffer;
|
||||
struct timeval prev_time;
|
||||
|
||||
BURN_ALLOC_MEM(buf, char, bufsize);
|
||||
|
||||
sectors = burn_track_get_sectors_2(t, 1);
|
||||
sectors = burn_track_get_sectors_2_v2(t, 1);
|
||||
if (sectors < 0)
|
||||
{ret = 0; goto ex;}
|
||||
burn_disc_init_track_status(o, s, t, tnum, sectors);
|
||||
|
|
Loading…
Reference in New Issue