Compare commits

..

4 Commits

37 changed files with 886 additions and 4102 deletions

View File

@ -1,8 +1,4 @@
# ts A90315 : LIBBURNIA_PKGCONFDIR is defined OS specific in acinclude.m4
# was: pkgconfigdir=$(libdir)/pkgconfig
pkgconfigdir=$(LIBBURNIA_PKGCONFDIR)
pkgconfigdir=$(libdir)/pkgconfig
libincludedir=$(includedir)/libburn
lib_LTLIBRARIES = libburn/libburn.la
@ -30,6 +26,8 @@ libburn_libburn_la_SOURCES = \
libburn/file.h \
libburn/init.c \
libburn/init.h \
libburn/lec.c \
libburn/lec.h \
libburn/libburn.h \
libburn/libdax_audioxtr.h \
libburn/libdax_audioxtr.c \
@ -65,9 +63,6 @@ libburn_libburn_la_SOURCES = \
libburn/write.h \
version.h
## libburn/lec.c \
## libburn/lec.h \
## libburn/sg-@ARCH@.c \
libinclude_HEADERS = \
@ -108,9 +103,9 @@ test_structest_CPPFLAGS = -Ilibburn
test_structest_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
test_structest_SOURCES = test/structest.c
## cdrskin construction site - ts A60816 - A91012
## cdrskin construction site - ts A60816 - A90313
cdrskin_cdrskin_CPPFLAGS = -Ilibburn
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_7_2
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_6_4
# cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
# ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking

67
README
View File

@ -11,7 +11,7 @@ Still containing parts of Libburn. By Derek Foreman <derek@signalmarketing.com>
and Ben Jansens <xor@orodu.net>
Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
http://files.libburnia-project.org/releases/libburn-0.7.2.pl00.tar.gz
http://files.libburnia-project.org/releases/libburn-0.6.4.pl00.tar.gz
------------------------------------------------------------------------------
@ -19,10 +19,10 @@ Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
From tarball
Obtain libburn-0.7.2.pl00.tar.gz, take it to a directory of your choice and do:
Obtain libburn-0.6.4.pl00.tar.gz, take it to a directory of your choice and do:
tar xzf libburn-0.7.2.pl00.tar.gz
cd libburn-0.7.2
tar xzf libburn-0.6.4.pl00.tar.gz
cd libburn-0.6.4
./configure --prefix=/usr
make
@ -47,8 +47,8 @@ Our build system is based on autotools. For preparing the build of a SVN
snapshot you will need autotools of at least version 1.7.
Do in a directory of your choice:
svn co http://svn.libburnia-project.org/libburn/trunk libburn-svn
cd libburn-svn
svn co http://svn.libburnia-project.org/libburn/trunk libburn-0.6.3
cd libburn-0.6.3
./bootstrap
./configure --prefix=/usr
make
@ -388,61 +388,6 @@ Project history as far as known to me:
operations on "stdio:" pseudo drives. Nevertheless this allowed to lift the
ban to build libburn on operating systems other than Linux and FreeBSD.
- 16 Mar 2009 libisoburn-0.3.6: xorriso uses RRIP version 1.10 as default
in order to be mountable where mkisofs images are mountable.
- 17 Apr 2009 libisofs-0.6.18 introduces content filtering of data files.
Built-in filters allow compression to formats gzip and zisofs. External
filter processes allow arbitrary data conversions like encryption.
- 19 Apr 2009 libisoburn-0.3.8 makes use of the new libisofs capability to
perform content filtering of data files.
- 08 May 2009 libburn-0.6.6 fixes a bug with aborting on broken output pipe
and a bug with device scan on FreeBSD.
- 31 May 2009 libisofs-0.6.20 can record hard link relations in ISO images
and offers support with restoring them to disk. Current Linux kernels will
mount images with such hard links but will attribute a unique inode number
to each file.
- 28 Jun 2009 libisoburn-0.4.0: xorriso can record and restore hard link
relations of files. Performance of data reading has been improved. Option
-find now supports logical operators with its tests.
- 14 Jul 2009 libburn-0.6.8 fixes bugs and shortcommings with old MMC-1 drives
and with large SCSI bus numbers as handed out by Linux for USB drives.
- 20 Jul 2009 libisoburn-0.4.0.pl01 fixes a regression in xorriso which caused
data loss in older sessions if xorriso was used underneath growisofs.
Affected are releases since libisoburn-0.3.2 in january 2009.
- 25 Aug 2009 libisofs-0.6.22 can record MD5 checksums for the whole session
and for each single data file. Checksum tags allow to verify superblock and
directory tree before importing them.
- 27 Aug 2009 libburn-0.7.0 allows to calm down a drive and to inquire its
supported profiles. It works around some pitfalls with U3 enhanced memory
sticks which emulate a CD-ROM.
- 27 Aug 2009 libisoburn-0.4.0.pl00 can record MD5 checksums by which one may
verify the session or single data files in the image. When comparing image
files with files in the local filesystem, the MD5 sums avoid the need for
reading file content from the image.
- 22 Sep 2009 libisoburn-0.4.0.pl01 fixes a bug in xorriso option -cut_out.
- 08 Oct 2009 libisofs-0.6.24 fixes a bug which could cause the loss of blanks
in file names when a new session got added to an ISO image. With names
shorter than 251 characters this happened only to trailing blanks.
- 08 Oct 2009 libisoburn-0.4.0.pl02 fixes bugs with xorriso option -for_backup,
with xorrisofs -help, and with xorrecord -help.
- 12 Oct 2009 libburn-0.7.2 fixes a bug with CD TAO multi-track dummy sessions.
It can retrieve media product info and can process track input which was
prepared for CD-ROM XA Mode 2 Form 1. cdrskin now performs option -minfo.
------------------------------------------------------------------------------

View File

@ -1,11 +1,9 @@
AC_DEFUN([TARGET_SHIZZLE],
[
ARCH=""
LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig
AC_MSG_CHECKING([target operating system])
case $target in
*-*-linux*)
ARCH=linux
@ -14,7 +12,6 @@ AC_DEFUN([TARGET_SHIZZLE],
*-*-freebsd*)
ARCH=freebsd
LIBBURN_ARCH_LIBS=-lcam
LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/pkgconfig
;;
*)
ARCH=
@ -25,55 +22,3 @@ AC_DEFUN([TARGET_SHIZZLE],
AC_MSG_RESULT([$ARCH])
])
dnl LIBBURNIA_SET_PKGCONFIG determines the install directory for the *.pc file.
dnl Important: Must be performed _after_ TARGET_SHIZZLE
dnl
AC_DEFUN([LIBBURNIA_SET_PKGCONFIG],
[
### for testing --enable-libdir-pkgconfig on Linux
### LIBBURNIA_PKGCONFDIR="$libdir"data/pkgconfig
if test "x$LIBBURNIA_PKGCONFDIR" = "x$libdir"/pkgconfig
then
dummy=dummy
else
AC_ARG_ENABLE(libdir-pkgconfig,
[ --enable-libdir-pkgconfig Install to $libdir/pkgconfig on any OS, default=no],
, enable_libdir_pkgconfig="no")
AC_MSG_CHECKING([for --enable-libdir-pkgconfig])
if test "x$enable_libdir_pkgconfig" = xyes
then
LIBBURNIA_PKGCONFDIR="$libdir"/pkgconfig
fi
AC_MSG_RESULT([$enable_libdir_pkgconfig])
fi
libburnia_pkgconfig_override="no"
AC_ARG_ENABLE(pkgconfig-path,
[ --enable-pkgconfig-path=DIR Absolute path of directory for libisofs-*.pc],
libburnia_pkgconfig_override="yes" , enable_pkgconfig_path="none")
AC_MSG_CHECKING([for overridden pkgconfig directory path])
if test "x$enable_pkgconfig_path" = xno
then
libburnia_pkgconfig_override="no"
fi
if test "x$enable_pkgconfig_path" = x -o "x$enable_pkgconfig_path" = xyes
then
libburnia_pkgconfig_override="invalid argument"
fi
if test "x$libburnia_pkgconfig_override" = xyes
then
LIBBURNIA_PKGCONFDIR="$enable_pkgconfig_path"
AC_MSG_RESULT([$LIBBURNIA_PKGCONFDIR])
else
AC_MSG_RESULT([$libburnia_pkgconfig_override])
fi
AC_SUBST(LIBBURNIA_PKGCONFDIR)
dnl For debugging only
### AC_MSG_RESULT([LIBBURNIA_PKGCONFDIR = $LIBBURNIA_PKGCONFDIR])
])

View File

@ -4,8 +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-0.7.2.pl00.tar.gz
http://scdbackup.sourceforge.net/cdrskin-0.6.4.pl00.tar.gz
Copyright (C) 2006-2009 Thomas Schmitt, provided under GPL version 2.
------------------------------------------------------------------------------
@ -15,7 +14,7 @@ most of the libburn features from the command line.
Currently it is supported on Linux with kernels >= 2.4 and on FreeBSD versions
with ATAPI/CAM support enabled in the kernel, see atapicam(4).
On other X/Open compliant systems there will only be emulated drives, but no
On other X/Open compliant systems there will only be pseudo drives, but no
direct MMC operation on real CD/DVD/BD drives.
By using this software you agree to the disclaimer at the end of this text
@ -24,10 +23,10 @@ By using this software you agree to the disclaimer at the end of this text
Compilation, First Glimpse, Installation
Obtain cdrskin-0.7.2.pl00.tar.gz, take it to a directory of your choice and do:
Obtain cdrskin-0.6.4.pl00.tar.gz, take it to a directory of your choice and do:
tar xzf cdrskin-0.7.2.pl00.tar.gz
cd cdrskin-0.7.2
tar xzf cdrskin-0.6.4.pl00.tar.gz
cd cdrskin-0.6.4
Within that directory execute:

View File

@ -38,7 +38,7 @@ original="./libburn_svn_release.tgz"
# My changes are in $changes , mainly in $changes/cdrskin
changes="./libburn-release"
skin_release="0.7.2"
skin_release="0.6.4"
patch_level=".pl00"
skin_rev="$skin_release""$patch_level"
@ -117,7 +117,6 @@ cp -a "$cdrskin_dir" "$cdrskin_target"
# Remove copied vim.swp and binaries
rm "$cdrskin_target"/.*.swp
rm "$cdrskin_target"/.*.swo
rm "$cdrskin_target"/*.o
rm "$cdrskin_target"/cdrfifo
rm "$cdrskin_target"/cdrskin

View File

@ -38,7 +38,7 @@ original="./libburn_svn.tgz"
# My changes are in $changes , mainly in $changes/cdrskin
changes="./libburn-develop"
skin_release="0.7.3"
skin_release="0.6.5"
patch_level=""
skin_rev="$skin_release""$patch_level"
@ -116,7 +116,6 @@ cp -a "$cdrskin_dir" "$cdrskin_target"
# Remove copied vim.swp and binaries
rm "$cdrskin_target"/.*.swp
rm "$cdrskin_target"/.*.swo
rm "$cdrskin_target"/*.o
rm "$cdrskin_target"/cdrfifo
rm "$cdrskin_target"/cdrskin

View File

@ -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 "Sep 10, 2009"
.TH CDRSKIN 1 "Jan 07, 2009"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -67,7 +67,7 @@ Write mode selection
.br
Recordable CD Media
.br
Sequentially Recordable DVD or BD Media
Sequentially Recordable DVD Media
.br
Overwriteable DVD or BD Media
.br
@ -254,7 +254,7 @@ that it has to be formatted again. If in doubt, just give it a try.
.SS
.B Drive preparation and addressing:
.br
The drives, CD, DVD, or BD burners, are accessed via addresses which
The drives, either CD burners or DVD burners, are accessed via addresses which
are specific to libburn and the operating system. Those addresses get listed
by a run of \fBcdrskin --devices\fP.
.br
@ -497,15 +497,7 @@ or DVD-R[W] in Disc-at-once mode.
.TP
.BI \-data
Subsequent tracks are data tracks. This option is default and only needed
to mark the end of the range of an eventual option -audio or -xa1.
.br
Options -mode2, -xa, and -xa2 get mapped to -data, not using the desired CD
sector formats and thus not taking advantage of eventual higher payload.
.BI \-xa1
Subsequent tracks are data tracks with input suitable for CD-ROM XA mode 2
form 1. This differs from -data input by 8 additional header bytes per block.
cdrskin will not write CD-ROM XA but rather strip the header bytes and write as
-data tracks.
to mark the end of the range of an eventual option -audio.
.TP
.BI dev= target
Set the address of the drive to use. Valid are at least the
@ -624,10 +616,6 @@ modesty_on_drive=1:min_percent=<percentage>:max_percent=95
.br
Percentage is permissible between 25 and 95.
.TP
.BI -minfo
Print information about the loaded media. This includes media type, writability
state, and a quite readable table of content.
.TP
.BI msifile= path
Run option -msinfo and copy the result line into the file given by path.
Unlike -msinfo this option does not redirect all normal output away from
@ -650,8 +638,8 @@ To have a chance for working on overwriteable media, this option has to be
accompanied by option --grow_overwriteable_iso.
.TP
.BI \-multi
This option keeps CD, unformatted DVD-R[W], DVD+R, or BD-R appendable
after the current session has been written.
This option keeps the CD or unformatted DVD-R[W] appendable after the current
session has been written.
Without it the disc gets closed and may not be written any more - unless it
is a -RW and gets blanked which causes loss of its content.
.br
@ -691,9 +679,16 @@ Add the given amount of trailing zeros to the next data track. This option
gets reset to padsize=0 after that next track is written. It may be set
again before the next track argument. About size specifiers, see option fs=.
.TP
.BI \-raw96r
Write CD in RAW/RAW96R mode. This mode allows to put more payload bytes
into a CD sector but obviously at the cost of error correction. It can only
be used for tracks of fixely predicted size. Some drives allow this mode but
then behave strange or even go bad for the next few attempts to burn a CD.
One should use it only if inavoidable.
.TP
.BI \-sao
Write CD in Session At Once mode or sequential DVD-R[W] in Disc-at-once
(DAO) mode.
Write CD in Session At Once mode, a sequential DVD-R[W] in Disc-at-once
(DAO) mode, or a DVD+R[/DL].
.br
With CD this mode is able to put several audio tracks on media without
producing audible gaps between them.
@ -701,7 +696,7 @@ producing audible gaps between them.
With DVD-R[W] this mode can only write a single track.
No -multi is allowed with DVD-R[W] -sao.
.br
-sao is permissible with overwriteable DVD, or DVD+R[/DL], or BD but actually
-sao is permissible with overwriteable DVD, BD or DVD+R[/DL] but actually
only imposes restrictions without providing known advantages.
.br
-sao can only be used for tracks of fixely predicted size. This implies that
@ -986,10 +981,6 @@ List all ignored cdrecord options. The "-" options cannot be used as addresses
of track sources. No track source address may begin with a text equal to an
option which ends by "=". The list is ended by an empty line.
.TP
.BI \--long_toc
Like option -toc but marking each session start by a line "first: X last: Y"
and each session end by "track:lout ...".
.TP
.BI \--no_rc
Only if used as first command line argument this option prevents reading and
interpretation of eventual startup files. See section FILES below.
@ -1204,10 +1195,6 @@ if write errors occur. It might as well be disliked or ignored by the drive.
.br
If a number is given, then error management stays enabled for all byte
addresses below that number. Any number below 16s is the same as "off".
.TP
.BI --xa1-ignore
Silently interpret option -xa1 as -data. This may be necessary if a frontent
does not prepare -xa1 block headers but insists in using option -xa1.
.SH EXAMPLES
.SS
.B Get an overview of drives and their addresses:
@ -1252,15 +1239,15 @@ cdrskin -v dev=0,1,0 fs=32m speed=8 \\
.br
blank=as_needed padsize=300k -
.SS
.B Write multi-session to the same CD, DVD-R[W], DVD+R[/DL], or BD-R:
.B Write multi-session to the same CD, DVD-R[W] or DVD+R[/DL]:
.br
cdrskin dev=/dev/sr0 -v padsize=300k -multi 1.iso
cdrskin dev=/dev/hdc -v padsize=300k -multi 1.iso
.br
cdrskin dev=/dev/sr0 -v padsize=300k -multi 2.iso
cdrskin dev=/dev/hdc -v padsize=300k -multi 2.iso
.br
cdrskin dev=/dev/sr0 -v padsize=300k -multi 3.iso
cdrskin dev=/dev/hdc -v padsize=300k -multi 3.iso
.br
cdrskin dev=/dev/sr0 -v padsize=300k 4.iso
cdrskin dev=/dev/hdc -v padsize=300k 4.iso
.SS
.B Get multi-session info for option -C of program mkisofs:
.br

View File

@ -88,7 +88,7 @@ or
/** The official program version */
#ifndef Cdrskin_prog_versioN
#define Cdrskin_prog_versioN "0.7.2"
#define Cdrskin_prog_versioN "0.6.4"
#endif
/** The official libburn interface revision to use.
@ -98,10 +98,10 @@ or
#define Cdrskin_libburn_majoR 0
#endif
#ifndef Cdrskin_libburn_minoR
#define Cdrskin_libburn_minoR 7
#define Cdrskin_libburn_minoR 6
#endif
#ifndef Cdrskin_libburn_micrO
#define Cdrskin_libburn_micrO 2
#define Cdrskin_libburn_micrO 4
#endif
@ -135,42 +135,44 @@ or
#endif /* Cdrskin_libburn_cvs_A60220_tS */
#ifdef Cdrskin_libburn_0_7_2
#define Cdrskin_libburn_versioN "0.7.2"
#ifdef Cdrskin_libburn_0_6_4
#define Cdrskin_libburn_versioN "0.6.4"
#define Cdrskin_libburn_from_pykix_svN 1
#endif /* Cdrskin_libburn_0_7_2 */
#endif /* Cdrskin_libburn_0_6_4 */
#ifdef Cdrskin_libburn_0_7_3
#define Cdrskin_libburn_versioN "0.7.3"
#ifdef Cdrskin_libburn_0_6_5
#define Cdrskin_libburn_versioN "0.6.5"
#define Cdrskin_libburn_from_pykix_svN 1
/* Place novelty switch macros here.
Move them down to Cdrskin_libburn_from_pykix_svN on version leap
*/
#endif /* Cdrskin_libburn_0_7_3 */
/* there are no libburn novelties in 0.6.5 yet */
#endif /* Cdrskin_libburn_0_6_5 */
#ifndef Cdrskin_libburn_versioN
#define Cdrskin_libburn_0_7_2
#define Cdrskin_libburn_versioN "0.7.2"
#define Cdrskin_libburn_0_6_4
#define Cdrskin_libburn_versioN "0.6.4"
#define Cdrskin_libburn_from_pykix_svN 1
#endif
#ifdef Cdrskin_libburn_0_7_2
#ifdef Cdrskin_libburn_0_6_4
#undef Cdrskin_libburn_majoR
#undef Cdrskin_libburn_minoR
#undef Cdrskin_libburn_micrO
#define Cdrskin_libburn_majoR 0
#define Cdrskin_libburn_minoR 7
#define Cdrskin_libburn_micrO 2
#define Cdrskin_libburn_minoR 6
#define Cdrskin_libburn_micrO 4
#endif
#ifdef Cdrskin_libburn_0_7_3
#ifdef Cdrskin_libburn_0_6_5
#undef Cdrskin_libburn_majoR
#undef Cdrskin_libburn_minoR
#undef Cdrskin_libburn_micrO
#define Cdrskin_libburn_majoR 0
#define Cdrskin_libburn_minoR 7
#define Cdrskin_libburn_micrO 3
#define Cdrskin_libburn_minoR 6
#define Cdrskin_libburn_micrO 5
#endif
@ -263,7 +265,6 @@ or
/* put macros under test caveat here */
#endif /* Cdrskin_new_api_tesT */
@ -310,15 +311,6 @@ or
#define Cdrskin_all_tracks_with_sector_paD 1
/** ts A90901
The raw write modes of libburn depend in part on code borrowed from cdrdao.
Since this code is not understood by the current developers and since CDs
written with cdrskin -raw96r seem unreadable anyway, -raw96r is given up
for now.
*/
#define Cdrskin_disable_raw96R 1
/** A macro which is able to eat up a function call like printf() */
#ifdef Cdrskin_extra_leaN
#define ClN(x)
@ -908,9 +900,6 @@ struct CdrtracK {
double sector_size;
int track_type_by_default;
int swap_audio_bytes;
int cdxa_conversion; /* bit0-30: for burn_track_set_cdxa_conv()
bit31 : ignore bits 0 to 30
*/
/** Eventually detected data image size */
double data_image_size;
@ -964,7 +953,7 @@ int Cdrtrack_new(struct CdrtracK **track, struct CdrskiN *boss,
int *use_data_image_size,
double *padding, int *set_by_padsize,
int *track_type, int *track_type_by_default,
int *swap_audio_bytes, int *cdxa_conversion, int flag);
int *swap_audio_bytes, int flag);
int Cdrskin_get_fifo_par(struct CdrskiN *skin, int *fifo_enabled,
int *fifo_size, int *fifo_start_at, int flag);
@ -986,7 +975,6 @@ int Cdrtrack_new(struct CdrtracK **track, struct CdrskiN *boss,
o->sector_size= 2048.0;
o->track_type_by_default= 1;
o->swap_audio_bytes= 0;
o->cdxa_conversion= 0;
o->data_image_size= -1.0;
o->iso_fs_descr= NULL;
o->use_data_image_size= 0;
@ -1003,7 +991,7 @@ int Cdrtrack_new(struct CdrtracK **track, struct CdrskiN *boss,
&(o->tao_to_sao_tsize),&(o->use_data_image_size),
&(o->padding),&(o->set_by_padsize),&(skin_track_type),
&(o->track_type_by_default),&(o->swap_audio_bytes),
&(o->cdxa_conversion), 0);
0);
if(ret<=0)
goto failed;
strcpy(o->original_source_path,o->source_path);
@ -1613,9 +1601,6 @@ int Cdrtrack_add_to_session(struct CdrtracK *track, int trackno,
burn_track_set_default_size(tr, (off_t) track->tao_to_sao_tsize);
burn_track_set_byte_swap(tr,
(track->track_type==BURN_AUDIO && track->swap_audio_bytes));
if(!(track->cdxa_conversion & (1 << 31)))
burn_track_set_cdxa_conv(tr, track->cdxa_conversion & 0x7fffffff);
fixed_size= track->fixed_size;
if((flag&2) && track->padding>0) {
if(flag&1)
@ -2697,7 +2682,6 @@ set_dev:;
" --ignore_signals try to ignore any signals rather than to abort\n");
printf(" --list_formats list format descriptors for loaded media.\n");
printf(" --list_ignored_options list all ignored cdrecord options.\n");
printf(" --long_toc print overview of media content\n");
#ifdef Cdrskin_libburn_has_set_waitinG
printf(" modesty_on_drive=<options> no writing into full drive buffer\n");
#endif
@ -2744,8 +2728,6 @@ set_dev:;
printf(
" write_start_address=<num> write to given byte address (DVD+RW)\n");
printf(
" --xa1-ignore with -xa1 do not strip 8 byte headers\n");
printf(
"Preconfigured arguments are read from the following startup files\n");
printf(
@ -2806,8 +2788,6 @@ see_cdrskin_eng_html:;
fprintf(stderr,
"\t-eject\t\teject the disk after doing the work\n");
fprintf(stderr,"\t-dummy\t\tdo everything with laser turned off\n");
fprintf(stderr,"\t-minfo\t\tretrieve and print media information/status\n");
fprintf(stderr,"\t-media-info\tretrieve and print media information/status\n");
#ifdef Cdrskin_libburn_has_multI
fprintf(stderr,
"\t-msinfo\t\tretrieve multi-session info for mkisofs >= 1.10\n");
@ -2835,18 +2815,12 @@ see_cdrskin_eng_html:;
#endif
fprintf(stderr,"\t-dao\t\tWrite disk in SAO mode.\n");
fprintf(stderr,"\t-sao\t\tWrite disk in SAO mode.\n");
#ifndef Cdrskin_disable_raw96R
fprintf(stderr,"\t-raw96r\t\tWrite disk in RAW/RAW96R mode\n");
#endif
fprintf(stderr,"\ttsize=#\t\tannounces exact size of source data\n");
fprintf(stderr,"\tpadsize=#\tAmount of padding\n");
fprintf(stderr,"\t-audio\t\tSubsequent tracks are CD-DA audio tracks\n");
fprintf(stderr,
"\t-data\t\tSubsequent tracks are CD-ROM data mode 1 (default)\n");
fprintf(stderr,
"\t-xa1\t\tSubsequent tracks are CD-ROM XA mode 2 form 1 - 2056 bytes\n");
fprintf(stderr,
"\t-isosize\tUse iso9660 file system size for next data track\n");
fprintf(stderr,"\t-pad\t\tpadsize=30k\n");
@ -2900,10 +2874,8 @@ see_cdrskin_eng_html:;
fprintf(stderr,
"cdrskin: NOTE : option --no_rc would only work as first argument.\n");
#ifndef Cdrskin_disable_raw96R
} else if(strcmp(argv[i],"-raw96r")==0) {
strcpy(o->write_mode_name,"RAW/RAW96R");
#endif
} else if(strcmp(argv[i],"-sao")==0 || strcmp(argv[i],"-dao")==0) {
strcpy(o->write_mode_name,"SAO");
@ -2959,10 +2931,6 @@ set_severities:;
} else if(strcmp(argv[i],"-waiti")==0) {
o->do_waiti= 1;
} else if(strcmp(argv[i],"-xamix")==0) {
fprintf(stderr,
"cdrskin: FATAL : Option -xamix not implemented and data not yet convertible to other modes.\n");
return(0);
}
}
@ -3236,14 +3204,11 @@ struct CdrskiN {
int do_burn;
int tell_media_space; /* actually do not burn but tell the available space */
int burnfree;
/** The write mode (like SAO or TAO). See libburn.
/** The write mode (like SAO or RAW96/R). See libburn.
Controled by preskin->write_mode_name */
enum burn_write_types write_type;
int block_type;
int multi;
int cdxa_conversion; /* bit0-30: for burn_track_set_cdxa_conv()
bit31 : ignore bits 0 to 30
*/
int modesty_on_drive;
int min_buffer_percent;
int max_buffer_percent;
@ -3525,7 +3490,7 @@ int Cdrskin_get_source(struct CdrskiN *skin, char *source_path,
int *use_data_image_size,
double *padding, int *set_by_padsize,
int *track_type, int *track_type_by_default,
int *swap_audio_bytes, int *cdxa_conversion, int flag)
int *swap_audio_bytes, int flag)
{
strcpy(source_path,skin->source_path);
*fixed_size= skin->fixed_size;
@ -3536,7 +3501,6 @@ int Cdrskin_get_source(struct CdrskiN *skin, char *source_path,
*track_type= skin->track_type;
*track_type_by_default= skin->track_type_by_default;
*swap_audio_bytes= skin->swap_audio_bytes;
*cdxa_conversion= skin->cdxa_conversion;
return(1);
}
@ -3668,14 +3632,10 @@ int Cdrskin_determine_media_caps(struct CdrskiN *skin, int flag)
skin->media_is_overwriteable= skin->media_does_multi= 0;
ret= burn_disc_get_multi_caps(skin->grabbed_drive,BURN_WRITE_NONE,&caps,0);
if(ret<=0)
goto ex;
return(0);
skin->media_is_overwriteable= !!caps->start_adr;
skin->media_does_multi= !!caps->multi_session;
ret= 1;
ex:;
if(caps != NULL)
burn_disc_free_multi_caps(&caps);
return(ret);
return(1);
#else /* Cdrskin_libburn_has_get_multi_capS */
return(-1);
#endif
@ -4448,15 +4408,13 @@ int Cdrskin_report_disc_status(struct CdrskiN *skin, enum burn_disc_status s,
int Cdrskin_scanbus(struct CdrskiN *skin, int flag)
{
int ret,i,busno,first_on_bus,pseudo_transport_group= 0,skipped_devices= 0;
int busmax= 16, busidx;
int busmax= 16;
char shellsafe[5*Cdrskin_strleN+2],perms[40],btldev[Cdrskin_adrleN];
char adr[Cdrskin_adrleN],*raw_dev,*drives_shown= NULL;
int *drives_busses= NULL;
struct stat stbuf;
drives_shown= malloc(skin->n_drives+1);
drives_busses= malloc((skin->n_drives+1) * sizeof(int));
if(drives_shown == NULL || drives_busses == NULL)
if(drives_shown==NULL)
{ret= -1; goto ex;}
for(i=0;i<skin->n_drives;i++)
drives_shown[i]= 0;
@ -4491,7 +4449,7 @@ int Cdrskin_scanbus(struct CdrskiN *skin, int flag)
Text_shellsafe("failure:oversized string",shellsafe,0);
else
Text_shellsafe(adr,shellsafe,0);
printf("%d dev=%s %s : '%-8.8s' '%s'\n",
printf("%d dev=%s %s : '%s' '%s'\n",
i,shellsafe,perms,skin->drives[i].vendor,skin->drives[i].product);
}
printf("-----------------------------------------------------------------------------\n");
@ -4514,28 +4472,7 @@ int Cdrskin_scanbus(struct CdrskiN *skin, int flag)
if(skin->preskin->old_pseudo_scsi_adr)
printf("cdrskin: NOTE : The printed addresses are not cdrecord compatible !\n");
for(i=0;i<skin->n_drives;i++) {
drives_busses[i]= -1;
ret= Cdrskin_driveno_to_btldev(skin,i,btldev,1);
if(ret >= pseudo_transport_group &&
ret < pseudo_transport_group + 1000000) {
drives_busses[i]= ret - pseudo_transport_group;
if(ret > pseudo_transport_group + busmax)
busmax= 1 + ret - pseudo_transport_group;
}
}
for(busidx= 0; busidx < skin->n_drives + 1; busidx++) {
if(busidx < skin->n_drives)
busno= drives_busses[busidx];
else
busno= busmax;
if(busno < 0)
continue;
for(i= 0; i < busidx; i++)
if(drives_busses[i] == busno)
break;
if(i < busidx)
continue;
for(busno= 0;busno<=busmax;busno++) {
first_on_bus= 1;
for(i=0;i<skin->n_drives;i++) {
ret= Cdrskin_driveno_to_btldev(skin,i,btldev,1);
@ -4573,8 +4510,6 @@ int Cdrskin_scanbus(struct CdrskiN *skin, int flag)
ex:;
if(drives_shown!=NULL)
free((char *) drives_shown);
if(drives_busses!=NULL)
free((char *) drives_busses);
return(ret);
}
@ -4634,14 +4569,10 @@ int Cdrskin_checkdrive(struct CdrskiN *skin, char *profile_name, int flag)
printf(" TAO");
if(drive_info->sao_block_types & BURN_BLOCK_SAO)
printf(" SAO");
#ifndef Cdrskin_disable_raw96R
if((drive_info->raw_block_types & BURN_BLOCK_RAW96R) &&
strstr(profile_name,"DVD")!=profile_name &&
strstr(profile_name,"BD")!=profile_name)
printf(" RAW/RAW96R");
#endif /* ! Cdrskin_disable_raw96R */
printf("\n");
#else
@ -4704,31 +4635,23 @@ int Cdrskin_toc(struct CdrskiN *skin, int flag)
struct burn_session **sessions;
struct burn_track **tracks;
struct burn_toc_entry toc_entry;
enum burn_disc_status s;
#ifdef Cdrskin_libburn_has_get_profilE
char profile_name[80];
int profile_number;
#endif
drive= skin->drives[skin->driveno].drive;
s= burn_disc_get_status(drive);
if(s == BURN_DISC_EMPTY || s == BURN_DISC_BLANK)
goto summary;
disc= burn_drive_get_disc(drive);
if(disc==NULL) {
if(skin->grow_overwriteable_iso>0) {
ret= Cdrskin_overwriteable_iso_size(skin,&lba,0);
if(ret>0) {
printf(
"first: 1 last: 1 (fabricated from ISO-9660 image on overwriteable media)\n");
"first: 1 last 1 (fabricated from ISO-9660 image on overwriteable media)\n");
printf(
"track: 1 lba: 0 ( 0) 00:02:00 adr: 1 control: 4 mode: 1\n");
burn_lba_to_msf(lba, &pmin, &psec, &pframe);
printf("track:lout lba: %9d (%9d) %2.2d:%2.2d:%2.2d",
lba,4*lba,pmin,psec,pframe);
printf(" adr: 1 control: 4 mode: -1\n");
goto summary;
return(1);
}
}
goto cannot_read;
@ -4746,7 +4669,7 @@ int Cdrskin_toc(struct CdrskiN *skin, int flag)
if(tracks==NULL)
continue;
if(!(flag&1))
printf("first: %d last: %d\n",track_count+1,track_count+num_tracks);
printf("first: %d last %d\n",track_count+1,track_count+num_tracks);
for(track_no= 0; track_no<num_tracks; track_no++) {
track_count++;
burn_track_get_entry(tracks[track_no], &toc_entry);
@ -4804,29 +4727,8 @@ int Cdrskin_toc(struct CdrskiN *skin, int flag)
printf(" adr: %d control: %d",toc_entry.adr,toc_entry.control);
printf(" mode: -1\n");
}
summary:
#ifdef Cdrskin_libburn_has_get_profilE
ret= burn_disc_get_profile(drive, &profile_number, profile_name);
if(ret <= 0)
strcpy(profile_name, "media");
#else
strcpy(profile_name, "media");
#endif
printf("Media summary: %d sessions, %d tracks, %s %s\n",
num_sessions, track_count,
s==BURN_DISC_BLANK ? "blank" :
s==BURN_DISC_APPENDABLE ? "appendable" :
s==BURN_DISC_FULL ? "closed" :
s==BURN_DISC_EMPTY ? "no " : "unknown ",
profile_name);
if(disc!=NULL)
burn_disc_free(disc);
if(s == BURN_DISC_EMPTY)
return(0);
return(1);
cannot_read:;
fprintf(stderr,"cdrecord_emulation: Cannot read TOC header\n");
@ -4835,272 +4737,19 @@ cannot_read:;
}
/** Perform -minfo under control of Cdrskin_atip().
@param flag Bitfield for control purposes:
@return <=0 error, 1 success
*/
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;
struct burn_drive *drive;
struct burn_disc *disc= NULL;
struct burn_session **sessions= NULL;
struct burn_track **tracks;
struct burn_toc_entry toc_entry;
enum burn_disc_status s, show_status;
#ifdef Cdrskin_libburn_has_get_profilE
char profile_name[80];
int pno;
#endif
char media_class[80];
int nominal_sessions= 1, ftils= 1, ltils= 1, first_track= 1, read_capacity= 0;
int app_code, cd_info_valid, lra;
off_t avail, buf_count;
char disc_type[80], bar_code[9], buf[2 * 2048];
unsigned int disc_id;
drive= skin->drives[skin->driveno].drive;
s= burn_disc_get_status(drive);
if(s == BURN_DISC_EMPTY) {
fprintf(stderr, "cdrecord-Emulation: No disk / Wrong disk!\n");
return(1);
}
ret= burn_disc_get_profile(drive, &pno, profile_name);
if(ret <= 0) {
fprintf(stderr, "cdrskin: SORRY : Cannot inquire current media profile\n");
return(1);
}
if(pno >= 0x08 && pno <= 0x0a)
strcpy(media_class, "CD");
else if(pno >= 0x10 && pno <= 0x2f)
strcpy(media_class, "DVD");
else if(pno >= 0x40 && pno <= 0x43)
strcpy(media_class, "BD");
else
sprintf(media_class, "Unknown class (profile 0x%4.4X)", pno);
printf("\n");
printf("Mounted media class: %s\n", media_class);
printf("Mounted media type: %s\n", profile_name);
ret= burn_disc_erasable(drive);
printf("Disk Is %serasable\n",
(ret || skin->media_is_overwriteable) ? "" : "not ");
show_status= s;
ret = burn_get_read_capacity(drive, &read_capacity, 0);
if(ret <= 0)
read_capacity= 0;
if(skin->media_is_overwriteable && read_capacity > 0)
ovwrt_full= 1;
if(ovwrt_full)
show_status= BURN_DISC_FULL;
printf("disk status: %s\n",
show_status == BURN_DISC_BLANK ? "empty" :
show_status == BURN_DISC_APPENDABLE ? "incomplete/appendable" :
show_status == BURN_DISC_FULL ? "complete" :
"unusable");
printf("session status: %s\n",
show_status == BURN_DISC_BLANK ? "empty" :
show_status == BURN_DISC_APPENDABLE ? "empty" :
show_status == BURN_DISC_FULL ? "complete" :
"unknown");
disc= burn_drive_get_disc(drive);
if(disc==NULL || s == BURN_DISC_BLANK) {
first_track= 1;
num_sessions= 0;
nominal_sessions= 1;
ftils= ltils= 1;
} else {
first_track= 1;
sessions= burn_disc_get_sessions(disc, &num_sessions);
nominal_sessions= num_sessions;
if(s == BURN_DISC_APPENDABLE)
nominal_sessions++;
for(session_no= 0; session_no<num_sessions; session_no++) {
ftils= total_tracks + 1;
tracks= burn_session_get_tracks(sessions[session_no],&num_tracks);
if(tracks==NULL)
continue;
total_tracks+= num_tracks;
ltils= total_tracks;
if(session_no==0 && burn_session_get_hidefirst(sessions[session_no])
&& total_tracks >= 2)
first_track= 2;
}
if(s == BURN_DISC_APPENDABLE)
ftils= ltils= total_tracks + 1;
}
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);
burn_disc_get_cd_info(drive, disc_type, &disc_id, bar_code, &app_code,
&cd_info_valid);
printf("Disk Is %sunrestricted\n", (cd_info_valid & 16) ? "" : "not ");
if((cd_info_valid & 8) && !(cd_info_valid & 16))
printf("Disc application code: %d\n", app_code);
if(strcmp(media_class, "DVD") == 0 || strcmp(media_class, "BD") == 0)
printf("Disk type: DVD, HD-DVD or BD\n");
else if(strcmp(media_class, "CD") == 0 && (cd_info_valid & 1))
printf("Disk type: %s\n", disc_type);
else
printf("Disk type: unrecognizable\n");
if(cd_info_valid & 2)
printf("Disk id: 0x%-X\n", disc_id);
printf("\n");
printf("Track Sess Type Start Addr End Addr Size\n");
printf("==============================================\n");
for(session_no= 0; session_no<num_sessions; session_no++) {
tracks= burn_session_get_tracks(sessions[session_no],&num_tracks);
if(tracks==NULL)
continue;
for(track_no= 0; track_no<num_tracks; track_no++) {
track_count++;
burn_track_get_entry(tracks[track_no], &toc_entry);
#ifdef Cdrskin_libburn_has_toc_entry_extensionS
if(toc_entry.extensions_valid&1) { /* DVD extension valid */
lba= toc_entry.start_lba;
size= toc_entry.track_blocks;
} else {
#else
{
#endif
pmin= toc_entry.min;
psec= toc_entry.sec;
pframe= toc_entry.frame;
size= burn_msf_to_lba(pmin,psec,pframe);
pmin= toc_entry.pmin;
psec= toc_entry.psec;
pframe= toc_entry.pframe;
lba= burn_msf_to_lba(pmin,psec,pframe);
}
lra= lba + size - 1;
if(pno >= 0x08 && pno <= 0x0a && ((toc_entry.control & 7) >= 4) &&
lra >= 2 && size >= 2) {
/* If last two blocks not readable then assume TAO and subtract 2
from lra and size.
*/;
ret= burn_read_data(drive, (off_t) lra * (off_t) 2048, buf, 2 * 2048,
&buf_count, 2 | 4);
if(ret <= 0) {
lra-= 2;
size-= 2;
}
}
#ifdef Cdrskin_with_last_recorded_addresS
/* Interesting, but obviously not what cdrecord prints as "End Addr" */
#ifdef Cdrskin_libburn_has_toc_entry_extensionS
if(toc_entry.extensions_valid & 2) { /* LRA extension valid */
if(pno == 0x11 || pno == 0x13 || pno == 0x14 || pno == 0x15 ||
pno == 0x41 || pno == 0x42 || pno == 0x51)
lra= toc_entry.last_recorded_address;
}
#endif /* Cdrskin_libburn_has_toc_entry_extensionS */
#endif /* Cdrskin_with_last_recorded_addresS */
printf("%5d %5d %-6s %-10d %-10d %-10d\n",
track_count, session_no + 1,
((toc_entry.control&7)<4) ? "Audio" : "Data", lba, lra, size);
last_leadout= lba + size;
}
}
if(last_leadout > 0)
if(read_capacity > last_leadout)
read_capacity= last_leadout;
if(nominal_sessions > num_sessions) {
ret= burn_disc_track_lba_nwa(drive, NULL, 0, &lba, &nwa);
if(ret > 0) {
avail= burn_disc_available_space(drive, NULL);
size= avail / 2048;
if(read_capacity == 0 && skin->media_is_overwriteable)
size= 0; /* unformatted overwriteable media */
printf("%5d %5d %-6s %-10d %-10d %-10d\n",
track_count + 1, nominal_sessions,
ovwrt_full ? "Data" : "Blank",
nwa, lba + size - 1, size);
}
}
printf("\n");
if(num_sessions > 0) {
ret= burn_disc_get_msc1(drive, &lba);
if(ret > 0)
printf("Last session start address: %-10d\n", lba);
if(last_leadout > 0)
printf("Last session leadout start address: %-10d\n", last_leadout);
if(s == BURN_DISC_FULL) {
if(read_capacity > 0 && (last_leadout != read_capacity ||
pno == 0x08 || pno == 0x10 || pno == 0x40 || pno == 0x50))
printf("Read capacity: %-10d\n", read_capacity);
}
} else if(ovwrt_full) {
printf("Last session start address: %-10d\n", nwa);
printf("Last session leadout start address: %-10d\n", size);
}
if(nominal_sessions > num_sessions && !skin->media_is_overwriteable) {
printf("Next writable address: %-10d\n", nwa);
printf("Remaining writable size: %-10d\n", size);
}
if(ovwrt_full) {
printf("\n");
printf("cdrskin: Media is overwriteable. No blanking needed. No reliable track size.\n");
printf("cdrskin: Above contrary statements follow cdrecord traditions.\n");
}
if(disc!=NULL)
burn_disc_free(disc);
if(s == BURN_DISC_EMPTY)
return(0);
return(1);
}
int Cdrskin_print_all_profiles(struct CdrskiN *skin, struct burn_drive *drive,
int flag)
{
int num_profiles, profiles[64], i, ret;
char is_current[64], profile_name[80];
burn_drive_get_all_profiles(drive, &num_profiles, profiles, is_current);
for(i= 0; i < num_profiles; i++) {
ret= burn_obtain_profile_name(profiles[i], profile_name);
if(ret <= 0)
strcpy(profile_name, "unknown");
printf("Profile: 0x%4.4X (%s)%s\n", (unsigned int) profiles[i],
profile_name, is_current[i] ? " (current)" : "");
}
return(1);
}
/** Perform -atip .
@param flag Bitfield for control purposes:
bit0= perform -toc
bit1= perform -toc with session markers
bit2= perform -minfo
@return <=0 error, 1 success
*/
int Cdrskin_atip(struct CdrskiN *skin, int flag)
{
int ret,is_not_really_erasable= 0, current_is_cd= 1;
int ret,is_not_really_erasable= 0;
double x_speed_max, x_speed_min= -1.0;
enum burn_disc_status s;
struct burn_drive *drive;
int profile_number= 0;
char profile_name[80], *manuf= NULL, *media_code1= NULL, *media_code2= NULL;
char *book_type= NULL, *product_id= NULL;
char profile_name[80];
ClN(printf("cdrskin: pseudo-atip on drive %d\n",skin->driveno));
ret= Cdrskin_grab_drive(skin,0);
@ -5112,10 +4761,8 @@ int Cdrskin_atip(struct CdrskiN *skin, int flag)
if(s==BURN_DISC_APPENDABLE && skin->no_blank_appendable) {
is_not_really_erasable= 1;
} else if(s==BURN_DISC_EMPTY) {
if(skin->verbosity>=Cdrskin_verbose_progresS) {
if(skin->verbosity>=Cdrskin_verbose_progresS)
printf("Current: none\n");
Cdrskin_print_all_profiles(skin, drive, 0);
}
ret= 0; goto ex;
}
@ -5181,8 +4828,6 @@ int Cdrskin_atip(struct CdrskiN *skin, int flag)
profile_number= 0;
strcpy(profile_name, "-unidentified-");
}
if(profile_number != 0x08 && profile_number != 0x09 && profile_number != 0x0a)
current_is_cd= 0;
#endif /* Cdrskin_libburn_has_get_profilE */
ret= Cdrskin_checkdrive(skin,profile_name,1);
@ -5227,22 +4872,19 @@ int Cdrskin_atip(struct CdrskiN *skin, int flag)
printf("Current: CD-RW\n");
else
printf("Current: CD-R\n");
Cdrskin_print_all_profiles(skin, drive, 0);
}
if(strstr(profile_name,"DVD")==profile_name) {
/* These are dummy messages for project scdbackup, so its media recognition
gets a hint that the media is suitable and not in need of blanking.
scdbackup will learn to interpret cdrskin's DVD messages but the
current stable version needs to believe it is talking to its own
growisofs_wrapper. So this is an emulation of an emulator.
The real book type is available meanwhile. But that one is not intended.
*/
printf("book type: %s (emulated booktype)\n", profile_name);
printf("book type: %s (emulated booktype)\n", profile_name);
if(profile_number==0x13) /* DVD-RW */
printf("cdrskin: message for sdvdbackup: \"(growisofs mode Restricted Overwrite)\"\n");
} else if(strstr(profile_name,"BD")==profile_name) {
printf("Mounted Media: %2.2Xh, %s\n", profile_number, profile_name);
printf("Mounted Media: %2.2Xh, %s\n", profile_number, profile_name);
} else {
printf("ATIP info from disk:\n");
if(burn_disc_erasable(drive)) {
@ -5256,18 +4898,14 @@ int Cdrskin_atip(struct CdrskiN *skin, int flag)
#ifdef Cdrskin_libburn_has_get_start_end_lbA
{ int start_lba,end_lba,min,sec,fr;
int m_lo, s_lo, f_lo;
ret= burn_drive_get_start_end_lba(drive,&start_lba,&end_lba,0);
if(ret>0) {
burn_lba_to_msf(start_lba,&min,&sec,&fr);
printf(" ATIP start of lead in: %d (%-2.2d:%-2.2d/%-2.2d)\n",
start_lba,min,sec,fr);
burn_lba_to_msf(end_lba,&m_lo,&s_lo,&f_lo);
burn_lba_to_msf(end_lba,&min,&sec,&fr);
printf(" ATIP start of lead out: %d (%-2.2d:%-2.2d/%-2.2d)\n",
end_lba, m_lo, s_lo, f_lo);
if(current_is_cd)
manuf= burn_guess_cd_manufacturer(min, sec, fr, m_lo, s_lo, f_lo, 0);
end_lba,min,sec,fr);
}
}
#endif /* Cdrskin_libburn_has_get_start_end_lbA */
@ -5275,65 +4913,10 @@ int Cdrskin_atip(struct CdrskiN *skin, int flag)
printf(" 1T speed low: %.f 1T speed high: %.f\n",x_speed_min,x_speed_max);
}
ret= burn_disc_get_media_id(drive, &product_id, &media_code1, &media_code2,
&book_type, 0);
if(ret > 0 && (!current_is_cd) &&
manuf == NULL && media_code1 != NULL && media_code2 != NULL) {
manuf= burn_guess_manufacturer(profile_number, media_code1, media_code2, 0);
}
if(product_id != NULL)
printf("Product Id: %s\n", product_id);
if(manuf != NULL)
printf("Producer: %s\n", manuf);
if(skin->verbosity >= Cdrskin_verbose_progresS) {
if (current_is_cd) {
if(manuf != NULL)
printf("Manufacturer: %s\n", manuf);
} else if(product_id != NULL && media_code1 != NULL && media_code2 != NULL){
free(product_id);
free(media_code1);
free(media_code2);
if(book_type != NULL)
free(book_type);
product_id= media_code1= media_code2= book_type= NULL;
ret= burn_disc_get_media_id(drive, &product_id, &media_code1,
&media_code2, &book_type, 1);
if(ret > 0) {
if(profile_number == 0x11 || profile_number == 0x13 ||
profile_number == 0x14 || profile_number == 0x15)
printf("Manufacturer: '%s'\n", media_code1);
else if(profile_number >= 0x40 && profile_number <= 0x43) {
printf("Manufacturer: '%s'\n", media_code1);
if(media_code2[0])
printf("Media type: '%s'\n", media_code2);
} else {
printf("Manufacturer: '%s'\n", media_code1);
if(media_code2[0])
printf("Media type: '%s'\n", media_code2);
}
}
}
}
ret= 1;
if(flag&1)
Cdrskin_toc(skin, !(flag & 2));
/*cdrecord seems to ignore -toc errors if -atip is ok */
if(flag & 4)
Cdrskin_minfo(skin, 0);
Cdrskin_toc(skin,1);/*cdrecord seems to ignore -toc errors if -atip is ok */
ex:;
if(manuf != NULL)
free(manuf);
if(media_code1 != NULL)
free(media_code1);
if(media_code2 != NULL)
free(media_code2);
if(book_type != NULL)
free(book_type);
if(product_id != NULL)
free(product_id);
Cdrskin_release_drive(skin,0);
/* A61227 :
@ -5431,14 +5014,6 @@ int Cdrskin_warn_of_mini_tsize(struct CdrskiN *skin, int flag)
enum burn_disc_status s;
struct burn_drive *drive;
#ifdef Cdrskin_libburn_has_get_drive_rolE
int ret;
ret= burn_drive_get_drive_role(skin->drives[skin->driveno].drive);
if(ret != 1)
return(1);
#endif /* Cdrskin_libburn_has_get_drive_rolE */
#ifdef Cdrskin_libburn_has_get_spacE
if(skin->multi || skin->has_open_ended_track || skin->smallest_tsize<0)
return(1);
@ -6151,28 +5726,19 @@ int Cdrskin_activate_write_mode(struct CdrskiN *skin,
goto report_failure;
}
skin->write_type= wt;
#ifndef Cdrskin_disable_raw96R
if(wt==BURN_WRITE_RAW)
strcpy(skin->preskin->write_mode_name,"RAW/RAW96R");
else
#endif /* ! Cdrskin_disable_raw96R */
if(wt==BURN_WRITE_TAO)
else if(wt==BURN_WRITE_TAO)
strcpy(skin->preskin->write_mode_name,"TAO");
else if(wt==BURN_WRITE_SAO)
strcpy(skin->preskin->write_mode_name,"SAO");
else
sprintf(skin->preskin->write_mode_name,"LIBBURN/%d", (int) wt);
}
#ifndef Cdrskin_disable_raw96R
if(strcmp(skin->preskin->write_mode_name,"RAW/RAW96R")==0) {
skin->write_type= BURN_WRITE_RAW;
skin->block_type= BURN_BLOCK_RAW96R;
} else
#endif /* ! Cdrskin_disable_raw96R */
if(strcmp(skin->preskin->write_mode_name,"TAO")==0) {
} else if(strcmp(skin->preskin->write_mode_name,"TAO")==0) {
skin->write_type= BURN_WRITE_TAO;
skin->block_type= BURN_BLOCK_MODE1;
} else if(strncmp(skin->preskin->write_mode_name,"LIBBURN/",8)==0) {
@ -6296,12 +5862,9 @@ int Cdrskin_activate_write_mode(struct CdrskiN *skin, enum burn_disc_status s,
strcpy(skin->preskin->write_mode_name,"SAO");
}
}
#ifndef Cdrskin_disable_raw96R
if(strcmp(skin->preskin->write_mode_name,"RAW/RAW96R")==0) {
skin->write_type= BURN_WRITE_RAW;
skin->block_type= BURN_BLOCK_RAW96R;
#endif /* ! Cdrskin_disable_raw96R */
#ifdef Cdrskin_allow_libburn_taO
} else if(strcmp(skin->preskin->write_mode_name,"TAO")==0) {
@ -6339,13 +5902,9 @@ check_with_drive:;
ok= 1;
if(skin->write_type==BURN_WRITE_TAO && might_do_tao)
ok= 1;
#ifndef Cdrskin_disable_raw96R
} else if(skin->write_type==BURN_WRITE_RAW) {
} else if(skin->write_type==BURN_WRITE_RAW)
ok= !!(drive_info->raw_block_types & BURN_BLOCK_RAW96R);
#endif
} else if(skin->write_type==BURN_WRITE_SAO && !mixed_mode)
else if(skin->write_type==BURN_WRITE_SAO && !mixed_mode)
ok= !!(drive_info->sao_block_types & BURN_BLOCK_SAO);
else if(skin->write_type==BURN_WRITE_TAO) {
block_type_demand= 0;
@ -6425,7 +5984,7 @@ check_with_drive:;
skin->multi= 0;
if(!skin->use_data_image_size)
if(skin->verbosity>=Cdrskin_verbose_progresS)
fprintf(stderr, "cdrskin: NOTE : -multi cannot leave a recognizable end mark on this media.\n");
fprintf(stderr, "cdrskin: NOTE : -multi cannot leave a recognizeable end mark on this media.\n");
}
}
@ -6894,7 +6453,7 @@ burn_failed:;
#ifdef Cdrskin_libburn_has_multI
if(skin->media_is_overwriteable && skin->multi) {
if(skin->grow_overwriteable_iso<=0) {
fprintf(stderr, "cdrskin: FATAL : -multi cannot leave a recognizable end mark on this media.\n");
fprintf(stderr, "cdrskin: FATAL : -multi cannot leave a recognizeable end mark on this media.\n");
fprintf(stderr, "cdrskin: HINT : For ISO-9660 images try --grow_overwriteable_iso -multi\n");
{ret= 0; goto ex;}
}
@ -7453,10 +7012,11 @@ int Cdrskin_setup(struct CdrskiN *skin, int argc, char **argv, int flag)
"-d", "-Verbose", "-V", "-silent", "-s", "-setdropts", "-prcap",
"-reset", "-abort", "-overburn", "-ignsize", "-useinfo",
"-fix", "-nofix",
"-raw", "-raw96p", "-raw16", "-raw96r",
"-clone", "-text",
"-raw", "-raw96p", "-raw16",
"-clone", "-text", "-mode2", "-xa", "-xa1", "-xa2", "-xamix",
"-cdi", "-preemp", "-nopreemp", "-copy", "-nocopy",
"-scms", "-shorttrack", "-noshorttrack", "-packet", "-noclose",
"-media-info", "-minfo",
""
};
@ -7693,9 +7253,9 @@ unsupported_blank_option:;
skin->do_checkdrive= 1;
} else if(strcmp(argv[i],"-data")==0) {
option_data:;
/* All Subsequent Tracks Option */
skin->cdxa_conversion= (skin->cdxa_conversion & ~0x7fffffff) | 0;
/* >>> !!! All Subsequent Tracks Option */
skin->track_type= BURN_MODE1;
skin->track_type_by_default= 0;
@ -7967,11 +7527,6 @@ gracetime_equals:;
} else if(strcmp(argv[i],"-lock")==0) {
skin->do_load= 2;
} else if(strcmp(argv[i],"--long_toc")==0) {
skin->do_atip= 3;
if(skin->verbosity>=Cdrskin_verbose_cmD)
ClN(printf("cdrskin: will put out some -atip style lines plus -toc\n"));
} else if(strncmp(argv[i],"-minbuf=",8)==0) {
value_pt= argv[i]+8;
goto minbuf_equals;
@ -7996,15 +7551,6 @@ minbuf_equals:;
return(0);
#endif
} else if(strcmp(argv[i],"-minfo") == 0 ||
strcmp(argv[i],"-media-info") == 0) {
skin->do_atip= 4;
} else if(strcmp(argv[i], "-mode2") == 0) {
fprintf(stderr,
"cdrskin: NOTE : defaulting option -mode2 to option -data\n");
goto option_data;
} else if(strncmp(argv[i],"modesty_on_drive=",17)==0) {
#ifdef Cdrskin_libburn_has_set_waitinG
value_pt= argv[i]+17;
@ -8142,10 +7688,8 @@ set_padsize:;
} else if(strcmp(argv[i],"--prodvd_cli_compatible")==0) {
skin->prodvd_cli_compatible= 1;
#ifdef NIX
} else if(strcmp(argv[i],"-raw96r")==0) {
/* is handled in Cdrpreskin_setup() */;
#endif
} else if(strcmp(argv[i],"-sao")==0 || strcmp(argv[i],"-dao")==0) {
/* is handled in Cdrpreskin_setup() */;
@ -8280,24 +7824,6 @@ track_too_large:;
skin->write_start_address));
skin->preskin->demands_cdrskin_caps= 1;
} else if(strcmp(argv[i], "-xa") == 0) {
fprintf(stderr,"cdrskin: NOTE : defaulting option -xa to option -data\n");
goto option_data;
} else if(strcmp(argv[i], "-xa1") == 0) {
/* All Subsequent Tracks Option */
skin->cdxa_conversion= (skin->cdxa_conversion & ~0x7fffffff) | 1;
skin->track_type= BURN_MODE1;
skin->track_type_by_default= 0;
} else if(strcmp(argv[i], "-xa2") == 0) {
fprintf(stderr,
"cdrskin: NOTE : defaulting option -xa2 to option -data\n");
goto option_data;
} else if(strcmp(argv[i], "--xa1-ignore") == 0) {
skin->cdxa_conversion|= (1 << 31);
} else if( i==argc-1 ||
(skin->single_track==0 && strchr(argv[i],'=')==NULL
&& !(argv[i][0]=='-' && argv[i][1]!=0) ) ||
@ -8640,8 +8166,7 @@ int Cdrskin_run(struct CdrskiN *skin, int *exit_value, int flag)
if(skin->do_atip) {
if(skin->n_drives<=0)
{*exit_value= 7; goto no_drive;}
ret= Cdrskin_atip(skin, skin->do_atip == 4 ? 4 :
(skin->do_atip>1) | (2 * (skin->do_atip > 2)));
ret= Cdrskin_atip(skin,(skin->do_atip>1));
if(ret<=0)
{*exit_value= 7; goto ex;}
}

View File

@ -34,12 +34,10 @@ CD-R, DVD-R, DVD+R, DVD+R/DL, BD-R, CD-RW, DVD-RW, DVD-RAM, DVD+RW, BD-RE
<P>
<H2>Hardware requirements:</H2>
About any CD, DVD, or BD recorder produced in the recent ten years.
<BR>
<A HREF="http://libburnia-project.org">libburn</A>
supports recorders which are compliant to standards MMC-1 for CD and
MMC-5 for DVD or BD. Linux and FreeBSD allow to access drives connected
via SCSI, PATA (aka IDE, ATA), USB, or SATA.
A CD/DVD/BD recorder suitable for
<A HREF="http://libburnia-project.org">http://libburnia-project.org</A> <BR>
(SCSI , ATA , USB , or SATA writers compliant to standard MMC-3 for CD
and to MMC-5 for DVD or BD).
<BR>
</P>
@ -61,7 +59,7 @@ via SCSI, PATA (aka IDE, ATA), USB, or SATA.
GPL software included:<BR>
</H2>
<DL>
<DT>libburn-0.7.2</DT>
<DT>libburn-0.6.4</DT>
<DD>(founded by Derek Foreman and Ben Jansens,
developed and maintained since August 2006 by
Thomas Schmitt from team of libburnia-project.org)
@ -111,7 +109,7 @@ as listed by option --devices.</DT>
<DT>Get info about a particular drive or loaded media:</DT>
<DD>$<KBD>&nbsp;cdrskin dev=0,1,0 -checkdrive</KBD></DD>
<DD>$<KBD>&nbsp;cdrskin dev=ATA:1,0,0 -v -atip</KBD></DD>
<DD>$<KBD>&nbsp;cdrskin dev=/dev/hdc -minfo</KBD></DD>
<DD>$<KBD>&nbsp;cdrskin dev=/dev/hdc -toc</KBD></DD>
<DT>Prepare CD-RW or DVD-RW for re-use, DVD-RAM or BD-RE for first use:</DT>
<DD>$<KBD>&nbsp;cdrskin -v dev=/dev/sg1 blank=as_needed -eject</KBD></DD>
@ -179,11 +177,14 @@ man cdrecord</A></KBD></DD>
<DL>
<DT>Learn to know a more versatile way to burn ISO 9660 formatted data</DT>
<DD>
Standalone ISO 9660 multi-session CD/DVD/BD tool
Standalone ISO 9660 multi-session CD/DVD tool
<A HREF="http://scdbackup.sourceforge.net/xorriso_eng.html">xorriso</A>.
</DD>
</DL>
Testers wanted who are willing to risk some DVD-R DL media
or to do experiments on BD-R media.
</P>
<HR>
@ -193,8 +194,8 @@ Standalone ISO 9660 multi-session CD/DVD/BD tool
<P>
<DL>
<DT>Download as source code (see README):</DT>
<DD><A HREF="cdrskin-0.7.2.pl00.tar.gz">cdrskin-0.7.2.pl00.tar.gz</A>
(780 KB).
<DD><A HREF="cdrskin-0.6.4.pl00.tar.gz">cdrskin-0.6.4.pl00.tar.gz</A>
(750 KB).
</DD>
<DD>
The cdrskin tarballs are source code identical with libburn releases
@ -243,20 +244,20 @@ cdrskin_0.4.2.pl00-x86-suse9_0-static.tar.gz</A>, (310 KB), -static compiled,
<HR>
<P>
Enhancements towards previous stable version cdrskin-0.7.0.pl00:
Enhancements towards previous stable version cdrskin-0.6.2.pl00:
<UL>
<LI>Better interpretation of options -mode2, -xa, -xa1, -xa2</LI>
<LI>New option --xa1-ignore</LI>
<LI>New -atip report lines "Product Id:" and "Producer:"</LI>
<LI>Emulation of some -minfo output</LI>
<LI>New operating system adapter "dummy" for stdio on general X/Open systems
</LI>
<LI>New stream recording mode with start address</LI>
<LI></LI>
<!--
<LI>none</LI>
-->
</UL>
Bug fixes towards cdrskin-0.7.0.pl00:
Bug fixes towards cdrskin-0.6.2.pl00:
<UL>
<LI>CD TAO sessions with multiple tracks did not work in -dummy mode</LI>
<LI>none</LI>
<!--
<LI>none</LI>
-->
@ -266,8 +267,8 @@ Bug fixes towards cdrskin-0.7.0.pl00:
<P>
<DL>
<DT><H3>Development snapshot, version 0.7.3 :</H3></DT>
<DD>Enhancements towards current stable version 0.7.2.pl00:
<DT><H3>Development snapshot, version 0.6.5 :</H3></DT>
<DD>Enhancements towards current stable version 0.6.4.pl00:
<UL>
<LI>none yet</LI>
<!--
@ -275,20 +276,11 @@ Bug fixes towards cdrskin-0.7.0.pl00:
</UL>
</DD>
<DD>Bug fixes towards cdrskin-0.7.2.pl00:
<UL>
<LI>none yet</LI>
<!--
-->
</UL>
</DD>
<DD>&nbsp;</DD>
<DD><A HREF="README_cdrskin_devel">README 0.7.3</A>
<DD><A HREF="cdrskin__help_devel">cdrskin_0.7.3 --help</A></DD>
<DD><A HREF="cdrskin_help_devel">cdrskin_0.7.3 -help</A></DD>
<DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.7.3)</A></DD>
<DD><A HREF="README_cdrskin_devel">README 0.6.5</A>
<DD><A HREF="cdrskin__help_devel">cdrskin_0.6.5 --help</A></DD>
<DD><A HREF="cdrskin_help_devel">cdrskin_0.6.5 -help</A></DD>
<DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.6.5)</A></DD>
<DD>&nbsp;</DD>
<DT>Maintainers of cdrskin unstable packages please use SVN of
<A HREF="http://libburnia-project.org"> libburnia-project.org</A></DT>
@ -308,8 +300,8 @@ admins with full system souvereignty.</DT>
<A HREF="README_cdrskin_devel">upcoming README</A> ):
</DD>
<DD>
<A HREF="cdrskin-0.7.3.tar.gz">cdrskin-0.7.3.tar.gz</A>
(780 KB).
<A HREF="cdrskin-0.6.5.tar.gz">cdrskin-0.6.5.tar.gz</A>
(750 KB).
</DD>
<!-- This is not offered any more since spring 2008
@ -342,7 +334,7 @@ Historic versions based on Derek's and Ben's
<BR>
Very special thanks to Andy Polyakov whose
<A HREF="http://fy.chalmers.se/~appro/linux/DVD+RW/tools">dvd+rw-tools</A>
provide libburn with invaluable examples on how to deal with DVD and BD media.
provide libburn with invaluable examples on how to deal with DVD media.
</P>
<HR>
@ -504,17 +496,12 @@ and by <A HREF="http://sourceforge.net">sourceforge.net</A><BR>
<A href="http://sourceforge.net">
<IMG src="sflogo-88-1.png" BORDER="0" ALT="SourceForge Logo"></A>
<!-- on sourceforge use : <IMG src="http://sourceforge.net/sflogo.php?group_id=16010" width="88" height="31" border="0" alt="SourceForge Logo"></A> -->
<P>
Enjoying a FreeBSD shell account with the opportunity to
build and install cdrskin at<BR>
<A HREF="http://www.en.free-shells.com.ar">free-shells.com.ar</A>
</P>
</FONT></CENTER>
<HR>
<DL>
<DT>Links to my other published software projects :
<DD><A HREF="http://scdbackup.webframe.org/xorriso_eng.html">
xorriso, a standalone ISO 9660 multi-session CD/DVD/BD burn tool.
xorriso, a standalone ISO 9660 multi-session CD/DVD burn tool.
No mkisofs needed.
<DL>
<DD>

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2009.10.12.080001"
#define Cdrskin_timestamP "2009.03.13.080001"

View File

@ -1761,17 +1761,6 @@ Version leap to 0.2.6
Published cdrskin-0.2.6.pl01 on cdrskin home pages
------------------------------- cycle - cdrskin-0.2.6.pl01 - 2006.11.23.114611
* Enabled TAO
* Bug fixed: Trailing trash appended to .wav files caused error message
and, if exceeding fifo size, could even stall a burn.
* Multi-session CDs (for now restricted to write mode TAO), -multi, -msinfo
* Bug fixed: False speed with first pacifier cycle. Potential SIGFPE by NaN.
* Enabled named pipes and other non-plain file types as track sources
(actually already in previous cycle)
* Bug fixed: Default speed was not highest possible but announced as "MAX"
* SAO is preferred default write mode, TAO is default when needed
* libisofs unbundled from libburn+cdrskin
* Hints for porting to other operating systems are now in sg-*.c
2006.11.24.121745 [437]
@ -6517,7 +6506,7 @@ Made libburn number transition to 0.6.4
+ cdrskin/add_ts_changes_to_libburn_0_6_5
Updated cdrskin tarball generator
13 Mar 2009 [2534]
13 Mar 2009 []
cdrskin/changelog.txt
Documented changes and release timestamp
@ -6546,623 +6535,8 @@ Made libburn number transition to 0.6.5
+ cdrskin/add_ts_changes_to_libburn_0_6_5
Updated cdrskin tarball generator
13 Mar 2009 [2535]
cdrskin/changelog.txt
Documented changes and release timestamp
------------------------------------ cycle - cdrskin-0.6.5 - 2009.03.13.162355
13 Mar 2009 [2538]
svn move -m "libburn release 0.6.4 is ready" \
http://svn.libburnia-project.org/libburn/branches/ZeroSixFour \
http://svn.libburnia-project.org/libburn/tags/ZeroSixFour
2009.03.16.190745 [2547]
configure.ac
acinclude.m4
Makefile.am
Get on FreeBSD pkgconfigdir=.../libdata , on Linux and others: .../lib
2009.03.18.124558 [2553]
libburn/spc.c
Human readable error messages for asc=08 "Logical unit communication failure"
2009.03.18.172512 [2554]
libburn/drive.c
Bug fix: burn_abort() did not work with broken output pipe (since rev 2514)
2009.04.30.065653 [2623]
libburn/write.c
Marked alleged use of uninitialized memory reported by valgrind
2009.04.30.065918 [2624]
libburn/write.c
Replaced 8 blanks by a tab
2009.04.30.070813 [2625]
libburn/sg-freebsd.c
Bug fix: Device scan stalled on FreeBSD. Ticket 148 jwehle
------------------------------------ cycle - cdrskin-0.6.5 - 2009.04.30.070813
Bug fix: burn_abort() did not work with broken output pipe (since rev 2514)
Bug fix: Device scan stalled on FreeBSD. Ticket 148 jwehle
7 May 2009 [2628]
svn copy -m "Branching for libburn release 0.6.6"
http://svn.libburnia-project.org/libburn/trunk
http://svn.libburnia-project.org/libburn/branches/ZeroSixSix
7 May 2009 [2629]
cdrskin/cdrskin.1
Mentioned BD were it was missing
2009.05.07.100001 [2630]
Makefile.am
configure.ac
README
libburn/libburn.h
cdrskin/cdrskin.c
cdrskin/README
cdrskin/compile_cdrskin.sh
cdrskin/cdrskin_timestamp.h
cdrskin/cdrskin_eng.html
Made number transition and activated development documentation
7 May 2009 [2631]
- cdrskin/add_ts_changes_to_libburn_0_6_4
- cdrskin/add_ts_changes_to_libburn_0_6_5
+ cdrskin/add_ts_changes_to_libburn_0_6_6
+ cdrskin/add_ts_changes_to_libburn_0_6_7
Updated cdrskin tarball generator
7 May 2009 [2632]
cdrskin/changelog.txt
Documented changes and release timestamp
------------------------------ release - cdrskin-0.6.6.pl00 - 2009.05.07.100001
Bug fix: burn_abort() did not work with broken output pipe (since rev 2514)
Bug fix: Device scan stalled on FreeBSD. Ticket 148 jwehle
7 May 2009 [2633]
cdrskin/cdrskin.1
Mentioned BD were it was missing
2009.05.07.181034 [2634]
Makefile.am
configure.ac
README
libburn/libburn.h
cdrskin/cdrskin.c
cdrskin/README
cdrskin/compile_cdrskin.sh
cdrskin/cdrskin_timestamp.h
cdrskin/cdrskin_eng.html
Made number transition and activated development documentation
7 May 2009 [2635]
- cdrskin/add_ts_changes_to_libburn_0_6_4
- cdrskin/add_ts_changes_to_libburn_0_6_5
+ cdrskin/add_ts_changes_to_libburn_0_6_6
+ cdrskin/add_ts_changes_to_libburn_0_6_7
Updated cdrskin tarball generator
7 May 2009 [2636]
cdrskin/changelog.txt
Documented changes and release timestamp
------------------------------------ cycle - cdrskin-0.6.7 - 2009.05.07.181034
8 May 2009 [2637]
svn move -m libburn release 0.6.6 is ready
http://svn.libburnia-project.org/libburn/branches/ZeroSixSix
http://svn.libburnia-project.org/libburn/tags/ZeroSixSix
2009.05.17.144304 [2645]
cdrskin/cdrskin.c
Made -scanbus work with SCSI bus numbers like 85 (USB, kernel 2.6.18.2)
2009.06.02.162841 [2655]
libburn/drive.c
libburn/async.c
libburn/options.c
libburn/spc.c
libburn/libdax_msgs.h
Rectified use of burn_drive.mdata->valid
2 Jun 2009 [2656]
test/libburner.c
Avoided SIGSEGV if no drives were found by scan
2009.06.02.172201 [2657]
libburn/drive.c
Avoided to enumerate faulty drive objects
2009.06.03.085637 [2658]
libburn/spc.c
Bug fix: Old MMC-1 drives were rejected because of mode page 2Ah length
2009.06.03.185118 [2659]
libburn/transport.h
libburn/drive.c
libburn/spc.c
libburn/mmc.c
Bug fix: No usable media was detected with old MMC-1 drives
2009.06.14.095004 [2669]
libburn/sg-linux.c
Retrying 3 times on EBUSY drives with generous usleep intervals
------------------------------------ cycle - cdrskin-0.6.7 - 2009.06.14.095833
Made -scanbus work with high SCSI bus numbers
Bug fix: Old MMC-1 drives were rejected because of mode page 2Ah length
Bug fix: No usable media was detected with old MMC-1 drives
7 Jul 2009 [2691]
acinclude.m4
configure.ac
configure options --enable-libdir-pkgconfig and --enable-pkgconfig-path=DIR
2009.07.07.191134 [2692]
Timestamp for revision 2691
14 Jul 2009 [2894]
svn copy -m "Branching for libburn release 0.6.8"
http://svn.libburnia-project.org/libburn/trunk
http://svn.libburnia-project.org/libburn/branches/ZeroSixEight
2009.07.14.100001 [2695]
Makefile.am
configure.ac
README
libburn/libburn.h
cdrskin/cdrskin.c
cdrskin/README
cdrskin/compile_cdrskin.sh
cdrskin/cdrskin_timestamp.h
cdrskin/cdrskin_eng.html
Made number transition and activated development documentation
14 Jul 2009 [2696]
- cdrskin/add_ts_changes_to_libburn_0_6_6
- cdrskin/add_ts_changes_to_libburn_0_6_7
+ cdrskin/add_ts_changes_to_libburn_0_6_8
+ cdrskin/add_ts_changes_to_libburn_0_6_9
Updated cdrskin tarball generator
14 Jul 2009 [2697]
cdrskin/changelog.txt
Documented changes and release timestamp
------------------------------ release - cdrskin-0.6.8.pl00 - 2009.07.14.100001
Made -scanbus work with high SCSI bus numbers
Bug fix: Old MMC-1 drives were rejected because of mode page 2Ah length
Bug fix: No usable media was detected with old MMC-1 drives
2009.07.14.133159 [2698]
Makefile.am
configure.ac
README
libburn/libburn.h
cdrskin/cdrskin.c
cdrskin/README
cdrskin/compile_cdrskin.sh
cdrskin/cdrskin_timestamp.h
cdrskin/cdrskin_eng.html
Made number transition and activated development documentation
14 Jul 2009 [2699]
- cdrskin/add_ts_changes_to_libburn_0_6_6
- cdrskin/add_ts_changes_to_libburn_0_6_7
+ cdrskin/add_ts_changes_to_libburn_0_6_8
+ cdrskin/add_ts_changes_to_libburn_0_6_9
Updated cdrskin tarball generator
14 Jul 2009 [2700]
cdrskin/changelog.txt
Documented changes and release timestamp
------------------------------------ cycle - cdrskin-0.6.9 - 2009.07.14.133159
14 Jul 2009 [2702]
svn move -m libburn release 0.6.8 is ready
http://svn.libburnia-project.org/libburn/branches/ZeroSixEight
http://svn.libburnia-project.org/libburn/tags/ZeroSixEight
2009.08.15.133055 [2721]
libburn/write.c
Added test code about output blocks size as comment.
2009.08.15.133332 [2722]
libburn/libburn.h
libburn/transport.h
libburn/drive.c
libburn/mmc.h
libburn/mmc.c
New API calls burn_drive_get_all_profiles(), burn_obtain_profile_name()
2009.08.15.133744 [2723]
cdrskin/cdrskin.c
Listing all profiles with cdrskin -v -atip
2009.08.23.130326 [2735]
libburn/drive.c
libburn/spc.c
libburn/mmc.c
Adapted to pitfalls of U3 memory sticks which appear as CD-ROM drives
------------------------------------ cycle - cdrskin-0.6.9 - 2009.08.23.132942
New API calls burn_drive_get_all_profiles(), burn_obtain_profile_name()
Adapted to pitfalls of U3 memory sticks which appear as CD-ROM drives
2009.08.24.131146 [2736]
libburn/libburn.h
libburn/transport.h
libburn/drive.c
libburn/sbc.c
New API call burn_drive_snooze()
2009.08.24.161646 [2737]
libburn/libburn.h
libburn/drive.c
Made burn_drive_snooze() safe for emulated drives
2009.08.24.202517 [2740]
libburn/transport.h
libburn/sbc.c
libburn/mmc.c
Implemented automatic START UNIT after STOP UNIT before any other SCSI command
2009.08.27.123001 [2746]
Makefile.am
configure.ac
README
libburn/libburn.h
cdrskin/cdrskin.c
cdrskin/README
cdrskin/compile_cdrskin.sh
cdrskin/cdrskin_timestamp.h
cdrskin/cdrskin_eng.html
Made number transition and activated development documentation
27 Aug 2009 [2747]
- cdrskin/add_ts_changes_to_libburn_0_6_8
- cdrskin/add_ts_changes_to_libburn_0_6_9
+ cdrskin/add_ts_changes_to_libburn_0_7_0
+ cdrskin/add_ts_changes_to_libburn_0_7_1
Updated cdrskin tarball generator
27 Aug 2009 [2748]
cdrskin/changelog.txt
Documented changes and release timestamp
------------------------------ release - cdrskin-0.7.0.pl00 - 2009.08.27.123001
New API calls burn_drive_get_all_profiles(), burn_obtain_profile_name()
New API call burn_drive_snooze()
Adapted to pitfalls of U3 memory sticks which appear as CD-ROM drives
Listing all supported profiles with option -atip
2009.08.27.143351 [2749]
Makefile.am
configure.ac
README
libburn/libburn.h
cdrskin/cdrskin.c
cdrskin/README
cdrskin/compile_cdrskin.sh
cdrskin/cdrskin_timestamp.h
cdrskin/cdrskin_eng.html
Made number transition to development version 0.7.1
27 Aug 2009 [2750]
- cdrskin/add_ts_changes_to_libburn_0_6_8
- cdrskin/add_ts_changes_to_libburn_0_6_9
+ cdrskin/add_ts_changes_to_libburn_0_7_0
+ cdrskin/add_ts_changes_to_libburn_0_7_1
Updated cdrskin tarball generator
27 Aug 2009 [2751]
cdrskin/changelog.txt
Documented changes and release timestamp
------------------------------------ cycle - cdrskin-0.7.1 - 2009.08.27.143351
2009.09.01.082602 [2773]
cdrskin/cdrskin.c
cdrskin/cdrskin.1
Disabled write mode -raw96r
2009.09.01.095750 [2774] [2775]
libburn/libburn.h
libburn/sector.h
libburn/sector.c
libburn/lec.h
libburn/lec.c
libburn/read.c
libburn/write.c
Disabled code using libburn/lec.c
2009.09.01.113957 [2777]
cdrskin/cdrskin.c
Aligned the output columns of cdrskin --devices
2009.09.01.133520 [2778]
cdrskin/cdrskin.c
cdrskin/cdrskin.1
New option --long_toc, now printing media summary at end of TOC
2009.09.02.131514 [2779]
Makefile.am
libburn/sector.c
- libburn/lec.h
- libburn/lec.c
cdrskin/compile_cdrskin.sh
Removed lec.c from libburn
2009.09.02.133307 [2780]
libburn/libburn.h
libburn/util.c
+ doc/mediainfo.txt
cdrskin/cdrskin.c
New API call burn_guess_cd_manufacturer()
2009.09.04.202255 [2781]
libburn/libburn.h
libburn/drive.c
libburn/util.c
libburn/spc.c
libburn/mmc.h
libburn/mmc.c
New API calls burn_get_media_product_id() and burn_guess_manufacturer()
2009.09.04.202357 [2782]
cdrskin/cdrskin.c
Option -atip now reports Product Id and Manufacturer for most CD, DVD, BD types
4 Sep 2009 [2783]
doc/mediainfo.txt
Updated media info documentation
2009.09.04.204432 [2784]
cdrskin/cdrskin.c
Adjusted column width of media info messages
2009.09.05.072512 [2785]
cdrskin/cdrskin.c
Adjusted column width of media summary message
------------------------------------ cycle - cdrskin-0.7.1 - 2009.09.05.072659
* New option --long_toc, now printing media summary at end of TOC
* New API call burn_guess_cd_manufacturer()
* New API calls burn_get_media_product_id() and burn_guess_manufacturer()
2009.09.05.113043 [2786]
libburn/util.h
libburn/util.c
libburn/mmc.c
Made product ID surely a single printable word
2009.09.05.114326 [2787]
libburn/sg-linux.c
Silenced a valgrind warning caused by not recognizing side effects of a ioctl
2009.09.05.115112 [2788]
cdrskin/cdrskin.c
Closed a small memory leak with drive inquiry
2009.09.05.120947 [2789]
cdrskin/cdrskin.c
Made cdrskin/compile_cdrskin.sh -libburn_0_7_0 work again
------------------------------------ cycle - cdrskin-0.7.1 - 2009.09.05.121334
2009.09.05.131859 [2790]
cdrskin/cdrskin.c
Re-enabled output of product id and manufacturer
------------------------------------ cycle - cdrskin-0.7.1 - 2009.09.05.132208
2009.09.05.165127 [2791]
libburn/libburn.h
libburn/drive.c
libburn/util.c
libburn/mmc.c
Introduced flag bit0 for API call burn_get_media_product_id()
2009.09.05.165257 [2792]
cdrskin/cdrskin.c
"Manufacturer:", "Media type:" as cdrecord, own "Product Id:" and "Producer:"
------------------------------------ cycle - cdrskin-0.7.1 - 2009.09.05.172818
* New -atip report lines "Product Id:" and "Producer:"
2009.09.06.092330 [2793]
libburn/util.c
Made recognition of CD media codes work in burn_guess_manufacturer()
2009.09.06.092654 [2794]
libburn/libburn.h
libburn/drive.c
cdrskin/cdrskin.c
Changed new API call burn_get_media_product_id() to burn_disc_get_media_id()
06 Sep 2009 [2795]
doc/mediainfo.txt
Corrected misformatted manufacturer strings of DVD- media
2009.09.06.112121 [2796]
libburn/mmc.c
doc/mediainfo.txt
Avoided to read third sixpack of manufacturer bytes with DVD-R media
------------------------------------ cycle - cdrskin-0.7.1 - 2009.09.06.115138
2009.09.09.125305 [2801]
libburn/libburn.h
libburn/transport.h
libburn/drive.c
libburn/mmc.c
New API call burn_disc_get_cd_info()
2009.09.09.134030 [2802]
libburn/transport.h
libburn/drive.c
libburn/mmc.c
Correction with erasable bit of burn_disc_get_cd_info()
2009.09.09.153951 [2803]
libburn/libburn.h
libburn/mmc.c
New struct burn_toc_entry extension for Last Recorded Address
2009.09.09.173452 [2804]
cdrskin/cdrskin.c
cdrskin/cdrskin.1
Emulation of some -minfo output
2009.09.09.174337 [2805]
cdrskin/cdrskin.c
Silenced compiler warning
------------------------------------ cycle - cdrskin-0.7.1 - 2009.09.09.174446
* New API call burn_disc_get_cd_info()
* Emulation of some -minfo output
2009.09.10.071253 [2806]
cdrskin/cdrskin.c
Removed Media summary from -minfo because of incompatible counting rules
------------------------------------ cycle - cdrskin-0.7.1 - 2009.09.10.084912
2009.09.11.112528 [2807]
libburn/libburn.h
libburn/transport.h
libburn/structure.h
libburn/structure.c
libburn/sector.c
New API call burn_track_set_cdxa_conv()
2009.09.11.120959 [2808]
cdrskin/cdrskin.c
cdrskin/cdrskin.1
Interpreting options -mode2, -xa, -xa1, -xa2 but producing CD-ROM Mode 1 tracks
12 Sep 2009 [2809]
cdrskin/cdrskin_eng.html
Updated cdrskin web page
------------------------------------ cycle - cdrskin-0.7.1 - 2009.09.12.134510
* New API call burn_track_set_cdxa_conv()
* Better interpretation of options -mode2, -xa, -xa1, -xa2
* New option --xa1-ignore
2009.09.13.095055 [2810]
libburn/drive.c
Evaluating read capacity with role 2 drives (regular files and block devices)
2009.09.18.161214 [2815]
libburn/sector.c
Fixing SIGSEGV with CD SAO introduced with revision 2807
2009.09.18.161944 [2816]
libburn/read.c
libburn/libdax_msgs.h
Refusing to read beyond media_read_capacity
------------------------------------ cycle - cdrskin-0.7.1 - 2009.09.18.164446
2009.09.20.111911 [2820]
libburn/libburn.h
Mentioned need for 2056 byte fifo chunks with burn_track_set_cdxa_conv()
2009.09.22.192545 [2822]
libburn/sbc.c
Revoked instruction to retry STOP UNIT
2009.09.22.192802 [2823]
libburn/sg-linux.c
Restricted retry to the timeout for single SCSI commands (200 seconds)
2009.10.04.151239 [2830]
libburn/write.c
libburn/libdax_msgs.h
Fixed CD TAO multi-track -dummy bug reported by Philippe Rouquier
------------------------------------ cycle - cdrskin-0.7.1 - 2009.10.08.174136
* Bug fix: CD TAO sessions with multiple tracks did not work in -dummy mode
2009.10.09.123651 [2847]
libburn/mmc.c
Determining read capacity for DVD-RAM
2009.10.09.123840 [2848]
cdrskin/cdrskin.c
Made -minfo stupidly report overwriteable media as "erasable" and "complete"
2009.10.09.200411 [2849]
libburn/read.c
Made read_capacity error message of burn_read_data() depending on flag bit1
2009.10.09.200730 [2850]
cdrskin/cdrskin.c
Made -minfo subtract 2 from track size if "Data" and last 2 blocks unreadable
12 Oct 2009 [2854]
svn copy -m "Branching for libburn release 0.7.2" \
http://svn.libburnia-project.org/libburn/trunk \
http://svn.libburnia-project.org/libburn/branches/ZeroSevenTwo
2009.10.12.080001 [2855]
Makefile.am
configure.ac
README
libburn/libburn.h
cdrskin/cdrskin.c
cdrskin/README
cdrskin/compile_cdrskin.sh
cdrskin/cdrskin_timestamp.h
cdrskin/cdrskin_eng.html
Made number transition and activated development documentation
12 Oct 2009 [2856]
- cdrskin/add_ts_changes_to_libburn_0_7_0
- cdrskin/add_ts_changes_to_libburn_0_7_1
+ cdrskin/add_ts_changes_to_libburn_0_7_2
+ cdrskin/add_ts_changes_to_libburn_0_7_3
Updated cdrskin tarball generator
[]
cdrskin/changelog.txt
Documented changes and release timestamp
------------------------------ release - cdrskin-0.7.2.pl00 - 2009.10.12.080001
* Bug fix: CD TAO sessions with multiple tracks did not work in -dummy mode
* Better interpretation of options -mode2, -xa, -xa1, -xa2
* New option --xa1-ignore
* Emulation of some -minfo output
* New -atip report lines "Product Id:" and "Producer:"
* New API call burn_guess_cd_manufacturer()
* New API calls burn_get_media_product_id() and burn_guess_manufacturer()
* New API call burn_disc_get_cd_info()
* New API call burn_track_set_cdxa_conv()
------------------------------------ cycle - cdrskin-0.7.3 -
------------------------------------ cycle - cdrskin-0.7.3 -
------------------------------------ cycle - cdrskin-0.7.3 -
------------------------------------ cycle - cdrskin-0.6.5 -
------------------------------------ cycle - cdrskin-0.6.5 -
===============================================================================
TODO
@ -7171,9 +6545,6 @@ Documented changes and release timestamp
--------------------------------- bugs -------------------------------------
- handle HD DVD profiles 0x50 "HD DVD-ROM", 0x51 "HD DVD-R", 0x52 "HD DVD-RAM"
as readable.
- Do something about drive->buffer asynchronous race conditions
and dangerous use of local heap memory.
(The various asynchronous operations use the same buffer

View File

@ -1,13 +1,13 @@
#!/bin/sh
# compile_cdrskin.sh
# Copyright 2005 - 2009 Thomas Schmitt, scdbackup@gmx.net, GPL version 2
# Copyright 2005 - 2008 Thomas Schmitt, scdbackup@gmx.net, GPL version 2
# to be executed within ./libburn-* resp ./cdrskin-*
debug_opts="-O2"
def_opts=
largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1"
libvers="-DCdrskin_libburn_0_7_2"
libvers="-DCdrskin_libburn_0_6_4"
cleanup_src_or_obj="libburn/cleanup.o"
libdax_msgs_o="libburn/libdax_msgs.o"
libdax_audioxtr_o="libburn/libdax_audioxtr.o"
@ -33,15 +33,15 @@ do
libdax_audioxtr_o=
libdax_msgs_o="libburn/message.o"
cleanup_src_or_obj="-DCleanup_has_no_libburn_os_H cdrskin/cleanup.c"
elif test "$i" = "-libburn_0_7_2"
elif test "$i" = "-libburn_0_6_4"
then
libvers="-DCdrskin_libburn_0_7_2"
libvers="-DCdrskin_libburn_0_6_4"
libdax_audioxtr_o="libburn/libdax_audioxtr.o"
libdax_msgs_o="libburn/libdax_msgs.o"
cleanup_src_or_obj="libburn/cleanup.o"
elif test "$i" = "-libburn_svn"
then
libvers="-DCdrskin_libburn_0_7_3"
libvers="-DCdrskin_libburn_0_6_5"
libdax_audioxtr_o="libburn/libdax_audioxtr.o"
libdax_msgs_o="libburn/libdax_msgs.o"
cleanup_src_or_obj="libburn/cleanup.o"
@ -75,7 +75,7 @@ do
echo "Options:"
echo " -compile_cdrfifo compile program cdrskin/cdrfifo."
echo " -compile_dewav compile program test/dewav without libburn."
echo " -libburn_0_7_2 set macro to match libburn-0.7.2"
echo " -libburn_0_6_4 set macro to match libburn-0.6.4"
echo " -libburn_svn set macro to match current libburn-SVN."
echo " -do_not_compile_cdrskin omit compilation of cdrskin/cdrskin."
echo " -experimental use newly introduced libburn features."
@ -140,6 +140,7 @@ then
libburn/toc.o \
\
libburn/crc.o \
libburn/lec.o \
\
-lpthread

View File

@ -1,4 +1,4 @@
AC_INIT([libburn], [0.7.2], [http://libburnia-project.org])
AC_INIT([libburn], [0.6.4], [http://libburnia-project.org])
AC_PREREQ([2.50])
dnl AC_CONFIG_HEADER([config.h])
@ -7,7 +7,7 @@ AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([subdir-objects])
dnl Notes by ts A71207 - A91012 :
dnl Notes by ts A71207 - A81111 :
dnl
dnl Regrettably the meaning of the various version types was misunderstood
dnl before version 0.4.1.
@ -71,10 +71,6 @@ dnl 0.5.8 = libburn.so.4.23.0
dnl 0.6.0 = libburn.so.4.25.0
dnl 0.6.2 = libburn.so.4.27.0
dnl 0.6.4 = libburn.so.4.29.0
dnl 0.6.6 = libburn.so.4.31.0
dnl 0.6.8 = libburn.so.4.33.0
dnl 0.7.0 = libburn.so.4.35.0
dnl 0.7.2 = libburn.so.4.37.0
dnl
dnl So LT_CURRENT, LT_REVISION and LT_AGE get set directly here.
dnl SONAME of the emerging library is LT_CURRENT - LT_AGE.
@ -99,8 +95,8 @@ dnl If BURN_*_VERSION changes, be sure to change AC_INIT above to match.
dnl
dnl As said: Only copies. Original in libburn/libburn.h : burn_header_version_*
BURN_MAJOR_VERSION=0
BURN_MINOR_VERSION=7
BURN_MICRO_VERSION=2
BURN_MINOR_VERSION=6
BURN_MICRO_VERSION=4
BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
AC_SUBST(BURN_MAJOR_VERSION)
@ -111,15 +107,15 @@ AC_SUBST(BURN_VERSION)
dnl Libtool versioning
LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
dnl
dnl ts A91012
dnl ### This is the release version libburn-0.7.2 = libburn.so.4.37.0
dnl This is the development version after above release version
dnl ts A90313
dnl This is the release version libburn-0.6.4 = libburn.so.4.29.0
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 = 41 - 37 = 4 . Linux library name = libburn.so.4.37.0
LT_CURRENT=41
LT_AGE=37
dnl SONAME = 33 - 29 = 4 . Linux library name = libburn.so.4.29.0
LT_CURRENT=33
LT_AGE=29
LT_REVISION=0
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
@ -166,7 +162,6 @@ AC_SUBST(THREAD_LIBS)
TARGET_SHIZZLE
AC_SUBST(ARCH)
AC_SUBST(LIBBURNIA_PKGCONFDIR)
AC_SUBST(LIBBURN_ARCH_LIBS)
dnl ts A90303
@ -198,13 +193,6 @@ else
CFLAGS="$CFLAGS -DDEBUG"
fi
dnl Determine target directory for libburn-*.pc
dnl Important: Must be performed _after_ TARGET_SHIZZLE
dnl
LIBBURNIA_SET_PKGCONFIG
AC_CONFIG_FILES([
Makefile
doc/doxygen.conf

File diff suppressed because it is too large Load Diff

View File

@ -559,7 +559,7 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
}
/* ts A61007 : obsolete Assert in spc_select_write_params() */
if (d->drive_role == 1 && d->mdata->valid <= 0) {
if (d->drive_role == 1 && !d->mdata->valid) {
libdax_msgs_submit(libdax_messenger,
d->global_index, 0x00020113,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,

View File

@ -40,9 +40,6 @@
/* A70903 : for burn_scsi_setup_drive() */
#include "spc.h"
/* A90815 : for mmc_obtain_profile_name() */
#include "mmc.h"
#include "libdax_msgs.h"
extern struct libdax_msgs *libdax_messenger;
@ -235,7 +232,7 @@ int burn_drive_inquire_media(struct burn_drive *d)
/* ts A61020 : d->status was set to BURN_DISC_BLANK as pure guess */
/* ts A71128 : run read_disc_info() for any recognizeable profile */
if (d->current_profile > 0 || d->current_is_guessed_profile ||
if (d->current_profile > 0 ||
d->mdata->cdr_write || d->mdata->cdrw_write ||
d->mdata->dvdr_write || d->mdata->dvdram_write) {
@ -421,9 +418,6 @@ int burn_drive_unregister(struct burn_drive *d)
struct burn_drive *burn_drive_finish_enum(struct burn_drive *d)
{
struct burn_drive *t;
char msg[BURN_DRIVE_ADR_LEN + 160];
int ret;
/* ts A60821
<<< debug: for tracing calls which might use open drive fds */
int mmc_function_spy(struct burn_drive *d, char * text);
@ -436,19 +430,13 @@ struct burn_drive *burn_drive_finish_enum(struct burn_drive *d)
mmc_function_spy(NULL, "enumerate_common : -------- doing grab");
/* try to get the drive info */
ret = t->grab(t);
if (ret) {
if (t->grab(t)) {
burn_print(2, "getting drive info\n");
t->getcaps(t);
t->unlock(t);
t->released = 1;
} else {
/* ts A90602 */
d->mdata->valid = -1;
sprintf(msg, "Unable to grab scanned drive %s", d->devname);
libdax_msgs_submit(libdax_messenger, d->global_index,
0x0002016f, LIBDAX_MSGS_SEV_DEBUG,
LIBDAX_MSGS_PRIO_LOW, msg, 0, 0);
burn_print(2, "unable to grab new located drive\n");
burn_drive_unregister(t);
t = NULL;
}
@ -521,7 +509,6 @@ int burn_drive_release_fl(struct burn_drive *d, int flag)
d->unlock(d);
if ((flag & 7) == 1)
d->eject(d);
burn_drive_snooze(d, 0);
d->release(d);
}
@ -534,22 +521,6 @@ int burn_drive_release_fl(struct burn_drive *d, int flag)
}
/* API */
/* ts A90824
@param flag bit0= wake up (else start snoozing)
*/
int burn_drive_snooze(struct burn_drive *d, int flag)
{
if (d->drive_role != 1)
return 0;
if (flag & 1)
d->start_unit(d);
else
d->stop_unit(d);
return 1;
}
/* API */
void burn_drive_release(struct burn_drive *d, int le)
{
@ -884,7 +855,7 @@ static int drive_getcaps(struct burn_drive *d, struct burn_drive_info *out)
a ssert(d->mdata);
#endif
if(d->idata->valid <= 0 || d->mdata->valid <= 0)
if (!d->idata->valid || !d->mdata->valid)
return 0;
id = (struct burn_scsi_inquiry_data *)d->idata;
@ -950,7 +921,7 @@ int burn_drive_scan_sync(struct burn_drive_info *drives[],
*/
unsigned char scanned[32];
unsigned count = 0;
int i, ret;
int i;
/* ts A61007 : moved up to burn_drive_scan() */
/* a ssert(burn_running); */
@ -1007,22 +978,13 @@ int burn_drive_scan_sync(struct burn_drive_info *drives[],
if (drive_array[i].global_index < 0)
continue; /* invalid device */
/* ts A90602 : This old loop is not plausible. See A70907.
while (!drive_getcaps(&drive_array[i],
&(*drives)[*n_drives])) {
while (!drive_getcaps(&drive_array[i],
&(*drives)[*n_drives])) {
sleep(1);
}
*/
/* ts A90602 : A single call shall do (rather than a loop) */
ret = drive_getcaps(&drive_array[i], &(*drives)[*n_drives]);
if (ret > 0)
(*n_drives)++;
}
(*n_drives)++;
scanned[i / 8] |= 1 << (i % 8);
}
if (*drives != NULL && *n_drives == 0) {
free ((char *) *drives);
*drives = NULL;
}
return(1);
}
@ -1178,14 +1140,14 @@ void burn_sectors_to_msf(int sectors, int *m, int *s, int *f)
int burn_drive_get_read_speed(struct burn_drive *d)
{
if(d->mdata->valid <= 0)
if(!d->mdata->valid)
return 0;
return d->mdata->max_read_speed;
}
int burn_drive_get_write_speed(struct burn_drive *d)
{
if(d->mdata->valid <= 0)
if(!d->mdata->valid)
return 0;
return d->mdata->max_write_speed;
}
@ -1193,7 +1155,7 @@ int burn_drive_get_write_speed(struct burn_drive *d)
/* ts A61021 : New API function */
int burn_drive_get_min_write_speed(struct burn_drive *d)
{
if(d->mdata->valid <= 0)
if(!d->mdata->valid)
return 0;
return d->mdata->min_write_speed;
}
@ -1280,7 +1242,6 @@ int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname)
int ret = -1, fd = -1, role = 0;
/* divided by 512 it needs to fit into a signed long integer */
off_t size = ((off_t) (512 * 1024 * 1024 - 1) * (off_t) 2048);
off_t read_size = -1;
struct burn_drive *d= NULL, *regd_d;
struct stat stbuf;
@ -1293,16 +1254,6 @@ int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname)
ret = fstat(fd, &stbuf);
else
ret = stat(fname, &stbuf);
if (ret != -1) {
if (S_ISREG(stbuf.st_mode))
read_size = stbuf.st_size;
else if (S_ISBLK(stbuf.st_mode)) {
ret = burn_os_stdio_capacity(fname,
&read_size);
if (ret <= 0)
read_size = -1;
}
}
if (ret == -1 || S_ISBLK(stbuf.st_mode) ||
S_ISREG(stbuf.st_mode)) {
ret = burn_os_stdio_capacity(fname, &size);
@ -1361,10 +1312,6 @@ int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname)
d->current_is_supported_profile = 1;
d->block_types[BURN_WRITE_TAO] = BURN_BLOCK_MODE1;
d->block_types[BURN_WRITE_SAO] = BURN_BLOCK_SAO;
if (read_size >= 0)
/* despite its name : last valid address, not size */
d->media_read_capacity =
read_size / 2048 - !(read_size % 2048);
burn_drive_set_media_capacity_remaining(d, size);
/* >>> ? open file for a test ? (>>> beware of "-" = stdin) */;
@ -1795,10 +1742,6 @@ int burn_abort(int patience,
unsigned long wait_grain= 100000;
time_t start_time, current_time, pacifier_time, end_time;
#ifndef NIX
time_t stdio_patience = 3;
#endif
current_time = start_time = pacifier_time = time(0);
end_time = start_time + patience;
@ -1815,35 +1758,15 @@ int burn_abort(int patience,
if(occup == -2)
continue;
if(drive_array[i].drive_role != 1) {
#ifdef NIX
/* ts A90302
<<< this causes a race condition with drive
usage and drive disposal.
*/
/* <<< this causes a race condition with drive usage
and drive disposal
*/
if(drive_array[i].drive_role != 1) {
drive_array[i].busy = BURN_DRIVE_IDLE;
burn_drive_forget(&(drive_array[i]), 1);
continue;
#else /* NIX */
/* ts A90318
>>> but if a pipe breaks then the drive
never gets idle.
So for now with a short patience timespan
and eventually a deliberate memory leak.
*/
if (current_time - start_time >
stdio_patience) {
drive_array[i].global_index = -1;
continue;
}
#endif /* ! NIX */
}
} else
#endif /* NIX */
if(occup <= 10) {
burn_drive_forget(&(drive_array[i]), 1);
@ -1924,16 +1847,11 @@ int burn_disc_read_atip(struct burn_drive *d)
}
if(d->drive_role != 1)
return 0;
if ((d->current_profile == -1 || d->current_is_cd_profile)
&& (d->mdata->cdrw_write || d->current_profile != 0x08)) {
if (d->current_profile == -1 || d->current_is_cd_profile) {
d->read_atip(d);
/* >>> some control of success would be nice :) */
} else {
/* mmc5r03c.pdf 6.26.3.6.3 : ATIP is undefined for non-CD
(and it seems meaningless for non-burners).
ts A90823: Pseudo-CD U3 memory stick stalls with ATIP.
It is !cdrw_write and profile is 0x08.
*/
/* mmc5r03c.pdf 6.26.3.6.3 : ATIP is undefined for non-CD */;
return 0;
}
return 1;
@ -2041,30 +1959,6 @@ int burn_disc_get_profile(struct burn_drive *d, int *pno, char name[80])
}
/* ts A90815 : New API function */
int burn_drive_get_all_profiles(struct burn_drive *d, int *num_profiles,
int profiles[64], char is_current[64])
{
int i;
*num_profiles = d->num_profiles;
for (i = 0; i < d->num_profiles; i++) {
profiles[i] = (d->all_profiles[i * 4] << 8) |
d->all_profiles[i * 4 + 1];
is_current[i] = d->all_profiles[i * 4 + 2] & 1;
}
return 1;
}
/* ts A90815 : New API function */
int burn_obtain_profile_name(int profile_number, char name[80])
{
strcpy(name, mmc_obtain_profile_name(profile_number));
return(name[0] != 0);
}
/* ts A61223 : New API function */
int burn_drive_wrote_well(struct burn_drive *d)
{
@ -2164,7 +2058,7 @@ int burn_drive_get_speedlist(struct burn_drive *d,
struct burn_speed_descriptor *sd, *csd = NULL;
(*speed_list) = NULL;
if(d->mdata->valid <= 0)
if(!d->mdata->valid)
return 0;
for (sd = d->mdata->speed_descriptors; sd != NULL; sd = sd->next) {
ret = burn_speed_descriptor_new(&csd, NULL, csd, 0);
@ -2189,7 +2083,7 @@ int burn_drive_get_best_speed(struct burn_drive *d, int speed_goal,
if (speed_goal < 0)
best_speed = 2000000000;
*best_descr = NULL;
if(d->mdata->valid <= 0)
if(!d->mdata->valid)
return 0;
for (sd = d->mdata->speed_descriptors; sd != NULL; sd = sd->next) {
if (flag & 1)
@ -2637,58 +2531,7 @@ int burn_drive_set_media_capacity_remaining(struct burn_drive *d, off_t value)
/* ts A81215 : API */
int burn_get_read_capacity(struct burn_drive *d, int *capacity, int flag)
{
*capacity = d->media_read_capacity + 1;
*capacity = d->media_read_capacity;
return (d->media_read_capacity != 0x7fffffff);
}
/* ts A90903 : API */
int burn_disc_get_media_id(struct burn_drive *d,
char **product_id, char **media_code1, char **media_code2,
char **book_type, int flag)
{
int ret;
*product_id = *media_code1 = *media_code2 = *book_type = NULL;
if (burn_drive_get_drive_role(d) != 1)
return 0;
ret = mmc_get_media_product_id(d,
product_id, media_code1, media_code2, book_type,
flag & 1);
return ret;
}
/* ts A90909 : API */
/**
@param valid Replies bits which indicate the validity of other reply
parameters or the state of certain CD info bits:
bit0= disc_type valid
bit1= disc_id valid
bit2= bar_code valid
bit3= disc_app_code valid
bit4= Disc is unrestricted (URU bit)
bit5= Disc is nominally erasable (Erasable bit)
This will be set with overwriteable media which
libburn normally considers to be unerasable blank.
*/
int burn_disc_get_cd_info(struct burn_drive *d, char disc_type[80],
unsigned int *disc_id, char bar_code[9], int *app_code,
int *valid)
{
if (d->disc_type == 0x00) {
strcpy(disc_type, "CD-DA or CD-ROM");
} else if (d->disc_type == 0x10) {
strcpy(disc_type, "CD-I");
} else if (d->disc_type == 0x20) {
strcpy(disc_type, "CD-ROM XA");
} else {
strcpy(disc_type, "undefined");
}
*disc_id = d->disc_id;
memcpy(bar_code, d->disc_bar_code, 8);
bar_code[9]= 0;
*app_code = d->disc_app_code;
*valid = d->disc_info_valid;
return 1;
}

451
libburn/lec.c Normal file
View File

@ -0,0 +1,451 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* borrowed HEAVILY from cdrdao */
#include <string.h>
#include "lec.h"
#define LEC_HEADER_OFFSET 12
#define LEC_MODE1_P_PARITY_OFFSET 2076
#define LEC_MODE1_Q_PARITY_OFFSET 2248
static unsigned char gf8_ilog[255] = {
1, 2, 4, 8, 16, 32, 64, 128, 29, 58, 116, 232, 205, 135, 19, 38, 76,
152, 45, 90, 180, 117, 234, 201, 143, 3, 6, 12, 24, 48, 96,
192, 157, 39, 78, 156, 37, 74, 148, 53, 106, 212, 181, 119,
238, 193, 159, 35, 70, 140, 5, 10, 20, 40, 80, 160, 93, 186,
105, 210, 185, 111, 222, 161, 95, 190, 97, 194, 153, 47, 94,
188, 101, 202, 137, 15, 30, 60, 120, 240, 253, 231, 211, 187,
107, 214, 177, 127, 254, 225, 223, 163, 91, 182, 113, 226, 217,
175, 67, 134, 17, 34, 68, 136, 13, 26, 52, 104, 208, 189, 103,
206, 129, 31, 62, 124, 248, 237, 199, 147, 59, 118, 236, 197,
151, 51, 102, 204, 133, 23, 46, 92, 184, 109, 218, 169, 79,
158, 33, 66, 132, 21, 42, 84, 168, 77, 154, 41, 82, 164, 85,
170, 73, 146, 57, 114, 228, 213, 183, 115, 230, 209, 191, 99,
198, 145, 63, 126, 252, 229, 215, 179, 123, 246, 241, 255, 227,
219, 171, 75, 150, 49, 98, 196, 149, 55, 110, 220, 165, 87,
174, 65, 130, 25, 50, 100, 200, 141, 7, 14, 28, 56, 112, 224,
221, 167, 83, 166, 81, 162, 89, 178, 121, 242, 249, 239, 195,
155, 43, 86, 172, 69, 138, 9, 18, 36, 72, 144, 61, 122, 244,
245, 247, 243, 251, 235, 203, 139, 11, 22, 44, 88, 176, 125,
250, 233, 207, 131, 27, 54, 108, 216, 173, 71, 142,
};
static unsigned char gf8_log[256] = {
0, 0, 1, 25, 2, 50, 26, 198, 3, 223, 51, 238, 27, 104, 199, 75, 4, 100,
224, 14, 52, 141, 239, 129, 28, 193, 105, 248, 200, 8, 76, 113,
5, 138, 101, 47, 225, 36, 15, 33, 53, 147, 142, 218, 240, 18,
130, 69, 29, 181, 194, 125, 106, 39, 249, 185, 201, 154, 9,
120, 77, 228, 114, 166, 6, 191, 139, 98, 102, 221, 48, 253,
226, 152, 37, 179, 16, 145, 34, 136, 54, 208, 148, 206, 143,
150, 219, 189, 241, 210, 19, 92, 131, 56, 70, 64, 30, 66, 182,
163, 195, 72, 126, 110, 107, 58, 40, 84, 250, 133, 186, 61,
202, 94, 155, 159, 10, 21, 121, 43, 78, 212, 229, 172, 115,
243, 167, 87, 7, 112, 192, 247, 140, 128, 99, 13, 103, 74, 222,
237, 49, 197, 254, 24, 227, 165, 153, 119, 38, 184, 180, 124,
17, 68, 146, 217, 35, 32, 137, 46, 55, 63, 209, 91, 149, 188,
207, 205, 144, 135, 151, 178, 220, 252, 190, 97, 242, 86, 211,
171, 20, 42, 93, 158, 132, 60, 57, 83, 71, 109, 65, 162, 31,
45, 67, 216, 183, 123, 164, 118, 196, 23, 73, 236, 127, 12,
111, 246, 108, 161, 59, 82, 41, 157, 85, 170, 251, 96, 134,
177, 187, 204, 62, 90, 203, 89, 95, 176, 156, 169, 160, 81, 11,
245, 22, 235, 122, 117, 44, 215, 79, 174, 213, 233, 230, 231,
173, 232, 116, 214, 244, 234, 168, 80, 88, 175,
};
static unsigned char gf8_q_coeffs[2][45] = {
{97, 251, 133, 60, 82, 160, 155, 201, 8, 112, 246, 11, 21, 42, 157,
169, 80, 174, 232, 230, 172, 211, 241, 18, 68, 216, 44, 121, 9, 200,
75, 103, 221, 252, 96, 176, 88, 167, 114, 76, 199, 26, 1, 0, 0},
{190, 96, 250, 132, 59, 81, 159, 154, 200, 7, 111, 245, 10, 20, 41,
156, 168, 79, 173, 231, 229, 171, 210, 240, 17, 67, 215, 43, 120, 8,
199, 74, 102, 220, 251, 95, 175, 87, 166, 113, 75, 198, 25, 0, 0}
};
static unsigned char gf8_p_coeffs[2][26] = {
{230, 172, 211, 241, 18, 68, 216, 44, 121, 9, 200, 75, 103, 221, 252,
96, 176, 88, 167, 114, 76, 199, 26, 1, 0, 0},
{231, 229, 171, 210, 240, 17, 67, 215, 43, 120, 8, 199, 74, 102, 220,
251, 95, 175, 87, 166, 113, 75, 198, 25, 0, 0}
};
static unsigned char yellowbook_scrambler[2340] = {
1, 128, 0, 96, 0, 40, 0, 30, 128, 8, 96, 6, 168, 2, 254, 129, 128, 96,
96, 40, 40, 30, 158,
136, 104, 102, 174, 170, 252, 127, 1, 224, 0, 72, 0, 54, 128, 22, 224,
14, 200, 4, 86, 131, 126, 225,
224, 72, 72, 54, 182, 150, 246, 238, 198, 204, 82, 213, 253, 159, 1,
168, 0, 126, 128, 32, 96, 24, 40,
10, 158, 135, 40, 98, 158, 169, 168, 126, 254, 160, 64, 120, 48, 34,
148, 25, 175, 74, 252, 55, 1, 214,
128, 94, 224, 56, 72, 18, 182, 141, 182, 229, 182, 203, 54, 215, 86,
222, 190, 216, 112, 90, 164, 59, 59,
83, 83, 125, 253, 225, 129, 136, 96, 102, 168, 42, 254, 159, 0, 104, 0,
46, 128, 28, 96, 9, 232, 6,
206, 130, 212, 97, 159, 104, 104, 46, 174, 156, 124, 105, 225, 238,
200, 76, 86, 181, 254, 247, 0, 70, 128,
50, 224, 21, 136, 15, 38, 132, 26, 227, 75, 9, 247, 70, 198, 178, 210,
245, 157, 135, 41, 162, 158, 249,
168, 66, 254, 177, 128, 116, 96, 39, 104, 26, 174, 139, 60, 103, 81,
234, 188, 79, 49, 244, 20, 71, 79,
114, 180, 37, 183, 91, 54, 187, 86, 243, 126, 197, 224, 83, 8, 61, 198,
145, 146, 236, 109, 141, 237, 165,
141, 187, 37, 179, 91, 53, 251, 87, 3, 126, 129, 224, 96, 72, 40, 54,
158, 150, 232, 110, 206, 172, 84,
125, 255, 97, 128, 40, 96, 30, 168, 8, 126, 134, 160, 98, 248, 41, 130,
158, 225, 168, 72, 126, 182, 160,
118, 248, 38, 194, 154, 209, 171, 28, 127, 73, 224, 54, 200, 22, 214,
142, 222, 228, 88, 75, 122, 183, 99,
54, 169, 214, 254, 222, 192, 88, 80, 58, 188, 19, 49, 205, 212, 85,
159, 127, 40, 32, 30, 152, 8, 106,
134, 175, 34, 252, 25, 129, 202, 224, 87, 8, 62, 134, 144, 98, 236, 41,
141, 222, 229, 152, 75, 42, 183,
95, 54, 184, 22, 242, 142, 197, 164, 83, 59, 125, 211, 97, 157, 232,
105, 142, 174, 228, 124, 75, 97, 247,
104, 70, 174, 178, 252, 117, 129, 231, 32, 74, 152, 55, 42, 150, 159,
46, 232, 28, 78, 137, 244, 102, 199,
106, 210, 175, 29, 188, 9, 177, 198, 244, 82, 199, 125, 146, 161, 173,
184, 125, 178, 161, 181, 184, 119, 50,
166, 149, 186, 239, 51, 12, 21, 197, 207, 19, 20, 13, 207, 69, 148, 51,
47, 85, 220, 63, 25, 208, 10,
220, 7, 25, 194, 138, 209, 167, 28, 122, 137, 227, 38, 201, 218, 214,
219, 30, 219, 72, 91, 118, 187, 102,
243, 106, 197, 239, 19, 12, 13, 197, 197, 147, 19, 45, 205, 221, 149,
153, 175, 42, 252, 31, 1, 200, 0,
86, 128, 62, 224, 16, 72, 12, 54, 133, 214, 227, 30, 201, 200, 86, 214,
190, 222, 240, 88, 68, 58, 179,
83, 53, 253, 215, 1, 158, 128, 104, 96, 46, 168, 28, 126, 137, 224,
102, 200, 42, 214, 159, 30, 232, 8,
78, 134, 180, 98, 247, 105, 134, 174, 226, 252, 73, 129, 246, 224, 70,
200, 50, 214, 149, 158, 239, 40, 76,
30, 181, 200, 119, 22, 166, 142, 250, 228, 67, 11, 113, 199, 100, 82,
171, 125, 191, 97, 176, 40, 116, 30,
167, 72, 122, 182, 163, 54, 249, 214, 194, 222, 209, 152, 92, 106, 185,
239, 50, 204, 21, 149, 207, 47, 20,
28, 15, 73, 196, 54, 211, 86, 221, 254, 217, 128, 90, 224, 59, 8, 19,
70, 141, 242, 229, 133, 139, 35,
39, 89, 218, 186, 219, 51, 27, 85, 203, 127, 23, 96, 14, 168, 4, 126,
131, 96, 97, 232, 40, 78, 158,
180, 104, 119, 110, 166, 172, 122, 253, 227, 1, 137, 192, 102, 208, 42,
220, 31, 25, 200, 10, 214, 135, 30,
226, 136, 73, 166, 182, 250, 246, 195, 6, 209, 194, 220, 81, 153, 252,
106, 193, 239, 16, 76, 12, 53, 197,
215, 19, 30, 141, 200, 101, 150, 171, 46, 255, 92, 64, 57, 240, 18,
196, 13, 147, 69, 173, 243, 61, 133,
209, 163, 28, 121, 201, 226, 214, 201, 158, 214, 232, 94, 206, 184, 84,
114, 191, 101, 176, 43, 52, 31, 87,
72, 62, 182, 144, 118, 236, 38, 205, 218, 213, 155, 31, 43, 72, 31,
118, 136, 38, 230, 154, 202, 235, 23,
15, 78, 132, 52, 99, 87, 105, 254, 174, 192, 124, 80, 33, 252, 24, 65,
202, 176, 87, 52, 62, 151, 80,
110, 188, 44, 113, 221, 228, 89, 139, 122, 231, 99, 10, 169, 199, 62,
210, 144, 93, 172, 57, 189, 210, 241,
157, 132, 105, 163, 110, 249, 236, 66, 205, 241, 149, 132, 111, 35,
108, 25, 237, 202, 205, 151, 21, 174, 143,
60, 100, 17, 235, 76, 79, 117, 244, 39, 7, 90, 130, 187, 33, 179, 88,
117, 250, 167, 3, 58, 129, 211,
32, 93, 216, 57, 154, 146, 235, 45, 143, 93, 164, 57, 187, 82, 243,
125, 133, 225, 163, 8, 121, 198, 162,
210, 249, 157, 130, 233, 161, 142, 248, 100, 66, 171, 113, 191, 100,
112, 43, 100, 31, 107, 72, 47, 118, 156,
38, 233, 218, 206, 219, 20, 91, 79, 123, 116, 35, 103, 89, 234, 186,
207, 51, 20, 21, 207, 79, 20, 52,
15, 87, 68, 62, 179, 80, 117, 252, 39, 1, 218, 128, 91, 32, 59, 88, 19,
122, 141, 227, 37, 137, 219,
38, 219, 90, 219, 123, 27, 99, 75, 105, 247, 110, 198, 172, 82, 253,
253, 129, 129, 160, 96, 120, 40, 34,
158, 153, 168, 106, 254, 175, 0, 124, 0, 33, 192, 24, 80, 10, 188, 7,
49, 194, 148, 81, 175, 124, 124,
33, 225, 216, 72, 90, 182, 187, 54, 243, 86, 197, 254, 211, 0, 93, 192,
57, 144, 18, 236, 13, 141, 197,
165, 147, 59, 45, 211, 93, 157, 249, 169, 130, 254, 225, 128, 72, 96,
54, 168, 22, 254, 142, 192, 100, 80,
43, 124, 31, 97, 200, 40, 86, 158, 190, 232, 112, 78, 164, 52, 123, 87,
99, 126, 169, 224, 126, 200, 32,
86, 152, 62, 234, 144, 79, 44, 52, 29, 215, 73, 158, 182, 232, 118,
206, 166, 212, 122, 223, 99, 24, 41,
202, 158, 215, 40, 94, 158, 184, 104, 114, 174, 165, 188, 123, 49, 227,
84, 73, 255, 118, 192, 38, 208, 26,
220, 11, 25, 199, 74, 210, 183, 29, 182, 137, 182, 230, 246, 202, 198,
215, 18, 222, 141, 152, 101, 170, 171,
63, 63, 80, 16, 60, 12, 17, 197, 204, 83, 21, 253, 207, 1, 148, 0, 111,
64, 44, 48, 29, 212, 9,
159, 70, 232, 50, 206, 149, 148, 111, 47, 108, 28, 45, 201, 221, 150,
217, 174, 218, 252, 91, 1, 251, 64,
67, 112, 49, 228, 20, 75, 79, 119, 116, 38, 167, 90, 250, 187, 3, 51,
65, 213, 240, 95, 4, 56, 3,
82, 129, 253, 160, 65, 184, 48, 114, 148, 37, 175, 91, 60, 59, 81, 211,
124, 93, 225, 249, 136, 66, 230,
177, 138, 244, 103, 7, 106, 130, 175, 33, 188, 24, 113, 202, 164, 87,
59, 126, 147, 96, 109, 232, 45, 142,
157, 164, 105, 187, 110, 243, 108, 69, 237, 243, 13, 133, 197, 163, 19,
57, 205, 210, 213, 157, 159, 41, 168,
30, 254, 136, 64, 102, 176, 42, 244, 31, 7, 72, 2, 182, 129, 182, 224,
118, 200, 38, 214, 154, 222, 235,
24, 79, 74, 180, 55, 55, 86, 150, 190, 238, 240, 76, 68, 53, 243, 87,
5, 254, 131, 0, 97, 192, 40,
80, 30, 188, 8, 113, 198, 164, 82, 251, 125, 131, 97, 161, 232, 120,
78, 162, 180, 121, 183, 98, 246, 169,
134, 254, 226, 192, 73, 144, 54, 236, 22, 205, 206, 213, 148, 95, 47,
120, 28, 34, 137, 217, 166, 218, 250,
219, 3, 27, 65, 203, 112, 87, 100, 62, 171, 80, 127, 124, 32, 33, 216,
24, 90, 138, 187, 39, 51, 90,
149, 251, 47, 3, 92, 1, 249, 192, 66, 208, 49, 156, 20, 105, 207, 110,
212, 44, 95, 93, 248, 57, 130,
146, 225, 173, 136, 125, 166, 161, 186, 248, 115, 2, 165, 193, 187, 16,
115, 76, 37, 245, 219, 7, 27, 66,
139, 113, 167, 100, 122, 171, 99, 63, 105, 208, 46, 220, 28, 89, 201,
250, 214, 195, 30, 209, 200, 92, 86,
185, 254, 242, 192, 69, 144, 51, 44, 21, 221, 207, 25, 148, 10, 239,
71, 12, 50, 133, 213, 163, 31, 57,
200, 18, 214, 141, 158, 229, 168, 75, 62, 183, 80, 118, 188, 38, 241,
218, 196, 91, 19, 123, 77, 227, 117,
137, 231, 38, 202, 154, 215, 43, 30, 159, 72, 104, 54, 174, 150, 252,
110, 193, 236, 80, 77, 252, 53, 129,
215, 32, 94, 152, 56, 106, 146, 175, 45, 188, 29, 177, 201, 180, 86,
247, 126, 198, 160, 82, 248, 61, 130,
145, 161, 172, 120, 125, 226, 161, 137, 184, 102, 242, 170, 197, 191,
19, 48, 13, 212, 5, 159, 67, 40, 49,
222, 148, 88, 111, 122, 172, 35, 61, 217, 209, 154, 220, 107, 25, 239,
74, 204, 55, 21, 214, 143, 30, 228,
8, 75, 70, 183, 114, 246, 165, 134, 251, 34, 195, 89, 145, 250, 236,
67, 13, 241, 197, 132, 83, 35, 125,
217, 225, 154, 200, 107, 22, 175, 78, 252, 52, 65, 215, 112, 94, 164,
56, 123, 82, 163, 125, 185, 225, 178,
200, 117, 150, 167, 46, 250, 156, 67, 41, 241, 222, 196, 88, 83, 122,
189, 227, 49, 137, 212, 102, 223, 106,
216, 47, 26, 156, 11, 41, 199, 94, 210, 184, 93, 178, 185, 181, 178,
247, 53, 134, 151, 34, 238, 153, 140,
106, 229, 239, 11, 12, 7, 69, 194, 179, 17, 181, 204, 119, 21, 230,
143, 10, 228, 7, 11, 66, 135, 113,
162, 164, 121, 187, 98, 243, 105, 133, 238, 227, 12, 73, 197, 246, 211,
6, 221, 194, 217, 145, 154, 236, 107,
13, 239, 69, 140, 51, 37, 213, 219, 31, 27, 72, 11, 118, 135, 102, 226,
170, 201, 191, 22, 240, 14, 196,
4, 83, 67, 125, 241, 225, 132, 72, 99, 118, 169, 230, 254, 202, 192,
87, 16, 62, 140, 16, 101, 204, 43,
21, 223, 79, 24, 52, 10, 151, 71, 46, 178, 156, 117, 169, 231, 62, 202,
144, 87, 44, 62, 157, 208, 105,
156, 46, 233, 220, 78, 217, 244, 90, 199, 123, 18, 163, 77, 185, 245,
178, 199, 53, 146, 151, 45, 174, 157,
188, 105, 177, 238, 244, 76, 71, 117, 242, 167, 5, 186, 131, 51, 33,
213, 216, 95, 26, 184, 11, 50, 135,
85, 162, 191, 57, 176, 18, 244, 13, 135, 69, 162, 179, 57, 181, 210,
247, 29, 134, 137, 162, 230, 249, 138,
194, 231, 17, 138, 140, 103, 37, 234, 155, 15, 43, 68, 31, 115, 72, 37,
246, 155, 6, 235, 66, 207, 113,
148, 36, 111, 91, 108, 59, 109, 211, 109, 157, 237, 169, 141, 190, 229,
176, 75, 52, 55, 87, 86, 190, 190,
240, 112, 68, 36, 51, 91, 85, 251, 127, 3, 96, 1, 232, 0, 78, 128, 52,
96, 23, 104, 14, 174, 132,
124, 99, 97, 233, 232, 78, 206, 180, 84, 119, 127, 102, 160, 42, 248,
31, 2, 136, 1, 166, 128, 122, 224,
35, 8, 25, 198, 138, 210, 231, 29, 138, 137, 167, 38, 250, 154, 195,
43, 17, 223, 76, 88, 53, 250, 151,
3, 46, 129, 220, 96, 89, 232, 58, 206, 147, 20, 109, 207, 109, 148, 45,
175, 93, 188, 57, 177, 210, 244,
93, 135, 121, 162, 162, 249, 185, 130, 242, 225, 133, 136, 99, 38, 169,
218, 254, 219, 0, 91, 64, 59, 112,
19, 100, 13, 235, 69, 143, 115, 36, 37, 219, 91, 27, 123, 75, 99, 119,
105, 230, 174, 202, 252, 87, 1,
254, 128, 64, 96, 48, 40, 20, 30, 143, 72, 100, 54, 171, 86, 255, 126,
192, 32, 80, 24, 60, 10, 145,
199, 44, 82, 157, 253, 169, 129, 190, 224, 112, 72, 36, 54, 155, 86,
235, 126, 207, 96, 84, 40, 63, 94,
144, 56, 108, 18, 173, 205, 189, 149, 177, 175, 52, 124, 23, 97, 206,
168, 84, 126, 191, 96, 112, 40, 36,
30, 155, 72, 107, 118, 175, 102, 252, 42, 193, 223, 16, 88, 12, 58,
133, 211, 35, 29, 217, 201, 154, 214,
235, 30, 207, 72, 84, 54, 191, 86, 240, 62, 196, 16, 83, 76, 61, 245,
209, 135, 28, 98, 137, 233, 166,
206, 250, 212, 67, 31, 113, 200, 36, 86, 155, 126, 235, 96, 79, 104,
52, 46, 151, 92, 110, 185, 236, 114,
205, 229, 149, 139, 47, 39, 92, 26, 185, 203, 50, 215, 85, 158, 191,
40, 112, 30, 164, 8, 123, 70, 163,
114, 249, 229, 130, 203, 33, 151, 88, 110, 186, 172, 115, 61, 229, 209,
139, 28, 103, 73, 234, 182, 207, 54,
212, 22, 223, 78, 216, 52, 90, 151, 123, 46, 163, 92, 121, 249, 226,
194, 201, 145, 150, 236, 110, 205, 236,
85, 141, 255, 37, 128, 27, 32, 11, 88, 7, 122, 130, 163, 33, 185, 216,
114, 218, 165, 155, 59, 43, 83,
95, 125, 248, 33, 130, 152, 97, 170, 168, 127, 62, 160, 16, 120, 12,
34, 133, 217, 163, 26, 249, 203, 2,
215, 65, 158, 176, 104, 116, 46, 167, 92, 122, 185, 227, 50, 201, 213,
150, 223, 46, 216, 28, 90, 137, 251,
38, 195, 90, 209, 251, 28, 67, 73, 241, 246, 196, 70, 211, 114, 221,
229, 153,
};
void scramble(unsigned char *inout)
{
unsigned char *r = inout + 12;
unsigned char *s = yellowbook_scrambler;
unsigned int i;
for (i = 2340; i; i--) {
*r++ ^= *s++;
}
}
/* Calculate the P parities for the sector.
* The 43 P vectors of length 24 are combined with the GF8_P_COEFFS.
*/
void parity_p(unsigned char *sector)
{
int i, j;
unsigned char p0_msb, p1_msb;
unsigned char p0_lsb, p1_lsb;
unsigned char *p_msb_start, *p_lsb_start;
unsigned char *p_msb, *p_lsb;
unsigned char *coeffs0, *coeffs1;
unsigned char *p0, *p1;
unsigned char d;
unsigned short c;
p_lsb_start = sector + LEC_HEADER_OFFSET;
p_msb_start = sector + LEC_HEADER_OFFSET + 1;
p1 = sector + LEC_MODE1_P_PARITY_OFFSET;
p0 = sector + LEC_MODE1_P_PARITY_OFFSET + 2 * 43;
for (i = 0; i <= 42; i++) {
p_lsb = p_lsb_start;
p_msb = p_msb_start;
coeffs0 = gf8_p_coeffs[0];
coeffs1 = gf8_p_coeffs[1];
p0_lsb = p1_lsb = p0_msb = p1_msb = 0;
for (j = 0; j <= 23; j++) {
d = *p_lsb;
if (d != 0) {
c = gf8_log[d] + *coeffs0;
if (c >= 255)
c -= 255;
p0_lsb ^= gf8_ilog[c];
c = gf8_log[d] + *coeffs1;
if (c >= 255)
c -= 255;
p1_lsb ^= gf8_ilog[c];
}
d = *p_msb;
if (d != 0) {
c = gf8_log[d] + *coeffs0;
if (c >= 255)
c -= 255;
p0_msb ^= gf8_ilog[c];
c = gf8_log[d] + *coeffs1;
if (c >= 255)
c -= 255;
p1_msb ^= gf8_ilog[c];
}
coeffs0++;
coeffs1++;
p_lsb += 2 * 43;
p_msb += 2 * 43;
}
*p0 = p0_lsb;
*(p0 + 1) = p0_msb;
*p1 = p1_lsb;
*(p1 + 1) = p1_msb;
p0 += 2;
p1 += 2;
p_lsb_start += 2;
p_msb_start += 2;
}
}
/* Calculate the Q parities for the sector.
* The 26 Q vectors of length 43 are combined with the GF8_Q_COEFFS.
*/
void parity_q(unsigned char *sector)
{
int i, j;
unsigned char q0_msb, q1_msb;
unsigned char q0_lsb, q1_lsb;
unsigned char *q_msb_start, *q_lsb_start;
unsigned char *q_msb, *q_lsb;
unsigned char *coeffs0, *coeffs1;
unsigned char *q0, *q1, *q_start;
unsigned char d;
unsigned short c;
q_lsb_start = sector + LEC_HEADER_OFFSET;
q_msb_start = sector + LEC_HEADER_OFFSET + 1;
q_start = sector + LEC_MODE1_Q_PARITY_OFFSET;
q1 = sector + LEC_MODE1_Q_PARITY_OFFSET;
q0 = sector + LEC_MODE1_Q_PARITY_OFFSET + 2 * 26;
for (i = 0; i <= 25; i++) {
q_lsb = q_lsb_start;
q_msb = q_msb_start;
coeffs0 = gf8_q_coeffs[0];
coeffs1 = gf8_q_coeffs[1];
q0_lsb = q1_lsb = q0_msb = q1_msb = 0;
for (j = 0; j <= 42; j++) {
d = *q_lsb;
if (d != 0) {
c = gf8_log[d] + *coeffs0;
if (c >= 255)
c -= 255;
q0_lsb ^= gf8_ilog[c];
c = gf8_log[d] + *coeffs1;
if (c >= 255)
c -= 255;
q1_lsb ^= gf8_ilog[c];
}
d = *q_msb;
if (d != 0) {
c = gf8_log[d] + *coeffs0;
if (c >= 255)
c -= 255;
q0_msb ^= gf8_ilog[c];
c = gf8_log[d] + *coeffs1;
if (c >= 255)
c -= 255;
q1_msb ^= gf8_ilog[c];
}
coeffs0++;
coeffs1++;
q_lsb += 2 * 44;
q_msb += 2 * 44;
if (q_lsb >= q_start) {
q_msb -= 2 * 1118;
q_lsb -= 2 * 1118;
}
}
*q0 = q0_lsb;
*(q0 + 1) = q0_msb;
*q1 = q1_lsb;
*(q1 + 1) = q1_msb;
q0 += 2;
q1 += 2;
q_lsb_start += 2 * 43;
q_msb_start += 2 * 43;
}
}

12
libburn/lec.h Normal file
View File

@ -0,0 +1,12 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
#ifndef __LEC
#define __LEC
#define RS_L12_BITS 8
void scramble(unsigned char *);
void parity_p(unsigned char *in);
void parity_q(unsigned char *in);
#endif /* __LEC */

View File

@ -119,8 +119,7 @@ enum burn_write_types
2s gaps between tracks, no fonky lead-ins
With sequential DVD-R[W]: Incremental Streaming
With DVD+R and BD-R: Track of open size
With DVD-RAM, DVD+RW, BD-RE: Random Writeable (used sequentially)
With DVD-RAM/+RW: Random Writeable (used sequentially)
With overwriteable DVD-RW: Rigid Restricted Overwrite
*/
BURN_WRITE_TAO,
@ -131,22 +130,12 @@ enum burn_write_types
With sequential DVD-R[W]: Disc-at-once, DAO
Single session, single track, fixed size mandatory, (-dvd-compat)
With other DVD or BD media: same as BURN_WRITE_TAO but may demand
that track size is known in advance.
*/
BURN_WRITE_SAO,
/** With CD: Raw disc at once recording.
all subcodes must be provided by lib or user
only raw block types are supported
With DVD and BD media: not supported.
ts A90901: THIS HAS BEEN DISABLED because its implementation
relied on code from cdrdao which is not understood
currently.
A burn run will abort with "FATAL" error message
if this mode is attempted.
@since 0.7.2
*/
BURN_WRITE_RAW,
@ -349,7 +338,7 @@ struct burn_toc_entry
*/
unsigned char extensions_valid;
/* ts A70201 : DVD extension. extensions_valid:bit0
/* ts A70201 : DVD extension.
If invalid the members are guaranteed to be 0. */
/* @since 0.3.2 */
/* Tracks and session numbers are 16 bit. Here are the high bytes. */
@ -360,13 +349,6 @@ struct burn_toc_entry
/* min, sec, and frame may be too small if DVD extension is valid */
int track_blocks;
/* ts A90909 : LRA extension. extensions_valid:bit1 */
/* @since 0.7.2 */
/* MMC-5 6.27.3.18 : The Last Recorded Address is valid for DVD-R,
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
*/
int last_recorded_address;
};
@ -1047,23 +1029,6 @@ int burn_drive_obtain_scsi_adr(char *path, int *bus_no, int *host_no,
int burn_drive_grab(struct burn_drive *drive, int load);
/* ts A90824 */
/** Calm down or alert a drive. Some drives stay alert after reading for
quite some time. This saves time with the startup for the next read
operation but also causes noise and consumes extra energy. It makes
sense to calm down the drive if no read operation is expected for the
next few seconds. The drive will get alert automatically if operations
are required.
@param drive The drive to influence.
@param flag Bitfield for control purposes
bit0= become alert (else start snoozing)
This is not mandatory to allow further drive operations
@return 1= success , 0= drive role not suitable for calming
@since 0.7.0
*/
int burn_drive_snooze(struct burn_drive *d, int flag);
/** Release a drive. This should not be done until the drive is no longer
busy (see burn_drive_get_status).
Linux: The drive device file is not reserved afterwards. (O_EXCL, F_SETLK).
@ -1143,61 +1108,6 @@ int burn_disc_read_atip(struct burn_drive *drive);
int burn_drive_get_start_end_lba(struct burn_drive *drive,
int *start_lba, int *end_lba, int flag);
/* ts A90902 */
/** Guess the manufacturer name of CD media from the ATIP addresses of lead-in
and lead-out. (Currently only lead-in is interpreted. Lead-out may in
future be used to identify the media type in more detail.)
The parameters of this call should be obtained by burn_disc_read_atip(d),
burn_drive_get_start_end_lba(d, &start_lba, &end_lba, 0),
burn_lba_to_msf(start_lba, &m_li, &s_li, &f_li) and
burn_lba_to_msf(end_lba, &m_lo, &s_lo, &f_lo).
@param m_li "minute" part of ATIP lead-in resp. start_lba
@param s_li "second" of lead-in resp. start_lba
@param f_li "frame" of lead-in
@param m_lo "minute" part of ATIP lead-out
@param s_lo "second" of lead-out
@param f_lo "frame" of lead-out
@param flag Bitfield for control purposes,
bit0= append a text "(aka ...)" to reply if other brands or
vendor names are known.
@return Printable text or NULL on memory shortage.
Dispose by free() when no longer needed.
@since 0.7.2
*/
char *burn_guess_cd_manufacturer(int m_li, int s_li, int f_li,
int m_lo, int s_lo, int f_lo, int flag);
/* ts A90909 */
/** Retrieve some media information which is mainly specific to CD. For other
media only the bits in reply parameter valid are supposed to be meaningful.
@param drive The drive to query.
@param disc_type A string saying either "CD-DA or CD-ROM", or "CD-I",
or ""CD-ROM XA", or "undefined".
@param disc_id A 32 bit number read from the media. (Meaning unclear yet)
@param bar_code 8 hex digits from a barcode on media read by the drive
(if the drive has a bar code reader built in).
@param app_code The Host Application Code which must be set in the Write
Parameters Page if the media is not unrestricted (URU==0).
@param valid Replies bits which indicate the validity of other reply
parameters or the state of certain CD info bits:
bit0= disc_type is valid
bit1= disc_id is valid
bit2= bar_code is valid
bit3= disc_app_code is valid
bit4= Disc is unrestricted (URU bit, 51h READ DISC INFO)
This seems to be broken with my drives. The bit is
0 and the validity bit for disc_app_code is 0 too.
bit5= Disc is nominally erasable (Erasable bit)
This will be set with overwriteable media which
libburn normally considers to be unerasable blank.
@since 0.7.2
*/
int burn_disc_get_cd_info(struct burn_drive *d, char disc_type[80],
unsigned int *disc_id, char bar_code[9], int *app_code,
int *valid);
/* ts A61110 */
/** Read start lba and Next Writeable Address of a track from media.
Usually a track lba is obtained from the result of burn_track_get_entry().
@ -1273,59 +1183,6 @@ off_t burn_disc_available_space(struct burn_drive *d,
*/
int burn_disc_get_profile(struct burn_drive *d, int *pno, char name[80]);
/* ts A90903 : API */
/** Obtain product id and standards defined media codes.
The product id is a printable string which is supposed to be the same
for identical media but should vary with non-identical media. Some media
do not allow to obtain such an id at all.
The pair (profile_number, product_id) should be the best id to identify
media with identical product specifications.
The reply parameters media_code1 and media_code2 can be used with
burn_guess_manufacturer()
The reply parameters have to be disposed by free() when no longer needed.
@param d The drive where the media is inserted.
@param product_id Reply: Printable text depicting manufacturer and
eventually media id.
@param media_code1 Reply: The eventual manufacturer identification as read
from DVD/BD media or a text "XXmYYsZZf" from CD media
ATIP lead-in.
@param media_code2 The eventual media id as read from DVD+/BD media or a
text "XXmYYsZZf" from CD ATIP lead-out.
@param book_type Book type text for DVD and BD.
Caution: is NULL with CD, even if return value says ok.
@param flag Bitfield for control purposes
bit0= do not escape " _/" (not suitable for
burn_guess_manufacturer())
@return 1= ok, product_id and media codes are valid,
0= no product id_available, reply parameters are NULL
<0= error
@since 0.7.2
*/
int burn_disc_get_media_id(struct burn_drive *d,
char **product_id, char **media_code1, char **media_code2,
char **book_type, int flag);
/* ts A90904 */
/** Guess the name of a manufacturer by profile number, manufacturer code
and media code. The profile number can be obtained by
burn_disc_get_profile(), the other two parameters can be obtained as
media_code1 and media_code2 by burn_get_media_product_id().
@param profile_no Profile number (submit -1 if not known)
@param manuf_code Manufacturer code from media (e.g. "RICOHJPN")
@param media_code Media ID code from media (e.g. "W11")
@param flag Bitfield for control purposes, submit 0
@return Printable text or NULL on memory shortage.
If the text begins with "Unknown " then no item of the
manufacturer list matched the codes.
Dispose by free() when no longer needed.
@since 0.7.2
*/
char *burn_guess_manufacturer(int profile_no,
char *manuf_code, char *media_code, int flag);
/** Tells whether a disc can be erased or not
@param d The drive to inquire.
@return Non-zero means erasable
@ -1689,22 +1546,6 @@ void burn_track_define_data(struct burn_track *t, int offset, int tail,
int burn_track_set_byte_swap(struct burn_track *t, int swap_source_bytes);
/* ts A90910 */
/** Activates CD XA compatibility modes.
libburn currently writes data only in CD mode 1. Some programs insist in
sending data with additional management bytes. These bytes have to be
stripped in order to make the input suitable for BURN_MODE1.
@param t The track to manipulate
@param value 0= no conversion
1= strip 8 byte sector headers of CD-ROM XA mode 2 form 1
see MMC-5 4.2.3.8.5.3 Block Format for Mode 2 form 1 Data
all other values are reserved
@return 1=success , 0=unacceptable value
@since 0.7.2
*/
int burn_track_set_cdxa_conv(struct burn_track *t, int value);
/** Set the ISRC details for a track
@param t The track to change
@param country the 2 char country code. Each character must be
@ -1801,11 +1642,9 @@ struct burn_source *burn_fd_source_new(int datafd, int subfd, off_t size);
@param inp The burn_source for which the fifo shall act as proxy.
It can be disposed by burn_source_free() immediately
after this call.
@param chunksize The size in bytes of a chunk.
Use 2048 for sources suitable for BURN_BLOCK_MODE1,
2352 for sources which deliver for BURN_BLOCK_AUDIO,
2056 for sources which shall get treated by
burn_track_set_cdxa_conv(track, 1).
@param chunksize The size in bytes of a chunk. Use 2048 for sources
suitable for BURN_BLOCK_MODE1 and 2352 for sources
which deliver for BURN_BLOCK_AUDIO.
Some variations of burn_source might work only with
a particular chunksize. E.g. libisofs demands 2048.
@param chunks The number of chunks to be allocated in ring buffer.
@ -2159,34 +1998,6 @@ void burn_read_opts_transfer_damaged_blocks(struct burn_read_opts *opts,
void burn_read_opts_set_hardware_error_retries(struct burn_read_opts *opts,
unsigned char hardware_error_retries);
/* ts A90815 */
/** Gets the list of profile codes supported by the drive.
Profiles depict the feature sets which constitute media types. For
known profile codes and names see burn_disc_get_profile().
@param d is the drive to query
@param num_profiles returns the number of supported profiles
@param profiles returns the profile codes
@param is_current returns the status of the corresponding profile code:
1= current, i.e. the matching media is loaded
0= not current, i.e. the matching media is not loaded
@return always 1 for now
@since 0.7.0
*/
int burn_drive_get_all_profiles(struct burn_drive *d, int *num_profiles,
int profiles[64], char is_current[64]);
/* ts A90815 */
/** Obtains the profile name associated with a profile code.
@param profile_code the profile code to be translated
@param name returns the profile name (e.g. "DVD+RW")
@return 1= known profile code , 0= unknown profile code
@since 0.7.0
*/
int burn_obtain_profile_name(int profile_code, char name[80]);
/** Gets the maximum write speed for a drive and eventually loaded media.
The return value might change by the media type of already loaded media,
again by call burn_drive_grab() and again by call burn_disc_read_atip().
@ -2448,8 +2259,8 @@ void burn_version(int *major, int *minor, int *micro);
*/
#define burn_header_version_major 0
#define burn_header_version_minor 7
#define burn_header_version_micro 2
#define burn_header_version_minor 6
#define burn_header_version_micro 4
/** Note:
Above version numbers are also recorded in configure.ac because libtool
wants them as parameters at build time.
@ -2740,6 +2551,7 @@ int burn_drive_get_drive_role(struct burn_drive *d);
int burn_drive_equals_adr(struct burn_drive *d1, char *adr2, int drive_role2);
#ifndef DOXYGEN
BURN_END_DECLS

View File

@ -545,12 +545,9 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x0002016a (FAILURE,HIGH) = No MMC transport adapter is present
0x0002016b (WARNING,HIGH) = No MMC transport adapter is present
0x0002016c (DEBUG,HIGH) = No MMC transport adapter is present
0x0002016e (DEBUG,HIGH) = MODE SENSE page 2A too short
0x0002016f (DEBUG,HIGH) = Unable to grab scanned drive
0x00020170 (NOTE,HIGH) = Closing open session before writing new one
0x00020171 (NOTE,HIGH) = Closing BD-R with accidently open session
0x00020172 (SORRY,HIGH) = Read start address larger than number of readable blocks
0x00020173 (FAILURE,HIGH) = Drive tells NWA smaller than last written address
libdax_audioxtr:

View File

@ -9,8 +9,6 @@
#include <stdlib.h>
#include <sys/time.h>
#include <pthread.h>
#include <ctype.h>
#include "error.h"
#include "sector.h"
#include "libburn.h"
@ -22,7 +20,6 @@
#include "toc.h"
#include "structure.h"
#include "options.h"
#include "util.h"
/* ts A70223 : in init.c */
@ -80,12 +77,6 @@ extern struct libdax_msgs *libdax_messenger;
# define Libburn_do_not_format_dvd_ram_or_bd_rE 1
*/
/* ts A90603 : Simulate the command restrictions of an old MMC-1 drive
# define Libisofs_simulate_old_mmc1_drivE 1
*/
/* DVD/BD progress report:
ts A61219 : It seems to work with a used (i.e. thoroughly formatted) DVD+RW.
Error messages of class DEBUG appear because of inability to
@ -217,10 +208,6 @@ static unsigned char MMC_READ_10[] =
static unsigned char MMC_READ_CAPACITY[] =
{ 0x25, 0, 0, 0, 0, 0, 0, 0, 0, 0};
/* ts A90903 : Obtain media type specific information. E.g. manufacturer.
*/
static unsigned char MMC_READ_DISC_STRUCTURE[] =
{ 0xAD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
static int mmc_function_spy_do_tell = 0;
@ -243,11 +230,6 @@ int mmc_function_spy(struct burn_drive *d, char * text)
d->cancel = 1;
return 0;
}
if (d->is_stopped && strcmp(text, "stop_unit") != 0 &&
strcmp(text, "start_unit") != 0) {
d->start_unit(d);
d->is_stopped = 0;
}
return 1;
}
@ -835,13 +817,12 @@ int mmc_write(struct burn_drive *d, int start, struct buffer *buf)
/* ts A70201 : Set up an entry for mmc_fake_toc() */
int mmc_fake_toc_entry(struct burn_toc_entry *entry, int session_number,
int track_number,
unsigned char *size_data, unsigned char *start_data,
unsigned char *last_adr_data)
unsigned char *size_data, unsigned char *start_data)
{
int min, sec, frames, num;
/* mark DVD extensions and Track Info extension as valid */
entry->extensions_valid |= (1 | 2);
/* mark DVD extensions as valid */
entry->extensions_valid |= 1;
/* defaults are as of mmc5r03.pdf 6.26.3.2.4 Fabricated TOC */
entry->session = session_number & 0xff;
@ -874,7 +855,6 @@ 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);
return 1;
}
@ -889,7 +869,7 @@ static int mmc_read_toc_fmt0_al(struct burn_drive *d, int *alloc_len)
struct command c;
int dlen, i, old_alloc_len, session_number, prev_session = -1;
int lba, size;
unsigned char *tdata, size_data[4], start_data[4], end_data[4];
unsigned char *tdata, size_data[4], start_data[4];
if (*alloc_len < 4)
return 0;
@ -963,9 +943,8 @@ err_ex:;
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);
mmc_fake_toc_entry(entry, prev_session, 0xA2,
size_data, start_data, end_data);
size_data, start_data);
entry->min= entry->sec= entry->frame= 0;
d->disc->session[prev_session - 1]->leadout_entry =
entry;
@ -988,13 +967,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_fake_toc_entry(entry, session_number, i + 1,
size_data, start_data, end_data);
size_data, start_data);
if (prev_session != session_number)
d->disc->session[session_number - 1]->firsttrack = i+1;
d->disc->session[session_number - 1]->lasttrack = i+1;
@ -1006,10 +983,8 @@ err_ex:;
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_fake_toc_entry(entry, prev_session, 0xA2,
size_data, start_data, end_data);
size_data, start_data);
entry->min= entry->sec= entry->frame= 0;
d->disc->session[prev_session - 1]->leadout_entry = entry;
}
@ -1040,7 +1015,7 @@ int mmc_fake_toc(struct burn_drive *d)
struct burn_toc_entry *entry;
struct buffer buf;
int i, session_number, prev_session = -1, ret, lba, alloc_len = 34;
unsigned char *tdata, size_data[4], start_data[4], end_data[4];
unsigned char *tdata, size_data[4], start_data[4];
char msg[160];
if (mmc_function_spy(d, "mmc_fake_toc") <= 0)
@ -1061,7 +1036,8 @@ int mmc_fake_toc(struct burn_drive *d)
}
/* ts A71128 : My DVD-ROM drive issues no reliable track info.
One has to try 43h READ TOC/PMA/ATIP Form 0. */
if ((d->current_profile == 0x10) && d->last_track_no <= 1) {
if ((d->current_profile == 0x10 || d->current_profile == 0x40) &&
d->last_track_no <= 1) {
ret = mmc_read_toc_fmt0(d);
return ret;
}
@ -1114,9 +1090,8 @@ int mmc_fake_toc(struct burn_drive *d)
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);
mmc_fake_toc_entry(entry, prev_session, 0xA2,
size_data, start_data, end_data);
size_data, start_data);
entry->min= entry->sec= entry->frame= 0;
d->disc->session[prev_session - 1]->leadout_entry =
entry;
@ -1145,9 +1120,8 @@ int mmc_fake_toc(struct burn_drive *d)
memcpy(size_data, tdata + 24, 4);
memcpy(start_data, tdata + 8, 4);
memcpy(end_data, tdata + 28, 4);
mmc_fake_toc_entry(entry, session_number, i + 1,
size_data, start_data, end_data);
size_data, start_data);
if (prev_session != session_number)
d->disc->session[session_number - 1]->firsttrack = i+1;
@ -1161,9 +1135,8 @@ int mmc_fake_toc(struct burn_drive *d)
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);
mmc_fake_toc_entry(entry, prev_session, 0xA2,
size_data, start_data, end_data);
size_data, start_data);
entry->min= entry->sec= entry->frame= 0;
d->disc->session[prev_session - 1]->leadout_entry = entry;
}
@ -1180,7 +1153,7 @@ static int mmc_read_toc_al(struct burn_drive *d, int *alloc_len)
struct buffer buf;
struct command c;
int dlen;
int i, bpl= 12, old_alloc_len, t_idx, ret;
int i, bpl= 12, old_alloc_len, t_idx;
unsigned char *tdata;
char msg[321];
@ -1206,16 +1179,6 @@ static int mmc_read_toc_al(struct burn_drive *d, int *alloc_len)
d->status = BURN_DISC_FULL;
return 1;
}
/* ts A90823:
SanDisk Cruzer U3 memory stick stalls on format 2.
Format 0 seems to be more conservative with read-only drives.
*/
if (!(d->mdata->cdrw_write || d->current_profile != 0x08)) {
ret = mmc_read_toc_fmt0(d);
return ret;
}
scsi_init_command(&c, MMC_GET_TOC, sizeof(MMC_GET_TOC));
/*
memcpy(c.opcode, MMC_GET_TOC, sizeof(MMC_GET_TOC));
@ -1497,75 +1460,6 @@ inquire_drive:;
}
/* ts A61201 */
char *mmc_obtain_profile_name(int profile_number)
{
static char *texts[0x53] = {NULL};
int i, max_pno = 0x53;
if (texts[0] == NULL) {
for (i = 0; i<max_pno; i++)
texts[i] = "";
/* mmc5r03c.pdf , Table 89, Spelling: guessed cdrecord style */
texts[0x01] = "Non-removable disk";
texts[0x02] = "Removable disk";
texts[0x03] = "MO erasable";
texts[0x04] = "Optical write once";
texts[0x05] = "AS-MO";
texts[0x08] = "CD-ROM";
texts[0x09] = "CD-R";
texts[0x0a] = "CD-RW";
texts[0x10] = "DVD-ROM";
texts[0x11] = "DVD-R sequential recording";
texts[0x12] = "DVD-RAM";
texts[0x13] = "DVD-RW restricted overwrite";
texts[0x14] = "DVD-RW sequential recording";
texts[0x15] = "DVD-R/DL sequential recording";
texts[0x16] = "DVD-R/DL layer jump recording";
texts[0x1a] = "DVD+RW";
texts[0x1b] = "DVD+R";
texts[0x2a] = "DVD+RW/DL";
texts[0x2b] = "DVD+R/DL";
texts[0x40] = "BD-ROM";
texts[0x41] = "BD-R sequential recording";
texts[0x42] = "BD-R random recording";
texts[0x43] = "BD-RE";
texts[0x50] = "HD-DVD-ROM";
texts[0x51] = "HD-DVD-R";
texts[0x52] = "HD-DVD-RAM";
}
if (profile_number<0 || profile_number>=max_pno)
return "";
return texts[profile_number];
}
/* ts A90603 : to be used if the drive knows no GET CONFIGURATION
*/
static int mmc_guess_profile(struct burn_drive *d, int flag)
{
int cp;
cp = 0;
if (d->status == BURN_DISC_BLANK ||
d->status == BURN_DISC_APPENDABLE) {
cp = 0x09;
} else if (d->status == BURN_DISC_FULL) {
cp = 0x08;
}
if (cp)
if (d->erasable)
cp = 0x0a;
d->current_profile = cp;
if (cp == 0)
return 0;
d->current_is_cd_profile = 1;
d->current_is_supported_profile = 1;
strcpy(d->current_profile_text, mmc_obtain_profile_name(cp));
return 1;
}
static int mmc_read_disc_info_al(struct burn_drive *d, int *alloc_len)
{
struct buffer buf;
@ -1595,7 +1489,15 @@ static int mmc_read_disc_info_al(struct burn_drive *d, int *alloc_len)
mmc_get_configuration(d);
/* ts A70910 : found this as condition for mmc_function_spy() which went up
if (*alloc_len < 2)
*/
scsi_init_command(&c, MMC_GET_DISC_INFO, sizeof(MMC_GET_DISC_INFO));
/*
memcpy(c.opcode, MMC_GET_DISC_INFO, sizeof(MMC_GET_DISC_INFO));
c.oplen = sizeof(MMC_GET_DISC_INFO);
*/
c.dxfer_len = *alloc_len;
c.opcode[7]= (c.dxfer_len >> 8) & 0xff;
c.opcode[8]= c.dxfer_len & 0xff;
@ -1617,32 +1519,13 @@ static int mmc_read_disc_info_al(struct burn_drive *d, int *alloc_len)
*alloc_len = len + 2;
if (old_alloc_len < 34)
return 1;
if (*alloc_len < 24) /* data[23] is the last mandatory byte here */
if (*alloc_len < 24) /* data[23] is the last byte used here */
return 0;
if (len + 2 > old_alloc_len)
len = old_alloc_len - 2;
d->erasable = !!(data[2] & 16);
/* ts A90908 */
d->disc_type = data[8];
d->disc_info_valid = 1;
d->disc_id = mmc_four_char_to_int(data + 12);
d->disc_info_valid |= (!!(data[7] & 128)) << 1;
if (len + 2 > 31 && (data[7] & 64)) {
memcpy(d->disc_bar_code, data + 24, 8);
d->disc_bar_code[9] = 0;
d->disc_info_valid |= 4;
}
if (len + 2 > 32 && (data[7] & 16)) {
d->disc_app_code = data[32];
d->disc_info_valid |= 8;
}
if (data[7] & 32)
d->disc_info_valid |= 16;
if (data[2] & 16)
d->disc_info_valid |= 32;
disc_status = data[2] & 3;
d->state_of_last_session = (data[2] >> 2) & 3;
number_of_sessions = (data[9] << 8) | data[4];
@ -1676,26 +1559,12 @@ static int mmc_read_disc_info_al(struct burn_drive *d, int *alloc_len)
}
#endif /* Libburn_support_bd_r_readonlY */
/* MMC-5 6.22.3.1.16:
Last Session Lead-in Start Address bytes 16 to 19
Last Possible Lead-out Start Address bytes 20 to 23
MSF for CD, LBA else
*/
if(d->current_profile == 0x08 || d->current_profile == 0x09 ||
d->current_profile == 0x0a) {
d->last_lead_in =
burn_msf_to_lba(data[17], data[18], data[19]);
d->last_lead_out =
burn_msf_to_lba(data[21], data[22], data[23]);
} else {
d->last_lead_in = mmc_four_char_to_int(data + 16);
d->last_lead_out = mmc_four_char_to_int(data + 20);
}
switch (disc_status) {
case 0:
regard_as_blank:;
d->toc_entries = 0;
d->start_lba = burn_msf_to_lba(data[17], data[18], data[19]);
d->end_lba = burn_msf_to_lba(data[21], data[22], data[23]);
/*
fprintf(stderr, "libburn_experimental: start_lba = %d (%d %d %d) , end_lba = %d (%d %d %d)\n",
@ -1704,8 +1573,6 @@ regard_as_blank:;
*/
d->status = BURN_DISC_BLANK;
d->start_lba = d->last_lead_in;
d->end_lba = d->last_lead_out;
break;
case 1:
d->status = BURN_DISC_APPENDABLE;
@ -1741,16 +1608,8 @@ regard_as_blank:;
do_read_toc = 1;
break;
case 3:
/* ts A91009 : DVD-RAM has disc status "others" */
mmc_read_capacity(d);
break;
}
/* ts A90603 : An MMC-1 drive might not know the media type yet */
if (d->current_is_guessed_profile && d->current_profile == 0)
mmc_guess_profile(d, 0);
if ((d->current_profile != 0 || d->status != BURN_DISC_UNREADY)
&& ! d->current_is_supported_profile) {
if (!d->silent_on_scsi_error) {
@ -1766,7 +1625,7 @@ regard_as_blank:;
return 0;
}
/* ts A61217 : Note for future
/* >>> ts A61217 : Note for future
growisofs performs OPC if (data[0]<<8)|data[1]<=32
which indicates no OPC entries are attached to the
reply from the drive.
@ -2306,13 +2165,56 @@ void mmc_set_speed(struct burn_drive *d, int r, int w)
}
/* ts A61201 */
static char *mmc_obtain_profile_name(int profile_number)
{
static char *texts[0x53] = {NULL};
int i, max_pno = 0x53;
if (texts[0] == NULL) {
for (i = 0; i<max_pno; i++)
texts[i] = "";
/* mmc5r03c.pdf , Table 89, Spelling: guessed cdrecord style */
texts[0x01] = "Non-removable disk";
texts[0x02] = "Removable disk";
texts[0x03] = "MO erasable";
texts[0x04] = "Optical write once";
texts[0x05] = "AS-MO";
texts[0x08] = "CD-ROM";
texts[0x09] = "CD-R";
texts[0x0a] = "CD-RW";
texts[0x10] = "DVD-ROM";
texts[0x11] = "DVD-R sequential recording";
texts[0x12] = "DVD-RAM";
texts[0x13] = "DVD-RW restricted overwrite";
texts[0x14] = "DVD-RW sequential recording";
texts[0x15] = "DVD-R/DL sequential recording";
texts[0x16] = "DVD-R/DL layer jump recording";
texts[0x1a] = "DVD+RW";
texts[0x1b] = "DVD+R";
texts[0x2a] = "DVD+RW/DL";
texts[0x2b] = "DVD+R/DL";
texts[0x40] = "BD-ROM";
texts[0x41] = "BD-R sequential recording";
texts[0x42] = "BD-R random recording";
texts[0x43] = "BD-RE";
texts[0x50] = "HD-DVD-ROM";
texts[0x51] = "HD-DVD-R";
texts[0x52] = "HD-DVD-RAM";
}
if (profile_number<0 || profile_number>=max_pno)
return "";
return texts[profile_number];
}
/* ts A61201 : found in unfunctional state
*/
static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len)
{
struct buffer buf;
int len, cp, descr_len = 0, feature_code, prf_number, only_current = 1;
int old_alloc_len, only_current_profile = 0;
int old_alloc_len;
unsigned char *descr, *prf, *up_to, *prf_end;
struct command c;
int phys_if_std = 0;
@ -2325,8 +2227,6 @@ static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len)
d->current_profile_text[0] = 0;
d->current_is_cd_profile = 0;
d->current_is_supported_profile = 0;
d->current_is_guessed_profile = 0;
d->num_profiles = 0;
d->current_has_feat21h = 0;
d->current_feat21h_link_size = -1;
d->current_feat23h_byte4 = 0;
@ -2335,6 +2235,10 @@ static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len)
scsi_init_command(&c, MMC_GET_CONFIGURATION,
sizeof(MMC_GET_CONFIGURATION));
/*
memcpy(c.opcode, MMC_GET_CONFIGURATION, sizeof(MMC_GET_CONFIGURATION));
c.oplen = sizeof(MMC_GET_CONFIGURATION);
*/
c.dxfer_len= *alloc_len;
c.retry = 1;
c.opcode[7] = (c.dxfer_len >> 8) & 0xff;
@ -2345,24 +2249,8 @@ static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len)
c.dir = FROM_DRIVE;
d->issue_command(d, &c);
#ifdef Libisofs_simulate_old_mmc1_drivE
c.error = 1;
c.sense[2] = 0x5;
c.sense[12] = 0x20;
c.sense[13] = 0x0;
#endif /* Libisofs_simulate_old_mmc1_drivE */
if (c.error) {
/* ts A90603 : MMC-1 drive do not know 46h GET CONFIGURATION */
if (c.sense[2] == 0x5 && c.sense[12] == 0x20 &&
c.sense[13] == 0x0) {
d->current_is_guessed_profile = 1;
/* Will yield a non-zero profile only after
mmc_read_disc_info_al() was called */
mmc_guess_profile(d, 0);
}
if (c.error)
return 0;
}
old_alloc_len = *alloc_len;
*alloc_len = len = mmc_four_char_to_int(c.page->data);
if (len > old_alloc_len)
@ -2440,7 +2328,7 @@ static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len)
#endif
/* Enable this to get loud and repeated reports about the feature set :
#define Libburn_print_feature_descriptorS 1
#define Libburn_print_feature_descriptorS 1
*/
/* ts A70127 : Interpret list of profile and feature descriptors.
see mmc5r03c.pdf 5.2
@ -2454,7 +2342,7 @@ static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len)
"-----------------------------------------------------------------\n");
fprintf(stderr,
"LIBBURN_EXPERIMENTAL : feature list length = %d , shown = %d\n",
len, (int) (up_to - c.page->data));
len, up_to - c.page->data);
#endif /* Libburn_print_feature_descriptorS */
for (descr = c.page->data + 8; descr + 3 < up_to; descr += descr_len) {
@ -2472,14 +2360,8 @@ static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len)
if (feature_code == 0x0) {
prf_end = descr + 4 + descr[3];
d->num_profiles = descr[3] / 4;
if (d->num_profiles > 64)
d->num_profiles = 64;
if (d->num_profiles > 0)
memcpy(d->all_profiles, descr + 4,
d->num_profiles * 4);
for (prf = descr + 4; prf + 2 < prf_end; prf += 4) {
if (only_current_profile && !(prf[2] & 1))
if (only_current && !(prf[2] & 1))
continue;
prf_number = (prf[0] << 8) | prf[1];
@ -3593,14 +3475,6 @@ static int mmc_get_write_performance_al(struct burn_drive *d,
c.page->bytes = 0;
c.dir = FROM_DRIVE;
d->issue_command(d, &c);
#ifdef Libisofs_simulate_old_mmc1_drivE
c.error = 1;
c.sense[2] = 0x5;
c.sense[12] = 0x20;
c.sense[13] = 0x0;
#endif /* Libisofs_simulate_old_mmc1_drivE */
if (c.error)
return 0;
len = mmc_four_char_to_int(c.page->data);
@ -3897,312 +3771,6 @@ int mmc_read_capacity(struct burn_drive *d)
}
/* ts A90903 */
/* mmc5r03c.pdf 6.23 ADh READ DISC STRUCTURE obtains media specific information
*/
static int mmc_read_disc_structure_al(struct burn_drive *d, int *alloc_len,
int media_type, int layer_number, int format,
int min_len, char **reply, int *reply_len,
int flag)
{
struct buffer buf;
int old_alloc_len, len;
struct command c;
unsigned char *dpt;
*reply = NULL;
*reply_len = 0;
if (*alloc_len < 4)
return 0;
scsi_init_command(&c, MMC_READ_DISC_STRUCTURE,
sizeof(MMC_READ_DISC_STRUCTURE));
c.dxfer_len = *alloc_len;
c.retry = 1;
c.opcode[1]= media_type;
c.opcode[7]= format;
c.opcode[8]= (c.dxfer_len >> 8) & 0xff;
c.opcode[9]= c.dxfer_len & 0xff;
c.page = &buf;
c.page->sectors = 0;
c.page->bytes = 0;
c.dir = FROM_DRIVE;
d->issue_command(d, &c);
if (c.error)
return 0;
len = (c.page->data[0] << 8) | (c.page->data[1]);
old_alloc_len = *alloc_len;
*alloc_len = len + 2;
if (old_alloc_len <= 4)
return 1;
if (len + 2 > old_alloc_len)
len = old_alloc_len - 2;
if (len < 4)
return 0;
dpt = c.page->data + 4;
if (len - 2 < min_len)
return 0;
*reply = calloc(len - 2, 1);
if (*reply == NULL)
return 0;
*reply_len = len - 2;
memcpy(*reply, dpt, len - 2);
return 1;
}
int mmc_read_disc_structure(struct burn_drive *d,
int media_type, int layer_number, int format, int min_len,
char **reply, int *reply_len, int flag)
{
int alloc_len = 4, ret;
if (mmc_function_spy(d, "mmc_read_disc_structure") <= 0)
return 0;
ret = mmc_read_disc_structure_al(d, &alloc_len,
media_type, layer_number, format, min_len,
reply, reply_len, 0);
/*
fprintf(stderr,"LIBBURN_DEBUG: ADh alloc_len = %d , ret = %d\n",
alloc_len, ret);
*/
if (alloc_len >= 12 && ret > 0)
ret = mmc_read_disc_structure_al(d, &alloc_len,
media_type, layer_number, format, min_len,
reply, reply_len, 0);
return ret;
}
/* ts A90903 */
/*
@param flag bit0= set bit1 in flag for burn_util_make_printable_word
and do not append media revision
*/
static int mmc_set_product_id(char *reply,
int manuf_idx, int type_idx, int rev_idx,
char **product_id, char **media_code1, char **media_code2, int flag)
{
int ret;
*product_id = calloc(17, 1);
*media_code1 = calloc(9, 1);
*media_code2 = calloc(8, 1);
if (*product_id == NULL ||
*media_code1 == NULL || *media_code2 == NULL)
return -1;
sprintf(*media_code1, "%.8s", reply + manuf_idx);
ret = burn_util_make_printable_word(media_code1,
1 | ((flag & 1) << 1));
if (ret <= 0)
return -1;
sprintf(*media_code2, "%.3s%s", reply + type_idx,
(flag & 1) ? "" : "xxxx");
ret = burn_util_make_printable_word(media_code2,
1 | ((flag & 1) << 1));
if (ret <= 0)
return -1;
if (!(flag & 1)) {
sprintf(*media_code2 + strlen(*media_code2) - 4, "/%d",
(int) ((unsigned char *) reply)[rev_idx]);
}
sprintf(*product_id, "%s/%s", *media_code1, *media_code2);
return 1;
}
/* ts A90903 */
/* MMC backend of API call burn_get_media_product_id()
See also doc/mediainfo.txt
@param flag Bitfield for control purposes
bit0= do not escape " _/" (not suitable for
burn_guess_manufacturer())
*/
int mmc_get_media_product_id(struct burn_drive *d,
char **product_id, char **media_code1, char **media_code2,
char **book_type, int flag)
{
int prf, ret, reply_len, i, has_11h = -1, bt, start_lba, end_lba;
int min, sec, fr, media_type = 0;
char *reply = NULL, *wpt;
static char *books[16] = {
"DVD-ROM", "DVD-RAM", "DVD-R", "DVD-RW",
"HD DVD-ROM", "HD DVD-RAM", "HD DVD-R", "unknown",
"unknown", "DVD+RW", "DVD+R", "unknown",
"unknown", "DVD+RW DL" "DVD+R DL", "unknown"};
*product_id = *media_code1 = *media_code2 = *book_type = NULL;
prf = d->current_profile;
if (prf == 0x09 || prf == 0x0A) {
*product_id = calloc(20, 1);
*media_code1 = calloc(10, 1);
*media_code2 = calloc(10, 1);
if (*product_id == NULL ||
*media_code1 == NULL || *media_code2 == NULL) {
ret = -1;
goto ex;
}
ret = burn_disc_read_atip(d);
if (ret <= 0)
goto ex;
ret = burn_drive_get_start_end_lba(d, &start_lba, &end_lba, 0);
if (ret <= 0)
goto ex;
burn_lba_to_msf(start_lba, &min, &sec, &fr);
sprintf(*media_code1, "%2.2dm%2.2ds%2.2df", min, sec, fr);
burn_lba_to_msf(end_lba, &min, &sec, &fr);
sprintf(*media_code2, "%2.2dm%2.2ds%2.2df", min, sec, fr);
sprintf(*product_id, "%s/%s", *media_code1, *media_code2);
ret = 1;
goto ex; /* No booktype with CD media */
} else if (prf == 0x11 || prf == 0x13 || prf == 0x14 || prf == 0x15) {
/* DVD-R */
ret = mmc_read_disc_structure(d, 0, 0, 0x0E, 31, &reply,
&reply_len, 0);
if (ret <= 0)
goto ex;
/* ECMA-279 for DVD-R promises a third sixpack in field 5,
but ECMA-338 for DVD-RW defines a different meaning.
DVD-R and DVD-RW bear unprintable characters in there.
*/
if (reply[16] != 3 || reply[24] != 4) {
ret = 0;
goto ex;
}
*media_code1 = calloc(19, 1);
*media_code2 = strdup("");
if (*media_code1 == NULL || *media_code2 == NULL) {
ret = -1;
goto ex;
}
memcpy(*media_code1, reply + 17, 6);
memcpy(*media_code1 + 6, reply + 25, 6);
/* Clean out 0 bytes */
wpt = *media_code1;
for (i = 0; i < 18; i++)
if ((*media_code1)[i])
*(wpt++) = (*media_code1)[i];
*wpt = 0;
ret = burn_util_make_printable_word(media_code1,
1 | ((flag & 1) << 1));
if (ret <= 0)
goto ex;
*product_id = strdup(*media_code1);
if (*product_id == NULL) {
ret = -1;
goto ex;
}
} else if (prf == 0x1a || prf == 0x1b || prf == 0x2b) { /* DVD+R[W] */
/* Check whether the drive supports format 11h */
has_11h = 0;
ret = mmc_read_disc_structure(d, 0, 0, 4, 0xff, &reply,
&reply_len, 0);
if (ret > 0) {
for (i = 0; i < reply_len; i += 4) {
if (reply[i] == 0x11 && (reply[i + 1] & 64))
has_11h = 1;
}
}
if (reply != NULL)
free(reply);
reply = NULL;
ret = mmc_read_disc_structure(d, 0, 0, 0x11, 29, &reply,
&reply_len, 0);
if (ret <= 0) {
/* Hope for format 00h */
has_11h = 0;
} else {
/* Dig out manufacturer, media type and revision */
ret = mmc_set_product_id(reply, 19, 27, 28,
product_id, media_code1, media_code2,
flag & 1);
if (ret <= 0)
goto ex;
}
} else if (prf == 0x41 || prf == 0x43 || prf == 0x40 || prf == 0x42) {
/* BD */
media_type = 1;
ret = mmc_read_disc_structure(d, 1, 0, 0x00, 112, &reply,
&reply_len, 0);
if (ret <= 0)
goto ex;
if (reply[0] != 'D' || reply[1] != 'I') {
ret = 0;
goto ex;
}
/* Dig out manufacturer, media type and revision */
ret = mmc_set_product_id(reply, 100, 106, 111,
product_id, media_code1, media_code2,
flag & 1);
if (ret <= 0)
goto ex;
} else {
/* Source of DVD-RAM manufacturer and media id not found yet */
ret = 0;
goto ex;
}
if (reply != NULL)
free(reply);
reply = NULL;
ret = mmc_read_disc_structure(d, media_type, 0, 0x00, 1,
&reply, &reply_len, 0);
if (ret <= 0)
goto ex;
bt = (reply[0] >> 4) & 0xf;
*book_type = calloc(80 + strlen(books[bt]), 1);
if (*book_type == NULL) {
ret = -1;
goto ex;
}
sprintf(*book_type, "%2.2Xh, %s book [revision %d]",
bt, books[bt], reply[0] & 0xf);
if (has_11h == 0 && *product_id == NULL && reply_len > 28) {
/* DVD+ with no format 11h */
/* Get manufacturer and media type from bytes 19 and 27 */
ret = mmc_set_product_id(reply, 19, 27, 28, product_id,
media_code1, media_code2,
flag & 1);
if (*product_id == NULL) {
ret = 0;
goto ex;
}
}
ret = 1;
ex:;
if (reply != NULL)
free(reply);
if (ret <= 0) {
if (*product_id != NULL)
free(*product_id);
if (*media_code1 != NULL)
free(*media_code1);
if (*media_code2 != NULL)
free(*media_code2);
if (*book_type != NULL)
free(*book_type);
*product_id = *media_code1 = *media_code2 = *book_type = NULL;
}
return ret;
}
/* ts A61021 : the mmc specific part of sg.c:enumerate_common()
*/
int mmc_setup_drive(struct burn_drive *d)
@ -4236,15 +3804,12 @@ int mmc_setup_drive(struct burn_drive *d)
d->start_lba = -2000000000;
d->end_lba = -2000000000;
/* ts A61201 - A90815*/
/* ts A61201 - A70223*/
d->erasable = 0;
d->current_profile = -1;
d->current_profile_text[0] = 0;
d->current_is_cd_profile = 0;
d->current_is_supported_profile = 0;
d->current_is_guessed_profile = 0;
memset(d->all_profiles, 0, 256);
d->num_profiles = 0;
d->current_has_feat21h = 0;
d->current_feat21h_link_size = -1;
d->current_feat23h_byte4 = 0;
@ -4253,13 +3818,6 @@ int mmc_setup_drive(struct burn_drive *d)
d->needs_close_session = 0;
d->needs_sync_cache = 0;
d->bg_format_status = -1;
d->last_lead_in = -2000000000;
d->last_lead_out = -2000000000;
d->disc_type = 0xff;
d->disc_id = 0;
memset(d->disc_bar_code, 0, 9);
d->disc_app_code = 0;
d->disc_info_valid = 0;
d->num_format_descr = 0;
d->complete_sessions = 0;
d->state_of_last_session = -1;
@ -4284,3 +3842,4 @@ int mmc_setup_drive(struct burn_drive *d)
return 1;
}

View File

@ -75,19 +75,8 @@ int mmc_read_10(struct burn_drive *d, int start, int amount,
/* ts A81210 : Determine the upper limit of readable data size */
int mmc_read_capacity(struct burn_drive *d);
/* ts A61201 */
char *mmc_obtain_profile_name(int profile_number);
/* mmc5r03c.pdf 4.3.4.4.1 d) "The maximum number of RZones is 2 302." */
#define BURN_MMC_FAKE_TOC_MAX_SIZE 2302
/* ts A90903 */
/* MMC backend of API call burn_get_media_product_id()
*/
int mmc_get_media_product_id(struct burn_drive *d,
char **product_id, char **media_code1, char **media_code2,
char **book_type, int flag);
#endif /*__MMC*/

View File

@ -143,7 +143,7 @@ int burn_write_opts_set_simulate(struct burn_write_opts *opts, int sim)
int burn_write_opts_set_underrun_proof(struct burn_write_opts *opts,
int underrun_proof)
{
if (opts->drive->mdata->valid <= 0)
if (!opts->drive->mdata->valid)
return 0;
if (opts->drive->mdata->underrun_proof) {
opts->underrun_proof = underrun_proof;

View File

@ -27,6 +27,7 @@
#include "crc.h"
#include "debug.h"
#include "init.h"
#include "lec.h"
#include "toc.h"
#include "util.h"
#include "sg.h"
@ -370,20 +371,6 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
msg, 0, 0);
return 0;
}
if (d->media_read_capacity != 0x7fffffff && byte_address >=
((off_t) d->media_read_capacity + (off_t) 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);
libdax_msgs_submit(libdax_messenger, d->global_index,
0x00020172,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
msg, 0, 0);
}
return 0;
}
if (d->busy != BURN_DRIVE_IDLE) {
libdax_msgs_submit(libdax_messenger,

View File

@ -21,7 +21,6 @@ int mmc_function_spy(struct burn_drive *d, char * text);
static unsigned char SBC_LOAD[] = { 0x1b, 0, 0, 0, 3, 0 };
static unsigned char SBC_UNLOAD[] = { 0x1b, 0, 0, 0, 2, 0 };
static unsigned char SBC_START_UNIT[] = { 0x1b, 0, 0, 0, 1, 0 };
static unsigned char SBC_STOP_UNIT[] = { 0x1b, 0, 0, 0, 0, 0 };
void sbc_load(struct burn_drive *d)
{
@ -80,46 +79,28 @@ void sbc_eject(struct burn_drive *d)
int sbc_start_unit(struct burn_drive *d)
{
struct command c;
int ret;
if (mmc_function_spy(d, "start_unit") <= 0)
return 0;
scsi_init_command(&c, SBC_START_UNIT, sizeof(SBC_START_UNIT));
/*
memcpy(c.opcode, SBC_START_UNIT, sizeof(SBC_START_UNIT));
c.oplen = sizeof(SBC_START_UNIT);
c.page = NULL;
*/
c.retry = 1;
c.opcode[1] |= 1; /* ts A70918 : Immed */
c.dir = NO_TRANSFER;
d->issue_command(d, &c);
if (c.error)
return 0;
/* ts A70918 : now asynchronous */
d->is_stopped = 0;
ret = spc_wait_unit_attention(d, 1800, "START UNIT", 0);
return ret;
return spc_wait_unit_attention(d, 1800, "START UNIT", 0);
}
/* ts A90824 : Trying to reduce drive noise */
int sbc_stop_unit(struct burn_drive *d)
{
struct command c;
int ret;
if (mmc_function_spy(d, "stop_unit") <= 0)
return 0;
scsi_init_command(&c, SBC_STOP_UNIT, sizeof(SBC_STOP_UNIT));
c.retry = 0;
c.opcode[1] |= 1; /* Immed */
c.dir = NO_TRANSFER;
d->issue_command(d, &c);
if (c.error)
return 0;
ret = spc_wait_unit_attention(d, 1800, "STOP UNIT", 0);
d->is_stopped = 1;
return ret;
}
/* ts A61021 : the sbc specific part of sg.c:enumerate_common()
*/
@ -128,8 +109,6 @@ int sbc_setup_drive(struct burn_drive *d)
d->eject = sbc_eject;
d->load = sbc_load;
d->start_unit = sbc_start_unit;
d->stop_unit = sbc_stop_unit;
d->is_stopped = 0;
return 1;
}

View File

@ -15,12 +15,10 @@
#include "sector.h"
#include "crc.h"
#include "debug.h"
#include "lec.h"
#include "toc.h"
#include "write.h"
#include "libdax_msgs.h"
extern struct libdax_msgs *libdax_messenger;
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
@ -208,7 +206,8 @@ static unsigned char *get_sector(struct burn_write_opts *opts,
{
struct burn_drive *d = opts->drive;
struct buffer *out = d->buffer;
int outmode, seclen;
int outmode;
int seclen;
unsigned char *ret;
outmode = get_outmode(opts);
@ -224,7 +223,6 @@ static unsigned char *get_sector(struct burn_write_opts *opts,
seclen += burn_subcode_length(outmode);
/* ts A61219 : opts->obs is eventually a 32k trigger for DVD */
/* (there is enough buffer size reserve for track->cdxa_conversion) */
if (out->bytes + seclen > BUFFER_SIZE ||
(opts->obs > 0 && out->bytes + seclen > opts->obs)) {
int err;
@ -244,6 +242,7 @@ static unsigned char *get_sector(struct burn_write_opts *opts,
out->bytes = 0;
out->sectors = 0;
}
ret = out->data + out->bytes;
out->bytes += seclen;
out->sectors++;
@ -300,17 +299,7 @@ static int convert_data(struct burn_write_opts *o, struct burn_track *track,
return 0;
if ((outmode & BURN_MODE_BITS) == (inmode & BURN_MODE_BITS)) {
/* see MMC-5 4.2.3.8.5.3 Block Format for Mode 2 form 1 Data
Table 24 Mode 2 Formed Sector Sub-header Format */
if (track != NULL)
if (track->cdxa_conversion == 1)
inlen += 8;
get_bytes(track, inlen, data);
if (track != NULL)
if (track->cdxa_conversion == 1)
memmove(data, data + 8, inlen - 8);
return 1;
}
@ -424,8 +413,7 @@ int sector_toc(struct burn_write_opts *o, int mode)
return 0;
subcode_toc(d, mode, subs);
convert_subs(o, mode, subs, data);
if (sector_headers(o, data, mode, 1) <= 0)
return 0;
sector_headers(o, data, mode, 1);
sector_common(++)
return 1;
}
@ -445,8 +433,7 @@ int sector_pregap(struct burn_write_opts *o,
return 0;
subcode_user(o, subs, tno, control, 0, NULL, 1);
convert_subs(o, mode, subs, data);
if (sector_headers(o, data, mode, 0) <= 0)
return 0;
sector_headers(o, data, mode, 0);
sector_common(--)
return 1;
}
@ -463,12 +450,11 @@ int sector_postgap(struct burn_write_opts *o,
return 0;
/* ts A61010 */
if (convert_data(o, NULL, mode, data) <= 0)
return 0;
return 0;;
/* use last index in track */
subcode_user(o, subs, tno, control, 1, NULL, 1);
convert_subs(o, mode, subs, data);
if (sector_headers(o, data, mode, 0) <= 0)
return 0;
sector_headers(o, data, mode, 0);
sector_common(++)
return 1;
}
@ -639,8 +625,7 @@ int sector_lout(struct burn_write_opts *o, unsigned char control, int mode)
return 0;
subcode_lout(o, control, subs);
convert_subs(o, mode, subs, data);
if (sector_headers(o, data, mode, 0) <= 0)
return 0;
sector_headers(o, data, mode, 0);
sector_common(++)
return 1;
}
@ -675,8 +660,7 @@ int sector_data(struct burn_write_opts *o, struct burn_track *t, int psub)
t->entry->control, 1, &t->isrc, psub);
convert_subs(o, t->mode, subs, data);
if (sector_headers(o, data, t->mode, 0) <= 0)
return 0;
sector_headers(o, data, t->mode, 0);
sector_common(++)
return 1;
}
@ -727,31 +711,118 @@ int sector_headers_is_ok(struct burn_write_opts *o, int mode)
return 0;
}
/* ts A90830 : changed return type to int
@return 0= failure
1= success
*/
int sector_headers(struct burn_write_opts *o, unsigned char *out,
void sector_headers(struct burn_write_opts *o, unsigned char *out,
int mode, int leadin)
{
struct burn_drive *d = o->drive;
unsigned int crc;
int min, sec, frame;
int modebyte = -1;
/* ts A61009 */
#if 1
int ret;
ret = sector_headers_is_ok(o, mode);
if (ret != 2)
return (!! ret);
return;
modebyte = 1;
/* ts A90830 : lec.c is copied from cdrdao.
I have no idea yet how lec.c implements the Reed-Solomon encoding
which is described in ECMA-130 for CD-ROM.
So this got removed for now.
*/
libdax_msgs_submit(libdax_messenger, o->drive->global_index,
0x0002010a,
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
"Raw CD write modes are not supported", 0, 0);
return 0;
#else
if (mode & BURN_AUDIO) /* no headers for "audio" */
return;
if (o->write_type == BURN_WRITE_SAO)
return;
/* ts A61031 */
if (o->write_type == BURN_WRITE_TAO)
return;
if (mode & BURN_MODE1)
modebyte = 1;
#endif
/* ts A61009 : now ensured by burn_disc_write_is_ok() */
/* a ssert(modebyte == 1); */
out[0] = 0;
memset(out + 1, 0xFF, 10); /* sync */
out[11] = 0;
if (leadin) {
burn_lba_to_msf(d->rlba, &min, &sec, &frame);
out[12] = dec_to_bcd(min) + 0xA0;
out[13] = dec_to_bcd(sec);
out[14] = dec_to_bcd(frame);
out[15] = modebyte;
} else {
burn_lba_to_msf(d->alba, &min, &sec, &frame);
out[12] = dec_to_bcd(min);
out[13] = dec_to_bcd(sec);
out[14] = dec_to_bcd(frame);
out[15] = modebyte;
}
if (mode & BURN_MODE1) {
crc = crc_32(out, 2064);
out[2064] = crc & 0xFF;
crc >>= 8;
out[2065] = crc & 0xFF;
crc >>= 8;
out[2066] = crc & 0xFF;
crc >>= 8;
out[2067] = crc & 0xFF;
}
if (mode & BURN_MODE1) {
memset(out + 2068, 0, 8);
parity_p(out);
parity_q(out);
}
scramble(out);
}
#if 0
void process_q(struct burn_drive *d, unsigned char *q)
{
unsigned char i[5];
int mode;
mode = q[0] & 0xF;
/* burn_print(12, "mode: %d : ", mode);*/
switch (mode) {
case 1:
/* burn_print(12, "tno = %d : ", q[1]);
burn_print(12, "index = %d\n", q[2]);
*/
/* q[1] is the track number (starting at 1) q[2] is the index
number (starting at 0) */
#warning this is totally bogus
if (q[1] - 1 > 99)
break;
if (q[2] > d->toc->track[q[1] - 1].indices) {
burn_print(12, "new index at %d\n", d->alba);
d->toc->track[q[1] - 1].index[q[2]] = d->alba;
d->toc->track[q[1] - 1].indices++;
}
break;
case 2:
/* XXX dont ignore these */
break;
case 3:
/* burn_print(12, "ISRC data in mode 3 q\n");*/
i[0] = isrc[(q[1] << 2) >> 2];
/* burn_print(12, "0x%x 0x%x 0x%x 0x%x 0x%x\n", q[1], q[2], q[3], q[4], q[5]);
burn_print(12, "ISRC - %c%c%c%c%c\n", i[0], i[1], i[2], i[3], i[4]);
*/
break;
default:
/* ts A61009 : if reactivated then witout Assert */
a ssert(0);
}
}
#endif
/* this needs more info. subs in the data? control/adr? */
@ -764,14 +835,12 @@ int sector_headers(struct burn_write_opts *o, unsigned char *out,
*/
int sector_identify(unsigned char *data)
{
/*
scramble(data);
/*
check mode byte for 1 or 2
test parity to see if it's a valid sector
if invalid, return BURN_MODE_AUDIO;
else return mode byte (what about mode 2 formless? heh)
*/
return BURN_MODE1;
}

View File

@ -22,7 +22,7 @@ int sector_data(struct burn_write_opts *, struct burn_track *t, int psub);
/* ts A61009 */
int sector_headers_is_ok(struct burn_write_opts *o, int mode);
int sector_headers(struct burn_write_opts *, unsigned char *,
void sector_headers(struct burn_write_opts *, unsigned char *,
int mode, int leadin);
void subcode_user(struct burn_write_opts *, unsigned char *s,
unsigned char tno, unsigned char control,

View File

@ -1,5 +1,6 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
#include <assert.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
@ -552,26 +553,11 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
if (c->page) {
ccb->csio.data_ptr = c->page->data;
if (c->dir == FROM_DRIVE) {
/* ts A90430 : Ticket 148 , by jwehle :
"On ... FreeBSD 6.4 which has a usb memory reader in
addition to a ATAPI DVD burner sg_issue_command
will hang while the SCSI bus is being scanned"
*/
if (c->dxfer_len >= 0)
ccb->csio.dxfer_len = c->dxfer_len;
else
ccb->csio.dxfer_len = BUFFER_SIZE;
ccb->csio.dxfer_len = BUFFER_SIZE;
/* touch page so we can use valgrind */
memset(c->page->data, 0, BUFFER_SIZE);
} else {
/* ts A90430 */
/* a ssert(c->page->bytes > 0); */
if (c->page->bytes <= 0) {
c->error = 1;
return 0;
}
assert(c->page->bytes > 0);
ccb->csio.dxfer_len = c->page->bytes;
}
} else {

View File

@ -158,13 +158,6 @@ static char linux_ata_device_family[80] = {"/dev/hd%c"};
static int linux_ata_enumerate_verbous = 0;
/* The waiting time before eventually retrying a failed SCSI command.
Before each retry wait Libburn_sg_linux_retry_incR longer than with
the previous one.
*/
#define Libburn_sg_linux_retry_usleeP 100000
#define Libburn_sg_linux_retry_incR 100000
/** PORTING : ------ libburn portable headers and definitions ----- */
@ -477,7 +470,7 @@ static int sg_fcntl_lock(int *fd, char *fd_name, int l_type, int verbous)
/* ts A60926 */
static int sg_open_drive_fd(char *fname, int scan_mode)
{
int open_mode = O_RDWR, fd, tries= 0;
int open_mode = O_RDWR, fd;
char msg[81];
/* ts A70409 : DDLP-B */
@ -509,8 +502,7 @@ static int sg_open_drive_fd(char *fname, int scan_mode)
"libburn: experimental: O_EXCL= %d , O_NDELAY= %d\n",
!!(open_mode&O_EXCL),!!(open_mode&O_NDELAY));
*/
try_open:;
fd = open(fname, open_mode);
if (fd == -1) {
/* <<< debugging
@ -519,17 +511,6 @@ try_open:;
fname,errno);
*/
if (errno == EBUSY) {
tries++;
/* <<< debugging
fprintf(stderr,
"\nlibburn_DEBUG: EBUSY , tries= %d\n", tries);
*/
if (tries < 4) {
usleep(2000000);
goto try_open;
}
sg_handle_busy_device(fname, errno);
return -1;
@ -812,7 +793,7 @@ static int is_scsi_drive(char *fname, int *bus_no, int *host_no,
if (ret<=0) {
if (linux_sg_enumerate_debug)
fprintf(stderr, "cannot lock siblings\n");
sg_handle_busy_device(fname, 0);
sg_handle_busy_device(fname, 0);
return 0;
}
/* the final occupation will be done in sg_grab() */
@ -1718,9 +1699,8 @@ static int sg_log_err(struct command *c, FILE *fp,
*/
int sg_issue_command(struct burn_drive *d, struct command *c)
{
int done = 0, no_c_page = 0, usleep_time, i;
int done = 0, no_c_page = 0;
int err;
time_t start_time;
sg_io_hdr_t s;
#ifdef Libburn_log_sg_commandS
@ -1804,8 +1784,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
}
s.usr_ptr = c;
start_time = time(NULL);
for(i = 0; !done; i++) {
do {
err = ioctl(d->fd, SG_IO, &s);
/* ts A61010 */
@ -1839,22 +1818,10 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
c->error = 1;
break;
}
/* ts A90921 :
Calming down retries and breaking up endless cycle
*/
usleep_time = Libburn_sg_linux_retry_usleeP +
i * Libburn_sg_linux_retry_incR;
if (time(NULL) + usleep_time / 1000000 - start_time >
s.timeout / 1000 + 1) {
c->error = 1;
goto ex;
}
usleep(usleep_time);
} else {
done = 1;
}
}
} while (!done);
/* ts A61106 */
ex:;
@ -1899,8 +1866,6 @@ int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
};
struct my_scsi_idlun idlun;
/* valgrind called idlun unitialized because it is blind for ioctl */
memset(&idlun, 0, sizeof(struct my_scsi_idlun));
l = strlen(linux_ata_device_family) - 2;
if (l > 0 && strncmp(path, linux_ata_device_family, l) == 0

View File

@ -291,7 +291,7 @@ void spc_allow(struct burn_drive *d)
}
/*
ts A70518 - A90603 : Do not call with *alloc_len < 10
ts A70518 : Do not call with *alloc_len < 8
*/
/** flag&1= do only inquire alloc_len */
static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
@ -303,19 +303,13 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
unsigned char *page;
struct command c;
struct burn_speed_descriptor *sd;
char msg[BURN_DRIVE_ADR_LEN + 160];
/* ts A61225 : 1 = report about post-MMC-1 speed descriptors */
static int speed_debug = 0;
if (*alloc_len < 10)
if (*alloc_len < 8)
return 0;
/* ts A90602 : Clearing mdata before command execution */
m = d->mdata;
m->valid = 0;
burn_mdata_free_subs(m);
memset(&buf, 0, sizeof(buf));
scsi_init_command(&c, SPC_MODE_SENSE, sizeof(SPC_MODE_SENSE));
/*
@ -334,11 +328,12 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
d->issue_command(d, &c);
if (c.error) {
memset(&buf, 0, sizeof(buf));
m->valid = -1;
d->mdata->valid = -1;
was_error = 1;
}
size = c.page->data[0] * 256 + c.page->data[1];
m = d->mdata;
page = c.page->data + 8;
/* ts A61225 :
@ -347,28 +342,18 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
in MMC-3 6.3.11 there are at least 28 bytes plus a variable length
set of speed descriptors. In MMC-5 E.11 it is declared "legacy".
*/
/* ts A90603 :
SPC-1 8.3.3 enumerates mode page format bytes from 0 to n and
defines Page Length as (n-1).
*/
page_length = page[1];
old_alloc_len = *alloc_len;
*alloc_len = page_length + 10;
*alloc_len = page_length + 8;
if (flag & 1)
return !was_error;
if (page_length + 10 > old_alloc_len)
page_length = old_alloc_len - 10;
/* ts A90602 : 20 asserts page[21]. (see SPC-1 8.3.3) */
if (page_length < 20) {
m->valid = -1;
sprintf(msg, "MODE SENSE page 2A too short: %s : %d",
d->devname, page_length);
libdax_msgs_submit(libdax_messenger, d->global_index,
0x0002016e, LIBDAX_MSGS_SEV_DEBUG,
LIBDAX_MSGS_PRIO_LOW, msg, 0, 0);
if (page_length + 8 > old_alloc_len)
page_length = old_alloc_len - 8;
if (page_length < 22)
return 0;
}
m->valid = 0;
burn_mdata_free_subs(m);
m->buffer_size = page[12] * 256 + page[13];
m->dvdram_read = page[2] & 32;
@ -399,13 +384,12 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
m->min_end_lba = 0x7fffffff;
m->max_end_lba = 0;
if (!was_error)
m->valid = 1;
m->valid = 1;
mmc_get_configuration(d);
/* ts A61225 : end of MMC-1 , begin of MMC-3 */
if (page_length < 30) /* no write speed descriptors ? */
if (page_length < 32) /* no write speed descriptors ? */
goto try_mmc_get_performance;
m->cur_write_speed = page[28] * 256 + page[29];
@ -429,12 +413,12 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
}
for (i = 0; i < num_write_speeds; i++) {
speed = page[32 + 4 * i + 2] * 256 + page[32 + 4 * i + 3];
speed = page[32 + 4*i + 2] * 256 + page[32 + 4*i + 3];
if (speed_debug)
fprintf(stderr,
"LIBBURN_DEBUG: write speed #%d = %d kB/s (rc %d)\n",
i, speed, page[32 + 4 * i + 1] & 7);
i, speed, page[32 + 4*i +1] & 7);
/* ts A61226 */
ret = burn_speed_descriptor_new(&(d->mdata->speed_descriptors),
@ -447,7 +431,7 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
strcpy(sd->profile_name,
d->current_profile_text);
}
sd->wrc = (( page[32 + 4 * i + 1] & 7 ) == 1 );
sd->wrc = (( page[32 + 4*i +1] & 7 ) == 1 );
sd->write_speed = speed;
}
@ -463,31 +447,19 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
m->min_write_speed, m->max_write_speed);
try_mmc_get_performance:;
if (m->cdrw_write || page_length >= 32) {
/* ts A90823:
One has to avoid U3 enhanced memory sticks here. On my
SuSE 10.2 a SanDisk Cruzer 4GB stalls at the second occasion
of ACh GET PERFORMANCE. (The first one is obviously called
by the OS at plug time.)
This pseudo drive returns no write capabilities and a page
length of 28. MMC-3 describes page length 32. Regrettably
MMC-2 prescribes a page length of 26. Here i have to trust
m->cdrw_write to reliably indicate any MMC-2 burner.
*/
ret = mmc_get_write_performance(d);
if (ret > 0 && speed_debug)
fprintf(stderr,
"LIBBURN_DEBUG: ACh min_write_speed = %d , max_write_speed = %d\n",
m->min_write_speed, m->max_write_speed);
}
ret = mmc_get_write_performance(d);
if (ret > 0 && speed_debug)
fprintf(stderr,
"LIBBURN_DEBUG: ACh min_write_speed = %d , max_write_speed = %d\n",
m->min_write_speed, m->max_write_speed);
return !was_error;
}
void spc_sense_caps(struct burn_drive *d)
{
int alloc_len, start_len = 30, ret;
int alloc_len, start_len = 22, ret;
if (mmc_function_spy(d, "sense_caps") <= 0)
return;
@ -948,18 +920,6 @@ enum response scsi_error_msg(struct burn_drive *d, unsigned char *sense,
sprintf(msg,
"Logical unit is in the process of becoming ready");
return RETRY;
case 0x08:
if (*key != 4)
break;
if (*ascq == 0)
sprintf(msg, "Logical unit communication failure");
else if (*ascq == 1)
sprintf(msg, "Logical unit communication timeout");
else if (*ascq == 2)
sprintf(msg, "Logical unit communication parity error");
else if (*ascq == 3)
sprintf(msg, "Logical unit communication crc error");
return RETRY;
case 0x09:
if (*key != 4)
break;
@ -1233,8 +1193,6 @@ static char *scsi_command_name(unsigned int c, int flag)
return "PREVENT/ALLOW MEDIA REMOVAL";
case 0x23:
return "READ FORMAT CAPACITIES";
case 0x25:
return "READ CAPACITY";
case 0x28:
return "READ(10)";
case 0x2a:
@ -1271,8 +1229,6 @@ static char *scsi_command_name(unsigned int c, int flag)
return "WRITE(12)";
case 0xac:
return "GET PERFORMANCE";
case 0xad:
return "READ DISC STRUCTURE";
case 0xb6:
return "SET STREAMING";
case 0xbb:

View File

@ -281,23 +281,13 @@ void burn_track_define_data(struct burn_track *t, int offset, int tail,
/* ts A61024 */
int burn_track_set_byte_swap(struct burn_track *t, int swap_source_bytes)
{
if (swap_source_bytes != 0 && swap_source_bytes != 1)
if(swap_source_bytes!=0 && swap_source_bytes!=1)
return 0;
t->swap_source_bytes = swap_source_bytes;
return 1;
}
/* ts A90911 : API */
int burn_track_set_cdxa_conv(struct burn_track *t, int value)
{
if (value < 0 || value > 1)
return 0;
t->cdxa_conversion = value;
return 1;
}
void burn_track_set_isrc(struct burn_track *t, char *country, char *owner,
unsigned char year, unsigned int serial)
{
@ -368,11 +358,6 @@ int burn_track_get_sectors(struct burn_track *t)
int sectors, seclen;
seclen = burn_sector_length(t->mode);
if (t->cdxa_conversion == 1)
/* ts A90911 : will read blocks of 2056 bytes and write 2048 */
seclen += 8;
if (t->source != NULL) /* ts A80808 : mending sigsegv */
size = t->offset + t->source->get_size(t->source) + t->tail;
else if(t->entry != NULL) {

View File

@ -64,10 +64,6 @@ struct burn_track
/* ts A61024 */
/** Byte swapping on source data stream : 0=none , 1=pairwise */
int swap_source_bytes;
/* ts A90910 : conversions from CD XA prepared input */
int cdxa_conversion; /* 0=none, 1=remove -xa1 headers (first 8 bytes)*/
};
struct burn_session

View File

@ -40,9 +40,7 @@ struct buffer
Added 4096 bytes reserve against possible buffer overflows.
(Changed in sector.c buffer flush test from >= to > BUFFER_SIZE .
This can at most cause a 1 sector overlap. Sometimes an offset
of 16 byte is applied to the output data (in some RAW mode). )
burn_write_opts.cdxa_conversion can imply an offset of 8 bytes.
*/
of 16 byte is applied to the output data (in some RAW mode). ) */
unsigned char data[BUFFER_SIZE + 4096];
int sectors;
int bytes;
@ -163,11 +161,6 @@ struct burn_drive
char current_profile_text[80];
int current_is_cd_profile;
int current_is_supported_profile;
/* ts A90603 */
int current_is_guessed_profile;
/* ts A90815 */
unsigned char all_profiles[256];
int num_profiles;
/* ts A70128 : MMC-to-MMC feature info from 46h for DVD-RW.
Quite internal. Regard as opaque :)
@ -218,18 +211,7 @@ struct burn_drive
int stream_recording_start;
/* ts A61218 from 51h READ DISC INFORMATION */
int last_lead_in;
int last_lead_out;
int bg_format_status; /* 0=needs format start, 1=needs format restart*/
int disc_type; /* 0="CD-DA or CD-ROM", 0x10="CD-I", 0x20="CD-ROM XA" */
unsigned int disc_id; /* a "32 bit binary integer" */
char disc_bar_code[9];
int disc_app_code;
int disc_info_valid; /* bit0= disc_type , bit1= disc_id ,
bit2= disc_bar_code , bit3= disc_app_code
bit4= URU bit is set (= unrestricted use)
bit5= Erasable bit was set in reply
*/
/* ts A70108 from 23h READ FORMAT CAPACITY mmc5r03c.pdf 6.24 */
int format_descr_type; /* 1=unformatted, 2=formatted, 3=unclear */
@ -330,11 +312,6 @@ struct burn_drive
void (*eject) (struct burn_drive *);
void (*load) (struct burn_drive *);
int (*start_unit) (struct burn_drive *);
/* ts A90824 : Calming down noisy drives */
int (*stop_unit) (struct burn_drive *);
int is_stopped;
void (*read_disc_info) (struct burn_drive *);
void (*read_sectors) (struct burn_drive *,
int start,

View File

@ -4,7 +4,6 @@
/* #include <a ssert.h> */
#include <stdlib.h>
#include <stdio.h>
/* ts A80914 : This is unneeded. Version info comes from libburn.h.
#include "v ersion.h"
@ -57,264 +56,3 @@ void burn_version(int *major, int *minor, int *micro)
*minor = burn_header_version_minor;
*micro = burn_header_version_micro;
}
struct cd_mid_record {
char *manufacturer;
int m_li;
int s_li;
int f_li;
int m_lo;
int s_lo;
int f_lo;
char *other_brands;
};
typedef struct cd_mid_record cd_mid_record_t;
/* ts A90902 */
/** API
@param flag Bitfield for control purposes,
bit0= append "(aka %s)",other_brands to reply
*/
char *burn_guess_cd_manufacturer(int m_li, int s_li, int f_li,
int m_lo, int s_lo, int f_lo, int flag)
{
static cd_mid_record_t mid_list[]= {
{"SKC", 96, 40, 0, 0, 0, 0, ""},
{"Ritek Corp" , 96, 43, 30, 0, 0, 0, ""},
{"TDK / Ritek" , 97, 10, 0, 0, 0, 0, "TRAXDATA"},
{"TDK Corporation" , 97, 15, 0, 0, 0, 0, ""},
{"Ritek Corp" , 97, 15, 10, 0, 0, 0, "7-plus, Aopen, PONY, Power Source, TDK, TRAXDATA, HiCO, PHILIPS, Primdisc, Victor.JVC, OPTI STORAGE, Samsung"},
{"Mitsubishi Chemical Corporation" , 97, 15, 20, 0, 0, 0, ""},
{"Nan-Ya Plastics Corporation" , 97, 15, 30, 0, 0, 0, "Hatron, MMore, Acer, LITEON"},
{"Delphi" , 97, 15, 50, 0, 0, 0, ""},
{"Shenzhen SG&SAST" , 97, 16, 20, 0, 0, 0, ""},
{"Moser Baer India Limited" , 97, 17, 0, 0, 0, 0, "EMTEC, Intenso, YAKUMO, PLATINUM, Silver Circle"},
{"SKY media Manufacturing SA" , 97, 17, 10, 0, 0, 0, ""},
{"Wing" , 97, 18, 10, 0, 0, 0, ""},
{"DDT" , 97, 18, 20, 0, 0, 0, ""},
{"Daxon Technology Inc. / Acer" , 97, 22, 60, 0, 0, 0, "Maxmax, Diamond Data, BenQ, gold, SONY"},
{"Taiyo Yuden Company Limited" , 97, 24, 0, 0, 0, 0, "Maxell, FUJIFILM, SONY"},
{"Sony Corporation" , 97, 24, 10, 0, 0, 0, "LeadData, Imation"},
{"Computer Support Italcard s.r.l" , 97, 24, 20, 0, 0, 0, ""},
{"Unitech Japan Inc." , 97, 24, 30, 0, 0, 0, ""},
{"MPO, France" , 97, 25, 0, 0, 0, 0, "TDK"},
{"Hitachi Maxell Ltd." , 97, 25, 20, 0, 0, 0, ""},
{"Infodisc Technology Co,Ltd." , 97, 25, 30, 0, 0, 0, "MEMOREX, SPEEDA, Lead data"},
{"Xcitec" , 97, 25, 60, 0, 0, 0, ""},
{"Fornet International Pte Ltd" , 97, 26, 0, 0, 0, 0, "COMPUSA, Cdhouse"},
{"Postech Corporation" , 97, 26, 10, 0, 0, 0, "Mr.Platinum"},
{"SKC Co Ltd." , 97, 26, 20, 0, 0, 0, "Infinite"},
{"Fuji Photo Film Co,Ltd." , 97, 26, 40, 0, 0, 0, ""},
{"Lead Data Inc." , 97, 26, 50, 0, 0, 0, "SONY, Gigastorage, MIRAGE"},
{"CMC Magnetics Corporation" , 97, 26, 60, 0, 0, 0, "Daxon, Verbatim, Memorex, Bi-Winner, PLEXTOR, YAMAHA, Melody, Office DEPOT, Philips, eMARK, imation, HyperMedia, Samsung, Shintaro, Techworks"},
{"Ricoh Company Limited" , 97, 27, 0, 0, 0, 0, "Sony, Digital Storage, Csita"},
{"Plasmon Data Systems Ltd" , 97, 27, 10, 0, 0, 0, "Ritek, TDK, EMTEC, ALPHAPET, MANIA"},
{"Princo Corporation" , 97, 27, 20, 0, 0, 0, ""},
{"Pioneer" , 97, 27, 30, 0, 0, 0, ""},
{"Eastman Kodak Company" , 97, 27, 40, 0, 0, 0, ""},
{"Mitsui Chemicals Inc." , 97, 27, 50, 0, 0, 0, "MAM-A, TDK"},
{"Ricoh Company Limited" , 97, 27, 60, 0, 0, 0, "Ritek"},
{"Gigastorage Corporation" , 97, 28, 10, 0, 0, 0, "MaxMax, Nan-Ya"},
{"Multi Media Masters&Machinary SA" , 97, 28, 20, 0, 0, 0, "King, Mmirex"},
{"Ritek Corp" , 97, 31, 0, 0, 0, 0, "TDK"},
{"Grand Advance Technology Sdn. Bhd." , 97, 31, 30, 0, 0, 0, ""},
{"TDK Corporation" , 97, 32, 00, 0, 0, 0, ""},
{"Prodisc Technology Inc." , 97, 32, 10, 0, 0, 0, "Smartbuy, Mitsubishi, Digmaster, LG, Media Market"},
{"Mitsubishi Chemical Corporation" , 97, 34, 20, 0, 0, 0, "YAMAHA, Verbatim"},
{"Mitsui Chemicals Inc." , 97, 48, 50, 0, 0, 0, ""},
{"TDK Corporation" , 97, 49, 0, 0, 0, 0, ""},
{"", 0, 0, 0, 0, 0, 0, ""}
};
int i, f_li_0;
char buf[1024];
char *result = NULL;
f_li_0 = f_li - (f_li % 10);
for (i = 0; mid_list[i].manufacturer[0]; i++) {
if (m_li == mid_list[i].m_li &&
s_li == mid_list[i].s_li &&
(f_li_0 == mid_list[i].f_li || f_li == mid_list[i].f_li))
break;
}
if (mid_list[i].manufacturer[0] == 0) {
sprintf(buf, "Unknown CD manufacturer. Please report code '%2.2dm%2.2ds%2.2df/%2.2dm%2.2ds%2.2df', the human readable brand, size, and speed to scdbackup@gmx.net.", m_li, s_li, f_li, m_lo, s_lo, f_lo);
result = strdup(buf);
return result;
}
/* Compose, allocate and copy result */
if ((flag & 1) && mid_list[i].other_brands[0]) {
sprintf(buf, "%s (aka %s)",
mid_list[i].manufacturer, mid_list[i].other_brands);
result = strdup(buf);
} else
result = strdup(mid_list[i].manufacturer);
return result;
}
/* ts A90904 */
struct dvd_mid_record {
char *mc1;
char *mc2;
int mc1_sig_len;
char *manufacturer;
};
typedef struct dvd_mid_record dvd_mid_record_t;
/* ts A90904 */
char *burn_guess_manufacturer(int prf,
char *media_code1, char *media_code2, int flag)
{
int i, l = 0, m_li, s_li, f_li, m_lo, s_lo, f_lo;
char buf[1024];
char *result = NULL, *cpt;
/* Important Note: media_code1 and media_code2 are supposed to be
encoded by burn_util_make_printable_word().
Especially: ' ' -> '_' , {"_%/" unprintables -> %XY)
*/
static dvd_mid_record_t mid_list[]= {
{"AML", "", 8, "UML"},
{"BeAll", "", 5, "BeAll Developers, Inc."},
{"CMC", "", 3, "CMC Magnetics Corporation"},
{"DAXON", "", 5, "Daxon Technology Inc. / Acer"},
{"Daxon", "", 5, "Daxon Technology Inc. / Acer"},
{"FUJI", "", 4, "Fujifilm Holdings Corporation"},
{"INFODISC", "", 8, "New Star Digital Co., Ltd."},
{"INFOME", "", 6, "InfoMedia Inc."},
{"ISMMBD", "", 6, "Info Source Multi Media Ltd."},
{"JVC", "", 3, "JVC Limited"},
{"KIC01RG", "", 7, "AMC"},
{"LD", "", 8, "Lead Data Inc."},
{"LGE", "", 3, "LG Electronics"},
{"MAM", "", 8, "Mitsui Advanced Media, Inc. Europe"},
{"MAXELL", "", 6, "Hitachi Maxell Ltd."},
{"MBI", "", 3, "Moser Baer India Limited"},
{"MCC", "", 8, "Mitsubishi Chemical Corporation"},
{"MCI", "", 8, "Mitsui Chemicals Inc."},
{"MEI", "", 3, "Panasonic Corporation"},
{"MKM", "", 3, "Mitsubishi Kagaku Media Co."},
{"MMC", "", 8, "Mitsubishi Kagaku Media Co."},
{"MXL", "", 8, "Hitachi Maxell Ltd."},
{"NANYA", "", 5, "Nan-Ya Plastics Corporation"},
{"NSD", "", 8, "NESA International Inc."},
{"OPTODISC", "", 8, "Optodisc Technology Corporation"},
{"OTCBDR", "", 8, "Optodisc Technology Corporation"},
{"PHILIP", "", 8, "Moser Baer India Limited"},
{"PHILIPS", "", 8, "Philips"},
{"PRINCO", "", 6, "Princo Corporation"},
{"PRODISC", "", 7, "Prodisc Technology Inc."},
{"Prodisc", "", 7, "Prodisc Technology Inc."},
{"PVC", "", 3, "Pioneer"},
{"RICOHJPN", "", 8, "Ricoh Company Limited"},
{"RITEK", "", 5, "Ritek Corp"},
{"SONY", "", 4, "Sony Corporation"},
{"TDK", "", 3, "TDK Corporation"},
{"TT", "", 8, "TDK Corporation"},
{"TY", "", 8, "Taiyo Yuden Company Limited"},
{"TYG", "", 3, "Taiyo Yuden Company Limited"},
{"UTJR001", "", 7, "Unifino Inc."},
{"VERBAT", "", 5, "Mitsubishi Kagaku Media Co."},
{"YUDEN", "", 5, "Taiyo Yuden Company Limited"},
{"", "", 0, ""}
};
if (media_code2 != NULL &&
(prf == -1 || prf == 0x09 || prf == 0x0A)) {
if (strlen(media_code2) == 9 && media_code1[0] == '9' &&
media_code1[2] == 'm' && media_code1[5] == 's' &&
media_code1[8] == 'f' &&
strchr(media_code1, '%') == NULL) {
sscanf(media_code1, "%dm%ds%df", &m_li, &s_li, &f_li);
sscanf(media_code2, "%dm%ds%df", &m_lo, &s_lo, &f_lo);
if (m_li >= 96 && m_li <= 97 && m_lo > 0) {
result = burn_guess_cd_manufacturer(
m_li, s_li, f_li, m_lo, s_lo, f_lo, 0);
return result;
}
}
}
/* DVD-R do not keep manufacturer id apart from media id.
Some manufacturers use a blank as separator which would now be '_'.
*/
cpt = strchr(media_code1, '_');
if (cpt != NULL && (prf == -1 || prf == 0x11 || prf == 0x13 ||
prf == 0x14 || prf == 0x15))
l = cpt - media_code1;
for (i = 0; mid_list[i].mc1[0]; i++) {
if (strncmp(mid_list[i].mc1, media_code1,
mid_list[i].mc1_sig_len) == 0)
break;
if (l > 0)
if (strncmp(mid_list[i].mc1, media_code1, l) == 0)
break;
}
if (mid_list[i].mc1[0] == 0) {
sprintf(buf, "Unknown DVD/BD manufacturer. Please report code '%s/%s', the human readable brand, size, and speed to scdbackup@gmx.net.",
media_code1, media_code2);
result = strdup(buf);
return result;
}
result = strdup(mid_list[i].manufacturer);
return result;
}
/* ts A90905 */
/* Make *text a single printable word */
/* IMPORTANT: text must be freeable memory !
@param flag bit0=escape '/' too
bit1=(overrides bit0) do not escape " _/"
*/
int burn_util_make_printable_word(char **text, int flag)
{
int i, esc_add = 0, ret;
char *wpt, *rpt, *new_text = NULL;
if (flag & 2)
flag &= ~1;
for (i = 0; (*text)[i]; i++) {
rpt = (*text) + i;
if (*rpt < 32 || *rpt > 126 || *rpt == 96 ||
((*rpt == '_' || *rpt == '%') && (!(flag & 2))) ||
(*rpt == '/' && (flag & 1)))
esc_add += 2;
}
if (esc_add) {
new_text = calloc(strlen(*text) + esc_add + 1, 1);
if (new_text == NULL) {
ret = -1;
goto ex;
}
wpt = new_text;
for (i = 0; (*text)[i]; i++) {
rpt = (*text) + i;
if (*rpt < 32 || *rpt > 126 || *rpt == 96 ||
((*rpt == '_' || *rpt == '%') && (!(flag & 2))) ||
(*rpt == '/' && (flag & 1))) {
sprintf(wpt, "%%%2.2X",
(unsigned int) *((unsigned char *) rpt));
wpt+= 3;
} else
*(wpt++) = *rpt;
}
*wpt = 0;
free(*text);
*text = new_text;
}
if (!(flag & 2))
for (i = 0; (*text)[i]; i++)
if ((*text)[i] == ' ')
(*text)[i] = '_';
ret = 1;
ex:
return ret;
}

View File

@ -5,7 +5,4 @@ char *burn_strdup(char *s);
char *burn_strndup(char *s, int n);
/* ts A90905 */
int burn_util_make_printable_word(char **text, int flag);
#endif

View File

@ -36,6 +36,7 @@
#include "crc.h"
#include "debug.h"
#include "init.h"
#include "lec.h"
#include "toc.h"
#include "util.h"
#include "sg.h"
@ -769,18 +770,8 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
libdax_msgs_submit(libdax_messenger, d->global_index, 0x000002,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
msg, 0, 0);
/* ts A91003 */
if (nwa < d->nwa) {
libdax_msgs_submit(libdax_messenger, d->global_index,
0x00020173,
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
"Drive tells NWA smaller than last written address",
0, 0);
d->sync_cache(d);
return 0;
}
d->nwa = nwa;
if (nwa > d->nwa)
d->nwa = nwa;
}
@ -877,14 +868,8 @@ ex:;
d->sync_cache(d);
/* ts A61030 */
/* ts A91003 :
At least in simulation mode this causes NWA=0 for the
next track. cdrecord does not use CLOSE TRACK at all but
ends the tracks by SYNCHRONIZE CACHE alone.
*/
if (!o->simulate)
if (burn_write_close_track(o, s, tnum) <= 0)
ret = 0;
if (burn_write_close_track(o, s, tnum) <= 0)
ret = 0;
}
return ret;
}
@ -899,8 +884,8 @@ int burn_disc_write_is_ok(struct burn_write_opts *o, struct burn_disc *disc,
for (i = 0; i < disc->sessions; i++)
for (t = 0; t < disc->session[i]->tracks; t++)
if (sector_headers_is_ok(
o, disc->session[i]->track[t]->mode) != 1)
if (!sector_headers_is_ok(
o, disc->session[i]->track[t]->mode))
goto bad_track_mode_found;
return 1;
bad_track_mode_found:;
@ -1751,14 +1736,6 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
o->obs_pad = 1; /* fill-up track's last 32k buffer */
}
/* <<< test only : Does this increase effective speed with USB ?
ts A90801 : 64kB: speed with 16x DVD-R is 12 rather than 8
>>> next try is 128 kB
o->obs = 128 * 1024;
*/
sprintf(msg, "dvd/bd Profile= %2.2Xh , obs= %d , obs_pad= %d",
d->current_profile, o->obs, o->obs_pad);
libdax_msgs_submit(libdax_messenger, d->global_index, 0x00000002,
@ -1868,13 +1845,6 @@ int burn_stdio_read_source(struct burn_source *source, char *buf, int bufsize,
int burn_stdio_write(int fd, char *buf, int count, struct burn_drive *d,
int flag)
{
if (d->cancel)
return 0;
/*
fprintf(stderr, "libburn_DEBUG: write(%d, %lX, %d)\n",
fd, (unsigned long) buf, count);
*/
if (write(fd, buf, count) != count) {
libdax_msgs_submit(libdax_messenger, d->global_index,
0x00020148,
@ -2123,7 +2093,7 @@ void burn_disc_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
{
struct cue_sheet *sheet;
struct burn_drive *d = o->drive;
struct buffer *buffer_mem = o->drive->buffer;
struct buffer buf, *buffer_mem = o->drive->buffer;
struct burn_track *lt, *t;
int first = 1, i, ret, lba, nwa = 0, multi_mem;
off_t default_size;
@ -2143,33 +2113,8 @@ void burn_disc_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
else
d->stream_recording_start = 0;
d->buffer = calloc(sizeof(struct buffer), 1);
if (d->buffer == NULL)
goto fail_wo_sync;
/* >>> ts A90321
d->buffer = &buf;
memset(d->buffer, 0, sizeof(struct buffer));
fprintf(stderr, "libburn_DEBUG: d->buffer = %lX , size = %d\n",
(unsigned long) d->buffer, (int) sizeof(struct buffer));
calloc() seems not to have the desired effect. valgrind warns:
==18251== Syscall param write(buf) points to uninitialised byte(s)
==18251== at 0x5071DEB: (within /lib64/libpthread-2.5.so)
==18251== by 0x4723FA: burn_stdio_write (write.c:1850)
==18251== by 0x4725DC: burn_stdio_mmc_write (write.c:1894)
==18251== by 0x483B7A: get_sector (sector.c:229)
==18251== by 0x484F11: sector_data (sector.c:639)
==18251== by 0x4729FE: burn_stdio_write_track (write.c:2012)
==18251== by 0x472CF4: burn_stdio_write_sync (write.c:2072)
==18251== by 0x472E8D: burn_disc_write_sync (write.c:2125) <<< we are here
==18251== by 0x460254: write_disc_worker_func (async.c:514)
==18251== by 0x506B09D: start_thread (in /lib64/libpthread-2.5.so)
==18251== by 0x55484CC: clone (in /lib64/libc-2.5.so)
*/
d->rlba = -150;
d->toc_temp = 9;
@ -2367,8 +2312,6 @@ fail_wo_sync:;
d->busy = BURN_DRIVE_IDLE;
ex:;
d->do_stream_recording = 0;
if (d->buffer != NULL)
free((char *) d->buffer);
d->buffer = buffer_mem;
return;
}

View File

@ -106,7 +106,7 @@ int libburner_aquire_drive(char *drive_adr, int *driveno)
ret = libburner_aquire_by_adr(drive_adr);
else
ret = libburner_aquire_by_driveno(driveno);
if (ret <= 0 || *driveno <= 0)
if (ret <= 0)
return ret;
burn_disc_get_profile(drive_list[0].drive, &current_profile,
current_profile_name);