Compare commits
4 Commits
1.1.8
...
ZeroEightE
Author | SHA1 | Date | |
---|---|---|---|
6718f0ab78 | |||
7fb96f4e76 | |||
89a2944dad | |||
e2a085ef20 |
@ -1,7 +1,7 @@
|
||||
Derek Foreman <derek@signalmarketing.com> and Ben Jansens <xor@orodu.net>
|
||||
Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
|
||||
Mario Danic <mario.danic@gmail.com>, Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (C) 2006-2011 Mario Danic, Thomas Schmitt
|
||||
Copyright (C) 2006-2010 Mario Danic, Thomas Schmitt
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
61
ChangeLog
61
ChangeLog
@ -1,64 +1,5 @@
|
||||
libburn-1.1.8.tar.gz Mon Nov 21 2011
|
||||
SVN trunk (to become libburn-0.9.0.pl00.tar.gz)
|
||||
===============================================================================
|
||||
* Bug fix: Misinterpreted mode page 2A if block descriptors are present
|
||||
* Enabled recognition of QEMU DVD-ROM 0.12
|
||||
* Avoiding to intermediately close and open drive device file
|
||||
* New API call burn_drive_re_assess()
|
||||
|
||||
libburn-1.1.6.tar.gz Tue Sep 27 2011
|
||||
===============================================================================
|
||||
* Bug fix: stdio sizes > 4 TB - 32 kB caused integer rollover
|
||||
* Worked around a collision with Linux udev which lets links vanish
|
||||
|
||||
libburn-1.1.4.tar.gz Sun Aug 07 2011
|
||||
===============================================================================
|
||||
* Bug fix: Some drives return -150 as NWA of blank CD, rather than 0.
|
||||
libburn forwarded this misleading information to the application.
|
||||
* Bug fix: Some drives returned wrong CD sizes after having burned DVD-R
|
||||
* Bug fix: Empty ROM drive was mistaken to hold an unsuitable disc
|
||||
* Bug fix: Avoiding to load speed descriptor list twice
|
||||
* New API call burn_lookup_device_link()
|
||||
* New API call burn_disc_get_phys_format_info()
|
||||
* New cdrskin option --device_links
|
||||
|
||||
Release 1.1.2 was skipped to get back in sync with libisoburn.
|
||||
|
||||
libburn-1.1.0.pl01.tar.gz Mon Jun 20 2011
|
||||
===============================================================================
|
||||
* Bug fix: libburn-1.1.0 compiled only on Linux, FreeBSD, and Solaris
|
||||
|
||||
libburn-1.1.0.tar.gz Sat Jun 18 2011
|
||||
===============================================================================
|
||||
* Bug fix: burn_disc_format() on DVD-RW issued wrong block size with type 00h
|
||||
* New API call burn_disc_next_track_is_damaged()
|
||||
* New API call burn_disc_close_damaged()
|
||||
* Dropped suffix .plXY from tarball name
|
||||
|
||||
Release 1.0.8 was skipped to get back in sync with libisofs and libisoburn.
|
||||
|
||||
libburn-1.0.6.pl00.tar.gz Sat Apr 9 2011
|
||||
===============================================================================
|
||||
* Burning DVD-R DAO with 2 kB size granularity rather than 32 kB
|
||||
* New API call burn_allow_drive_role_4()
|
||||
|
||||
libburn-1.0.4.pl00.tar.gz Thu Mar 3 2011
|
||||
===============================================================================
|
||||
* Bug fix: Read-only file descriptors were classified as write-only pseudo
|
||||
drives
|
||||
|
||||
libburn-1.0.2.pl00.tar.gz Wed Feb 23 2011
|
||||
===============================================================================
|
||||
* Removed compilation obstacles on Solaris 9.
|
||||
* Improved recognition of non-seekable stdio pseudo-drives.
|
||||
|
||||
libburn-1.0.0.pl00.tar.gz Sun Jan 16 2011
|
||||
===============================================================================
|
||||
* Allowed umask to create stdio-drive files with rw-permissions for all
|
||||
* cdrskin now refuses to burn if the foreseeable size exceeds media capacity
|
||||
|
||||
libburn-0.9.0.pl00.tar.gz Wed Dec 08 2010
|
||||
===============================================================================
|
||||
* Regression fix: SCSI reply data logging was disabled in release 0.8.6
|
||||
|
||||
libburn-0.8.8.pl00.tar.gz Wed Oct 20 2010
|
||||
===============================================================================
|
||||
|
@ -6,7 +6,6 @@ pkgconfigdir=$(LIBBURNIA_PKGCONFDIR)
|
||||
libincludedir=$(includedir)/libburn
|
||||
|
||||
lib_LTLIBRARIES = libburn/libburn.la
|
||||
ACLOCAL_AMFLAGS = -I ./
|
||||
|
||||
## ========================================================================= ##
|
||||
|
||||
@ -118,9 +117,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 - B10808
|
||||
## cdrskin construction site - ts A60816 - B01020
|
||||
cdrskin_cdrskin_CPPFLAGS = -Ilibburn
|
||||
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_1_1_8
|
||||
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_8_8
|
||||
|
||||
# cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
|
||||
# ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking
|
||||
@ -197,8 +196,6 @@ EXTRA_DIST = \
|
||||
version.h.in \
|
||||
doc/comments \
|
||||
doc/doxygen.conf.in \
|
||||
doc/cookbook.txt \
|
||||
doc/mediainfo.txt \
|
||||
README \
|
||||
AUTHORS \
|
||||
CONTRIBUTORS \
|
||||
|
117
README
117
README
@ -6,12 +6,12 @@ This all is under GPL.
|
||||
------------------------------------------------------------------------------
|
||||
libburn-project.org
|
||||
By Mario Danic <mario.danic@gmail.com> and Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (C) 2006-2011 Mario Danic, Thomas Schmitt
|
||||
Copyright (C) 2006-2010 Mario Danic, Thomas Schmitt
|
||||
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-1.1.8.tar.gz
|
||||
http://files.libburnia-project.org/releases/libburn-0.8.8.pl00.tar.gz
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
@ -19,10 +19,10 @@ Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
|
||||
|
||||
From tarball
|
||||
|
||||
Obtain libburn-1.1.8.tar.gz, take it to a directory of your choice and do:
|
||||
Obtain libburn-0.8.8.pl00.tar.gz, take it to a directory of your choice and do:
|
||||
|
||||
tar xzf libburn-1.1.8.tar.gz
|
||||
cd libburn-1.1.8
|
||||
tar xzf libburn-0.8.8.pl00.tar.gz
|
||||
cd libburn-0.8.8
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
|
||||
@ -92,21 +92,6 @@ Make sure to re-compile all source files after running ./configure
|
||||
make install
|
||||
|
||||
|
||||
Linux only:
|
||||
|
||||
libburn tries to avoid a collision with udev's drive examination by waiting
|
||||
0.1 seconds before opening the device file for a longer time, after udev
|
||||
might have been alarmed by drive scanning activities.
|
||||
The waiting time can be set at ./configure time with microsecond granularity.
|
||||
E.g. 2 seconds:
|
||||
CFLAGS="$CFLAGS -DLibburn_udev_wait_useC=2000000"
|
||||
./configure ...options...
|
||||
Waiting can be disabled by zero waiting time:
|
||||
CFLAGS="$CFLAGS -DLibburn_udev_wait_useC=0"
|
||||
Alternatively, libburn can try to be nice by opening the device file,
|
||||
closing it immediately, waiting, and only then opening it for real:
|
||||
CFLAGS="$CFLAGS -DLibburn_udev_extra_open_cyclE -DLibburn_udev_wait_useC=500000"
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
An important part of the project, libisofs, is hosted in a bzr repository at
|
||||
@ -125,7 +110,7 @@ See README files there.
|
||||
|
||||
libburnia-project.org is an open-source software project for reading, mastering
|
||||
and writing optical discs.
|
||||
For now this means CD media, all DVD media, all BD media.
|
||||
For now this means CD media, all DVD media except DVD-R DL, all BD media.
|
||||
|
||||
The project comprises of several more or less interdependent parts which
|
||||
together strive to be a usable foundation for application development.
|
||||
@ -195,8 +180,7 @@ The project components (list subject to growth, hopefully):
|
||||
sparse emulation of cdrecord and a more laborate one of mkisofs.
|
||||
All features of xorriso are also available via a C language API
|
||||
of libisoburn.
|
||||
A static compilation of xorriso and the libraries is dedicated
|
||||
to the GNU Operating System. See xorriso/README_gnu_xorriso .
|
||||
See xorriso/README for more.
|
||||
|
||||
- "test" is a collection of application gestures and examples given by the
|
||||
authors of the library features. The burn API example of libburn
|
||||
@ -579,92 +563,7 @@ Project history as far as known to me:
|
||||
with non-zero offset for ISO 9660 images on USB sticks, improves mkisofs
|
||||
emulation, and fixes a regression which existed since version 0.4.2.
|
||||
|
||||
- Wed Oct 20 2010 libburn-0.8.8 can report the used amount of BD spare blocks.
|
||||
|
||||
- Sat Oct 23 2010 Version 0.6.38 of libisofs can use libjte to produce jigdo
|
||||
files along with the ISO image. Further filesystem images may be appended
|
||||
as MBR partitions 1 to 4. The capability was added to produce boot blocks
|
||||
for computers with MIPS CPU.
|
||||
|
||||
- Tue Oct 26 2010 Release 0.6.4.pl00 of libisoburn and xorriso makes use of
|
||||
the new libisofs capabilities.
|
||||
|
||||
- Wed Dec 08 2010 libburn-0.9.0 fixes a regression with SCSI command logging.
|
||||
|
||||
- Fri Dec 10 2010 Version 0.6.40 of libisofs makes the prediction of the
|
||||
emerging image size less expensive and is able to make images bootable
|
||||
for SUN SPARC systems.
|
||||
|
||||
- Sun Dec 12 2010 Release 0.6.6.pl00 of libisoburn and xorriso can read ISO
|
||||
images which were copied to a different start address than they were prepared
|
||||
for.
|
||||
|
||||
- Mon Jan 17 2011 we go for release 1.0.0. This does not indicate a
|
||||
technological overhaul but shall emphasize the maturity of the software.
|
||||
libisofs-1.0.0 fixes a bug about the length of ECMA-119 directory names and
|
||||
is ready to allow untranslated ECMA-119 names (violating the specs).
|
||||
libburn-1.0.0.pl00 allows umask to create stdio-drive files with
|
||||
rw-permissions for all. cdrskin now refuses to burn if the foreseeable size
|
||||
exceeds media capacity
|
||||
libisoburn-1.0.0.pl00 allows to create an ISO 9660:1999 directory tree,
|
||||
improved the emulation fidelity of command -as mkisofs, lowered the default
|
||||
abort threshold for xorriso batch mode, and increased that threshold for
|
||||
xorriso dialog mode.
|
||||
|
||||
- Wed Feb 23 2011 release 1.0.2:
|
||||
libisofs fixes several bugs and introduces the capability to copy files
|
||||
inside the ISO filesystem.
|
||||
libburn removed a compilation obstacle on Solaris 9 and improved recognition
|
||||
of stdio pseudo-drives.
|
||||
libisoburn and xorriso fix bugs and make use of the new libisofs capability.
|
||||
xorriso improves its mkisofs emulation.
|
||||
|
||||
- Thu Mar 10 2011 release 1.0.4:
|
||||
Several bugs were fixed in the libraries and in the mkisofs emulation of
|
||||
xorriso. This emulation xorrisofs has now an own man page and info document.
|
||||
|
||||
- Sat Apr 09 2011 release 1.0.6:
|
||||
libburn refined its representation of emulated drives. The size alignment
|
||||
of DVD DAO is now 2 kB rather than 32 kB. libisofs produces Joliet names of
|
||||
up to 103 characters. xorriso fixes two bugs and makes use of the library
|
||||
improvements.
|
||||
|
||||
- Thu Apr 14 2011 release libisoburn-1.0.8:
|
||||
A bug in the mkisofs emulation of xorriso could cause options to be ignored.
|
||||
The problem was freshly introduced with libisoburn-1.0.6.
|
||||
|
||||
- Fri May 13 2011 release libisofs-1.0.8:
|
||||
Fixes a few rarely occurring bugs that have been found during the last month.
|
||||
|
||||
- Sat Jun 18 2011 release 1.1.0:
|
||||
The consumption of stack memory was reduced. Statical program analysis found
|
||||
some rarely occuring memory leaks. Several small bugs were fixed.
|
||||
The suffix .plXY was dropped from tarball names of libburn and libisoburn.
|
||||
|
||||
- Mon Jun 20 2011 patch release libburn-1.1.0.pl01:
|
||||
libburn-1.1.0 compiled only on Linux, FreeBSD, and Solaris, but not on
|
||||
other X/Open compliant systems.
|
||||
|
||||
- Fri Jul 08 2011 release libisofs-1.1.2 and libisoburn-1.1.2:
|
||||
A severe regression was fixed in libisoburn and xorriso, which was introduced
|
||||
with version 1.0.6. It caused ISO 9660 images to be unreadable if they were
|
||||
written to a write-only random-access file. E.g. by: xorrisofs ... >image.iso
|
||||
|
||||
- Mon Aug 08 2011 release 1.1.4:
|
||||
Several bugs were fixed in libburn. The most severe of them prevented xorriso
|
||||
on some drives from burning mountable ISO 9660 images to CD media.
|
||||
New means to list drives by their udev symbolic links help to deal with
|
||||
the non-persistent drive addresses on modern GNU/Linux.
|
||||
|
||||
- Tue Sep 27 2011 release 1.1.6:
|
||||
libisoburn now comes with a test suite. See releng/README. Bugs were fixed
|
||||
in several rarely used features. Processing of ACL and extattr was enabled
|
||||
on FreeBSD. Workarounds try to cope with vanishing udev links on GNU/Linux.
|
||||
|
||||
- Mon Nov 21 2011 release libburn-1.1.8 and libisoburn-1.1.8:
|
||||
libburn avoids to close and open drive device files while operating on them.
|
||||
xorriso emulation mode xorrecord now has an own manual. libburn and xorriso
|
||||
were prepared to operate on qemu virtio-blk-pci devices.
|
||||
- Wed Oct 20 2010 libburn-0.8.8 brings minor improvements.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
aclocal -I .
|
||||
aclocal
|
||||
libtoolize --copy --force
|
||||
autoconf
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
cdrskin. By Thomas Schmitt <scdbackup@gmx.net>
|
||||
Integrated sub project of libburnia-project.org but also published via:
|
||||
http://scdbackup.sourceforge.net/cdrskin_eng.html
|
||||
http://scdbackup.sourceforge.net/cdrskin-1.1.8.tar.gz
|
||||
http://scdbackup.sourceforge.net/cdrskin-0.8.8.pl00.tar.gz
|
||||
|
||||
Copyright (C) 2006-2011 Thomas Schmitt, provided under GPL version 2 or later.
|
||||
Copyright (C) 2006-2010 Thomas Schmitt, provided under GPL version 2 or later.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -26,10 +26,10 @@ By using this software you agree to the disclaimer at the end of this text
|
||||
|
||||
Compilation, First Glimpse, Installation
|
||||
|
||||
Obtain cdrskin-1.1.8.tar.gz, take it to a directory of your choice and do:
|
||||
Obtain cdrskin-0.8.8.pl00.tar.gz, take it to a directory of your choice and do:
|
||||
|
||||
tar xzf cdrskin-1.1.8.tar.gz
|
||||
cd cdrskin-1.1.8
|
||||
tar xzf cdrskin-0.8.8.pl00.tar.gz
|
||||
cd cdrskin-0.8.8
|
||||
|
||||
Within that directory execute:
|
||||
|
||||
@ -438,22 +438,6 @@ It will not read startup files, will abort on option dev_translation= ,
|
||||
will not have a fifo buffer, and will not be able to put out help texts or
|
||||
debugging messages.
|
||||
|
||||
|
||||
Linux only:
|
||||
|
||||
libburn tries to avoid a collision with udev's drive examination by waiting
|
||||
0.1 seconds before opening the device file for a longer time, after udev
|
||||
might have been alarmed by drive scanning activities.
|
||||
The waiting time can be set at ./configure time with microsecond granularity.
|
||||
E.g. 2 seconds:
|
||||
CFLAGS="$CFLAGS -DLibburn_udev_wait_useC=2000000"
|
||||
./configure ...options...
|
||||
Waiting can be disabled by zero waiting time:
|
||||
CFLAGS="$CFLAGS -DLibburn_udev_wait_useC=0"
|
||||
Alternatively, libburn can try to be nice by opening the device file,
|
||||
closing it immediately, waiting, and only then opening it for real:
|
||||
CFLAGS="$CFLAGS -DLibburn_udev_extra_open_cyclE -DLibburn_udev_wait_useC=500000"
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
System Dependend Drive Permission Examples
|
||||
@ -576,7 +560,7 @@ contributions in a due way.
|
||||
Based on and sub project of:
|
||||
libburnia-project.org
|
||||
By Mario Danic <mario.danic@gmail.com> and Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (C) 2006-2011 Mario Danic, Thomas Schmitt
|
||||
Copyright (C) 2006-2010 Mario Danic, Thomas Schmitt
|
||||
|
||||
libburnia-project.org is inspired by and in other components still containing
|
||||
parts of
|
||||
|
@ -38,9 +38,8 @@ original="./libburn_svn_release.tgz"
|
||||
# My changes are in $changes , mainly in $changes/cdrskin
|
||||
changes="./libburn-release"
|
||||
|
||||
skin_release="1.1.8"
|
||||
patch_level=""
|
||||
# patch_level=".pl00"
|
||||
skin_release="0.8.8"
|
||||
patch_level=".pl00"
|
||||
skin_rev="$skin_release""$patch_level"
|
||||
|
||||
# The result directory and the name of the result tarballs
|
@ -38,7 +38,7 @@ original="./libburn_svn.tgz"
|
||||
# My changes are in $changes , mainly in $changes/cdrskin
|
||||
changes="./libburn-develop"
|
||||
|
||||
skin_release="1.1.9"
|
||||
skin_release="0.8.9"
|
||||
patch_level=""
|
||||
skin_rev="$skin_release""$patch_level"
|
||||
|
@ -634,7 +634,7 @@ return: <0 = error , 0 = idle , 1 = did some work
|
||||
*/
|
||||
{
|
||||
double buffer_space;
|
||||
int can_read,can_write= 0,ret,did_work= 0,idx,sod, eop_idx;
|
||||
int can_read,can_write= 0,ret,did_work= 0,idx,sod,eop_is_near,eop_idx;
|
||||
|
||||
buffer_space= Cdrfifo_tell_buffer_space(o,0);
|
||||
if(o->dest_fd>=0) if(FD_ISSET((o->dest_fd),wts)) {
|
||||
@ -644,7 +644,7 @@ return: <0 = error , 0 = idle , 1 = did some work
|
||||
if(o->read_idx+can_write > o->buffer_size)
|
||||
can_write= o->buffer_size - o->read_idx;
|
||||
if(o->follow_up_fd_idx>=0) {
|
||||
Cdrfifo_eop_adjust(o,&can_write,&eop_idx,0);
|
||||
eop_is_near= Cdrfifo_eop_adjust(o,&can_write,&eop_idx,0);
|
||||
if(can_write<=0)
|
||||
goto after_write;
|
||||
}
|
||||
@ -1039,9 +1039,9 @@ int Test_mixed_bs(char **paths, int path_count,
|
||||
bit0= debugging verbousity
|
||||
*/
|
||||
{
|
||||
int fd_in[100],fd_out[100],ret,pipe_fds[100][2];
|
||||
int fd_in[100],fd_out[100],ret,pipe_fds[100][2],real_out[100];
|
||||
int i,iv,stall_counter= 0,cycle_counter= 0.0;
|
||||
char target_path[80];
|
||||
char buf[10240], target_path[80];
|
||||
double in_counter, out_counter, prev_in= -1.0, prev_out= -1.0;
|
||||
struct CdrfifO *ff_in= NULL, *ff_out= NULL;
|
||||
|
||||
@ -1109,8 +1109,9 @@ int Test_multi(int fs_size, double speed_limit, double interval, int flag)
|
||||
bit0= debugging verbousity
|
||||
*/
|
||||
{
|
||||
int fd_in[4],fd_out[4],ret,pipe_fds[4][2];
|
||||
int fd_in[4],fd_out[4],ret,pipe_fds[4][2],real_out[4],pipe_idx;
|
||||
int i,iv;
|
||||
char buf[10240];
|
||||
struct CdrfifO *ff1= NULL,*ff2= NULL;
|
||||
|
||||
/* open four pairs of fds */
|
||||
|
@ -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 "Jul 28, 2011"
|
||||
.TH CDRSKIN 1 "Aug 21, 2010"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
@ -256,7 +256,7 @@ that it has to be formatted again. If in doubt, just give it a try.
|
||||
.br
|
||||
The drives, CD, DVD, or BD 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 or \fBcdrskin --device_links\fP.
|
||||
by a run of \fBcdrskin --devices\fP.
|
||||
.br
|
||||
On Linux, they are device files which traditionally do not offer
|
||||
w-permissions for normal users. Because libburn needs rw-permission,
|
||||
@ -512,7 +512,7 @@ cdrskin will not write CD-ROM XA but rather strip the header bytes and write as
|
||||
.TP
|
||||
.BI dev= target
|
||||
Set the address of the drive to use. Valid are at least the
|
||||
addresses listed with options --devices or --device_links,
|
||||
addresses listed with option --devices,
|
||||
X,Y,Z addresses listed with option -scanbus,
|
||||
ATA:X,Y,Z addresses listed with options dev=ATA -scanbus,
|
||||
and volatile libburn drive numbers (numbering starts at "0").
|
||||
@ -554,9 +554,6 @@ which appear to be in the desired blank or format state already.
|
||||
This option enables a burn run with option -dummy even if libburn believes
|
||||
that drive and media will not simulate the write mode but will write for real.
|
||||
.br
|
||||
It enables a burn run where cdrskin expects to exceed the available media
|
||||
capacity.
|
||||
.br
|
||||
.B Caution:
|
||||
Use this only when in urgent need.
|
||||
.TP
|
||||
@ -881,17 +878,6 @@ Number dev='Devicefile' rw-Permissions : 'Vendor' 'Model'
|
||||
Number and Devicefile can both be used with option dev=, but number is
|
||||
volatile (numbering changes if drives become busy).
|
||||
.TP
|
||||
.BI \--device_links
|
||||
Like --devices, but presenting the drives with addresses of symbolic links
|
||||
which point to the actual device files.
|
||||
.br
|
||||
Modern GNU/Linux systems may shuffle drive addresses from boot to boot.
|
||||
The udev daemon is supposed to create links which always point to the
|
||||
same drive, regardless of its system address.
|
||||
Option --device_links shows the addresses of such links if they begin
|
||||
by "/dev/dvd" or "/dev/cd".
|
||||
Precedence is: "dvdrw", "cdrw", "dvd", "cdrom", "cd".
|
||||
.TP
|
||||
.BI direct_write_amount= size
|
||||
Do not write a session with tracks but rather make an appropriate number of
|
||||
direct write operations with no preparations. Flushing the drive buffer will
|
||||
@ -1147,7 +1133,7 @@ Wether this leads to senseful behavior depends on operating system and kernel.
|
||||
.TP
|
||||
.BI drive_scsi_dev_family= sr | scd | sg
|
||||
Linux specific: Select a SCSI device file family to be scanned for by
|
||||
options --devices, --device_links and -scanbus.
|
||||
options --devices and -scanbus.
|
||||
Normally this is /dev/sgN on kernel versions < 2.6 and /dev/srN
|
||||
on kernels >= 2.6 . This option allows to explicitly override that default
|
||||
in order to meet other programs at a common device file for each drive.
|
||||
@ -1253,7 +1239,7 @@ cdrskin -scanbus
|
||||
.br
|
||||
cdrskin dev=ATA -scanbus
|
||||
.br
|
||||
cdrskin --device_links
|
||||
cdrskin --devices
|
||||
.SS
|
||||
.B Get info about a particular drive or loaded media:
|
||||
.br
|
||||
|
1458
cdrskin/cdrskin.c
1458
cdrskin/cdrskin.c
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@
|
||||
|
||||
<HEAD>
|
||||
<META NAME="description" CONTENT="cdrskin, a limited cdrecord compatibility wrapper for libburn">
|
||||
<META NAME="keywords" CONTENT="cdrskin, libburn, libburnia, burn, CD, DVD, BD, linux, recording, burning, CD-R, CD-RW, DVD-R, DVD-R DL, DVD-RW, DVD+RW, DVD+R, DVD+R DL, DVD-RAM, BD-RE, BD-R, cdrecord, compatible, scdbackup">
|
||||
<META NAME="keywords" CONTENT="cdrskin, libburn, libburnia, burn, CD, DVD, linux, recording, burning, CD-R, CD-RW, DVD-R, DVD-R DL, DVD-RW, DVD+RW, DVD+R, DVD+R DL, DVD-RAM, BD-RE, BD-R, cdrecord, compatible, scdbackup">
|
||||
<META NAME="robots" CONTENT="follow">
|
||||
<TITLE>cdrskin homepage english</TITLE>
|
||||
</HEAD>
|
||||
@ -65,7 +65,7 @@ connected via SCSI, PATA (aka IDE, ATA), USB, or SATA.
|
||||
GPL software included:<BR>
|
||||
</H2>
|
||||
<DL>
|
||||
<DT>libburn-1.1.8</DT>
|
||||
<DT>libburn-0.8.8</DT>
|
||||
<DD>(founded by Derek Foreman and Ben Jansens,
|
||||
developed and maintained since August 2006 by
|
||||
Thomas Schmitt from team of libburnia-project.org)
|
||||
@ -200,15 +200,8 @@ Standalone ISO 9660 multi-session CD/DVD/BD tool
|
||||
<P>
|
||||
<DL>
|
||||
<DT>Download as source code (see README):</DT>
|
||||
<DD><A HREF="cdrskin-1.1.8.tar.gz">cdrskin-1.1.8.tar.gz</A>
|
||||
(870 KB).
|
||||
</DD>
|
||||
<DD><A HREF="cdrskin-1.1.8.tar.gz.sig">cdrskin-1.1.8.tar.gz.sig</A></DD>
|
||||
<DD>
|
||||
(detached GPG signature for verification by
|
||||
<KBD>gpg --verify cdrskin-1.1.8.tar.gz.sig cdrskin-1.1.8.tar.gz</KBD>
|
||||
<BR>
|
||||
after <KBD>gpg --keyserver keys.gnupg.net --recv-keys ABC0A854</KBD>).
|
||||
<DD><A HREF="cdrskin-0.8.8.pl00.tar.gz">cdrskin-0.8.8.pl00.tar.gz</A>
|
||||
(850 KB).
|
||||
</DD>
|
||||
<DD>
|
||||
The cdrskin tarballs are source code identical with libburn releases
|
||||
@ -257,24 +250,19 @@ cdrskin_0.4.2.pl00-x86-suse9_0-static.tar.gz</A>, (310 KB), -static compiled,
|
||||
<HR>
|
||||
|
||||
<P>
|
||||
Enhancements towards previous stable version cdrskin-1.1.6:
|
||||
Enhancements towards previous stable version cdrskin-0.8.6.pl00:
|
||||
<UL>
|
||||
<LI>
|
||||
Avoiding to intermediately close and open drive device file
|
||||
</LI>
|
||||
<LI>
|
||||
Enabled recognition of QEMU DVD-ROM 0.12
|
||||
Reporting spare area use of formatted BD media.
|
||||
</LI>
|
||||
<!--
|
||||
<LI>none</LI>
|
||||
-->
|
||||
</UL>
|
||||
|
||||
Bug fixes towards cdrskin-1.1.6:
|
||||
Bug fixes towards cdrskin-0.8.6.pl00:
|
||||
<UL>
|
||||
<LI>
|
||||
Misinterpreted mode page 2A if block descriptors are present
|
||||
</LI>
|
||||
<LI>none</LI>
|
||||
<!--
|
||||
<LI>none</LI>
|
||||
-->
|
||||
@ -284,8 +272,8 @@ Misinterpreted mode page 2A if block descriptors are present
|
||||
|
||||
<P>
|
||||
<DL>
|
||||
<DT><H3>Development snapshot, version 1.1.9 :</H3></DT>
|
||||
<DD>Enhancements towards current stable version 1.1.8:
|
||||
<DT><H3>Development snapshot, version 0.8.9 :</H3></DT>
|
||||
<DD>Enhancements towards current stable version 0.8.8.pl00:
|
||||
<UL>
|
||||
<LI>none yet</LI>
|
||||
<!--
|
||||
@ -295,7 +283,7 @@ Misinterpreted mode page 2A if block descriptors are present
|
||||
</UL>
|
||||
</DD>
|
||||
|
||||
<DD>Bug fixes towards cdrskin-1.1.8:
|
||||
<DD>Bug fixes towards cdrskin-0.8.8.pl00:
|
||||
<UL>
|
||||
<LI>none yet</LI>
|
||||
<!--
|
||||
@ -305,10 +293,10 @@ Misinterpreted mode page 2A if block descriptors are present
|
||||
</DD>
|
||||
|
||||
<DD> </DD>
|
||||
<DD><A HREF="README_cdrskin_devel">README 1.1.9</A>
|
||||
<DD><A HREF="cdrskin__help_devel">cdrskin-1.1.9 --help</A></DD>
|
||||
<DD><A HREF="cdrskin_help_devel">cdrskin-1.1.9 -help</A></DD>
|
||||
<DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 1.1.9)</A></DD>
|
||||
<DD><A HREF="README_cdrskin_devel">README 0.8.9</A>
|
||||
<DD><A HREF="cdrskin__help_devel">cdrskin_0.8.9 --help</A></DD>
|
||||
<DD><A HREF="cdrskin_help_devel">cdrskin_0.8.9 -help</A></DD>
|
||||
<DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.8.9)</A></DD>
|
||||
<DD> </DD>
|
||||
<DT>Maintainers of cdrskin unstable packages please use SVN of
|
||||
<A HREF="http://libburnia-project.org"> libburnia-project.org</A></DT>
|
||||
@ -328,8 +316,8 @@ admins with full system souvereignty.</DT>
|
||||
<A HREF="README_cdrskin_devel">upcoming README</A> ):
|
||||
</DD>
|
||||
<DD>
|
||||
<A HREF="cdrskin-1.1.9.tar.gz">cdrskin-1.1.9.tar.gz</A>
|
||||
(870 KB).
|
||||
<A HREF="cdrskin-0.8.9.tar.gz">cdrskin-0.8.9.tar.gz</A>
|
||||
(850 KB).
|
||||
</DD>
|
||||
|
||||
<!-- This is not offered any more since spring 2008
|
||||
@ -478,11 +466,10 @@ First of all: this relationship is single sided, as cdrskin has to be aware of
|
||||
cdrecord but not vice versa.
|
||||
<BR>
|
||||
<BR>
|
||||
I was a long time user of cdrecord and it worked fine for me.
|
||||
I am a long time user of cdrecord and it works fine for me.
|
||||
Especially i do appreciate its write mode -tao which allows to pipe arbitrary
|
||||
data on CD and CD-RW via stdin. cdrecord is reliable, versatile and well
|
||||
maintained. So for me - there would be no problem with using it for
|
||||
burning CDs.
|
||||
maintained. So for me - there would be no problem with it.
|
||||
<BR>
|
||||
But the author of cdrecord and the Linux kernel people foster a very hostile
|
||||
relationship. Ok, that's their business, not mine (or ours if you are with me).
|
||||
|
@ -1 +1 @@
|
||||
#define Cdrskin_timestamP "2011.11.20.100001"
|
||||
#define Cdrskin_timestamP "2010.10.20.120001"
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -200,10 +200,9 @@ main()
|
||||
Cleanup_set_handlers(&demoapp,(Cleanup_app_handler_T) Demo_app_handler,0);
|
||||
|
||||
if(1) { /* change to 0 in order to wait for external signals */
|
||||
char *cpt= NULL, c= ' ';
|
||||
char *cpt= NULL,c;
|
||||
printf("Intentionally provoking SIGSEGV ...\n");
|
||||
c= *cpt;
|
||||
printf("Strange: The system ignored a SIGSEGV: c= %u\n", (unsigned int) c);
|
||||
} else {
|
||||
printf("killme: %d\n",getpid());
|
||||
sleep(3600);
|
||||
|
@ -1,14 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# compile_cdrskin.sh
|
||||
# Copyright 2005 - 2011 Thomas Schmitt, scdbackup@gmx.net, GPL
|
||||
# Copyright 2005 - 2010 Thomas Schmitt, scdbackup@gmx.net, GPL
|
||||
# to be executed within ./libburn-* resp ./cdrskin-*
|
||||
|
||||
debug_opts="-O2"
|
||||
def_opts=
|
||||
largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1"
|
||||
fifo_opts=""
|
||||
libvers="-DCdrskin_libburn_1_1_8"
|
||||
libvers="-DCdrskin_libburn_0_8_8"
|
||||
|
||||
# To be used if Makefile.am uses libburn_libburn_la_CFLAGS
|
||||
# burn="libburn/libburn_libburn_la-"
|
||||
@ -19,7 +19,7 @@ libdax_msgs_o="$burn"libdax_msgs.o
|
||||
libdax_audioxtr_o="$burn"libdax_audioxtr.o
|
||||
do_strip=0
|
||||
static_opts=
|
||||
warn_opts="-Wall -Wextra -Wno-unused-parameter"
|
||||
warn_opts="-Wall"
|
||||
libcdio=
|
||||
fifo_source="cdrskin/cdrfifo.c"
|
||||
compile_cdrskin=1
|
||||
@ -41,21 +41,31 @@ do
|
||||
elif test "$i" = "-compile_dewav"
|
||||
then
|
||||
compile_dewav=1
|
||||
elif test "$i" = "-libburn_1_1_8"
|
||||
elif test "$i" = "-cvs_A60220"
|
||||
then
|
||||
libvers="-DCdrskin_libburn_1_1_8"
|
||||
libvers="-DCdrskin_libburn_cvs_A60220_tS"
|
||||
libdax_audioxtr_o=
|
||||
libdax_msgs_o="$burn"message.o
|
||||
cleanup_src_or_obj="-DCleanup_has_no_libburn_os_H cdrskin/cleanup.c"
|
||||
elif test "$i" = "-libburn_0_8_8"
|
||||
then
|
||||
libvers="-DCdrskin_libburn_0_8_8"
|
||||
libdax_audioxtr_o="$burn"libdax_audioxtr.o
|
||||
libdax_msgs_o="$burn"libdax_msgs.o
|
||||
cleanup_src_or_obj="$burn"cleanup.o
|
||||
elif test "$i" = "-libburn_svn"
|
||||
then
|
||||
libvers="-DCdrskin_libburn_1_1_9"
|
||||
libvers="-DCdrskin_libburn_0_8_9"
|
||||
libdax_audioxtr_o="$burn"libdax_audioxtr.o
|
||||
libdax_msgs_o="$burn"libdax_msgs.o
|
||||
cleanup_src_or_obj="$burn"cleanup.o
|
||||
elif test "$i" = "-newapi" -o "$i" = "-experimental"
|
||||
then
|
||||
def_opts="$def_opts -DCdrskin_new_api_tesT"
|
||||
elif test "$i" = "-oldfashioned"
|
||||
then
|
||||
def_opts="$def_opts -DCdrskin_oldfashioned_api_usE"
|
||||
cleanup_src_or_obj="-DCleanup_has_no_libburn_os_H cdrskin/cleanup.c"
|
||||
elif test "$i" = "-no_largefile"
|
||||
then
|
||||
largefile_opts=
|
||||
@ -99,7 +109,7 @@ do
|
||||
echo "Options:"
|
||||
echo " -compile_cdrfifo compile program cdrskin/cdrfifo."
|
||||
echo " -compile_dewav compile program test/dewav without libburn."
|
||||
echo " -libburn_1_1_8 set macro to match libburn-1.1.8"
|
||||
echo " -libburn_0_8_8 set macro to match libburn-0.8.8"
|
||||
echo " -libburn_svn set macro to match current libburn-SVN."
|
||||
echo " -dvd_obs_64k 64 KB default size for DVD/BD writing."
|
||||
echo " -use_libcdio link with -lcdio because libburn uses it."
|
||||
@ -107,6 +117,7 @@ do
|
||||
echo " -use_no_libburn_fifo use cdrfifo even for single track non-CD"
|
||||
echo " -use_no_cdrfifo always use fifo of libburn and never cdrfifo"
|
||||
echo " -experimental use newly introduced libburn features."
|
||||
echo " -oldfashioned use pre-0.2.2 libburn features only."
|
||||
echo " -do_diet produce capability reduced lean version."
|
||||
echo " -do_strip apply program strip to compiled programs."
|
||||
echo " -g produce debuggable programm."
|
||||
|
@ -59,7 +59,6 @@ then
|
||||
-e 's/<\/body>/<BR><HR><FONT SIZE=-1><CENTER>(HTML generated from '"$manpage"'.1 on '"$(date)"' by '$(basename "$0")' )<\/CENTER><\/FONT><\/body>/' \
|
||||
-e 's/See section FILES/See section <A HREF="#FILES">FILES<\/A>/' \
|
||||
-e 's/See section EXAMPLES/See section <A HREF="#EXAMPLES">EXAMPLES<\/A>/' \
|
||||
-e 's/−/-/g' \
|
||||
<"$2" >"$htmlpage"
|
||||
|
||||
set +x
|
||||
|
44
configure.ac
44
configure.ac
@ -1,4 +1,4 @@
|
||||
AC_INIT([libburn], [1.1.8], [http://libburnia-project.org])
|
||||
AC_INIT([libburn], [0.8.8], [http://libburnia-project.org])
|
||||
AC_PREREQ([2.50])
|
||||
dnl AC_CONFIG_HEADER([config.h])
|
||||
|
||||
@ -8,9 +8,8 @@ AC_CANONICAL_TARGET
|
||||
LIBBURNIA_SET_FLAGS
|
||||
|
||||
AM_INIT_AUTOMAKE([subdir-objects])
|
||||
AC_CONFIG_MACRO_DIR([./])
|
||||
|
||||
dnl Notes about version numbers and .so numbers:
|
||||
dnl Notes by ts A71207 - B00630 :
|
||||
dnl
|
||||
dnl Regrettably the meaning of the various version types was misunderstood
|
||||
dnl before version 0.4.1.
|
||||
@ -86,15 +85,6 @@ dnl 0.8.2 = libburn.so.4.47.0
|
||||
dnl 0.8.4 = libburn.so.4.49.0
|
||||
dnl 0.8.6 = libburn.so.4.51.0
|
||||
dnl 0.8.8 = libburn.so.4.53.0
|
||||
dnl 0.9.0 = libburn.so.4.55.0
|
||||
dnl 1.0.0 = libburn.so.4.57.0
|
||||
dnl 1.0.2 = libburn.so.4.59.0
|
||||
dnl 1.0.4 = libburn.so.4.61.0
|
||||
dnl 1.0.6 = libburn.so.4.63.0
|
||||
dnl 1.1.0 = libburn.so.4.65.0
|
||||
dnl 1.1.4 = libburn.so.4.67.0
|
||||
dnl 1.1.6 = libburn.so.4.69.0
|
||||
dnl 1.1.8 = libburn.so.4.71.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.
|
||||
@ -118,8 +108,8 @@ dnl
|
||||
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=1
|
||||
BURN_MINOR_VERSION=1
|
||||
BURN_MAJOR_VERSION=0
|
||||
BURN_MINOR_VERSION=8
|
||||
BURN_MICRO_VERSION=8
|
||||
BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
|
||||
|
||||
@ -131,14 +121,14 @@ AC_SUBST(BURN_VERSION)
|
||||
dnl Libtool versioning
|
||||
LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
|
||||
dnl
|
||||
dnl This is the release version libburn-1.1.8
|
||||
dnl This is the release version libburn-0.8.8
|
||||
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 = 75 - 71 = 4 . Linux library name = libburn.so.4.71.0
|
||||
LT_CURRENT=75
|
||||
LT_AGE=71
|
||||
dnl SONAME = 57 - 53 = 4 . Linux library name = libburn.so.4.53.0
|
||||
LT_CURRENT=57
|
||||
LT_AGE=53
|
||||
LT_REVISION=0
|
||||
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
|
||||
|
||||
@ -196,7 +186,7 @@ AC_CHECK_HEADER(sys/statvfs.h, X=, STATVFS_DEF=)
|
||||
AC_CHECK_FUNC([statvfs], X=, STATVFS_DEF=)
|
||||
dnl If this would be done more specifically in Makefile.am
|
||||
dnl via libburn_libburn_la_CFLAGS then undesired .o file names would emerge
|
||||
CFLAGS="$STATVFS_DEF $CFLAGS"
|
||||
CFLAGS="$CFLAGS $STATVFS_DEF"
|
||||
|
||||
dnl ts A91122
|
||||
AC_ARG_ENABLE(track-src-odirect,
|
||||
@ -211,7 +201,7 @@ else
|
||||
fi
|
||||
dnl Avoid the need for libburn_libburn_la_CFLAGS in Makefile.am (ugly .o names)
|
||||
dnl ### AC_SUBST(LIBBURN_O_DIRECT_DEF)
|
||||
CFLAGS="$LIBBURN_O_DIRECT_DEF $CFLAGS"
|
||||
CFLAGS="$CFLAGS $LIBBURN_O_DIRECT_DEF"
|
||||
|
||||
dnl ts A91116
|
||||
AC_ARG_ENABLE(dvd-obs-64k,
|
||||
@ -224,7 +214,7 @@ else
|
||||
LIBBURN_DVD_OBS_64K=
|
||||
echo "disabled write size default 64 KB on DVD and BD"
|
||||
fi
|
||||
CFLAGS="$LIBBURN_DVD_OBS_64K $CFLAGS"
|
||||
CFLAGS="$CFLAGS $LIBBURN_DVD_OBS_64K"
|
||||
|
||||
dnl ts A91218
|
||||
AC_ARG_ENABLE(libcdio,
|
||||
@ -247,7 +237,7 @@ then
|
||||
fi
|
||||
else
|
||||
echo "enabled EXPERIMENTAL use of libcdio as system adapter"
|
||||
CFLAGS="$LIBCDIO_DEF $CFLAGS"
|
||||
CFLAGS="$CFLAGS $LIBCDIO_DEF"
|
||||
|
||||
LIBCDIO_REQUIRED=0.83
|
||||
PKG_CHECK_MODULES(LIBCDIO, libcdio >= $LIBCDIO_REQUIRED)
|
||||
@ -295,15 +285,15 @@ AC_ARG_ENABLE(debug,
|
||||
, enable_debug=yes)
|
||||
if test x$enable_debug != xyes; then
|
||||
if test x$GCC = xyes; then
|
||||
CFLAGS="-O3 $CFLAGS"
|
||||
CFLAGS="-fexpensive-optimizations $CFLAGS"
|
||||
CFLAGS="$CFLAGS -O3"
|
||||
CFLAGS="$CFLAGS -fexpensive-optimizations"
|
||||
fi
|
||||
CFLAGS="-DNDEBUG $CFLAGS"
|
||||
CFLAGS="$CFLAGS -DNDEBUG"
|
||||
else
|
||||
if test x$GCC = xyes; then
|
||||
CFLAGS="-g -pedantic -Wall -Wextra -Wno-unused-parameter $CFLAGS"
|
||||
CFLAGS="$CFLAGS -g -pedantic -Wall"
|
||||
fi
|
||||
CFLAGS="-DDEBUG $CFLAGS"
|
||||
CFLAGS="$CFLAGS -DDEBUG"
|
||||
fi
|
||||
|
||||
dnl Determine target directory for libburn-*.pc
|
||||
|
13
doc/comments
13
doc/comments
@ -8,13 +8,14 @@
|
||||
Libburnia is an open-source project for reading, mastering and writing
|
||||
optical discs. This page is about its capability to handle optical media.
|
||||
For now this means CD-R, CD-RW, DVD-RAM, DVD+RW, DVD+R, DVD+R/DL, DVD-RW,
|
||||
DVD-R, DVD-R/DL, BD-R, BD-RE.
|
||||
DVD-R, BD-R, BD-RE.
|
||||
|
||||
Our scope is currently Linux 2.4 and 2.6, or FreeBSD, or Solaris . For ports
|
||||
to other systems we would need : login on a development machine resp.
|
||||
an OS ithat is installable on an AMD 64-bit PC, advise from a system person
|
||||
about the equivalent of Linux sg or FreeBSD CAM, volunteers for testing of
|
||||
realistic use cases.
|
||||
Not supported yet are DVD-R/DL. Testers wanted.
|
||||
|
||||
Our scope is currently Linux 2.4 and 2.6, or FreeBSD . For ports to other
|
||||
systems we would need : login on a development machine resp. a live OS on CD
|
||||
or DVD, advise from a system person about the equivalent of Linux sg or FreeBSD
|
||||
CAM, volunteers for testing of realistic use cases.
|
||||
|
||||
libburn is the library by which preformatted data get onto optical media.
|
||||
Its code is independent of cdrecord. Its DVD capabilities are learned from
|
||||
|
@ -1,9 +1,3 @@
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Note: This is about how libburn operates optical drives. Not about how to
|
||||
operate libburn. The libburn API is described in libburn/libburn.h
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
libburnia-project.org Optical Media Rotisserie Recipes as of January 2010
|
||||
|
||||
Content:
|
||||
|
@ -1145,8 +1145,7 @@ HIDE_UNDOC_RELATIONS = YES
|
||||
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
|
||||
# have no effect if this option is set to NO (the default)
|
||||
|
||||
# ts B10415: dot causes sigsegv on Debian buildd
|
||||
HAVE_DOT = NO
|
||||
HAVE_DOT = YES
|
||||
|
||||
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
||||
# will generate a graph for each documented class showing the direct and
|
||||
|
@ -1,10 +1,4 @@
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Note: This is about how libburn operates optical drives. Not about how to
|
||||
operate libburn. The libburn API is described in libburn/libburn.h
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Overview of class specific or individual media information
|
||||
especially manufacturer and exact product type
|
||||
|
||||
@ -178,9 +172,6 @@ BD-R and BD-RE:
|
||||
Table 288 says that Media Type Code (byte 1 of CDB) for BD media is 1.
|
||||
Table 446 says that Disc Information is preceeded by 4 bytes of header.
|
||||
Table 448 says that bytes 0 to 1 are Disc Information Identifier "DI".
|
||||
that bytes 8 to 10 are Disc Type Identifier
|
||||
BDO for BD-ROM, BDW for BD-RE,
|
||||
BDR for BD-R
|
||||
that bytes 100 to 105 are Disc Manufactuer ID
|
||||
that bytes 106 to 108 are Media Type ID
|
||||
that byte 111 is Product Revision Number
|
||||
@ -942,7 +933,6 @@ CMCMAG CN2 CMC Magnetics Corporation 1-2X HTL 25GB(12cm) [Blu]
|
||||
DAXON 016 DAXON 8X [Hij]
|
||||
DAXON AZ3 DAXON 16X [Hij]
|
||||
DAXON CY3 DAXON 12X [Hij]
|
||||
DAXON D42/52 (user reported DVD+RW)
|
||||
Daxon R2X Daxon Technology Inc. 1-2X HTL 25GB(12cm) [Blu]
|
||||
Daxon R4X Daxon Technology Inc. 1-4X HTL 25GB(12cm) [Blu]
|
||||
|
||||
@ -1182,7 +1172,6 @@ TTH02 TDK 12X [Hij]
|
||||
TYG01 TAIYO YUDEN 4X [Hij]
|
||||
TYG02 TAIYO YUDEN 12X [Hij]
|
||||
TYG03 TAIYO YUDEN 16X [Hij]
|
||||
TYG11 TAIYO YUDEN DVD-R DL 8x
|
||||
TYG-BD Y01 TAIYO YUDEN Co., Ltd. 1-2X LTH [Blu]
|
||||
TYG-BD Y03 TAIYO YUDEN Co., Ltd. 1-4X LTH [Blu]
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -183,6 +183,11 @@ static void remove_worker(pthread_t th)
|
||||
{
|
||||
struct w_list *a, *l = NULL;
|
||||
|
||||
#ifdef Libburn_detach_done_workeR
|
||||
int ret;
|
||||
char msg[80];
|
||||
#endif
|
||||
|
||||
for (a = workers; a; l = a, a = a->next)
|
||||
if (a->thread == th) {
|
||||
if (l)
|
||||
@ -195,12 +200,8 @@ static void remove_worker(pthread_t th)
|
||||
/* Alternative : threads get detached and thus should
|
||||
dispose themselves.
|
||||
*/
|
||||
pthread_detach(th);
|
||||
/*
|
||||
int ret;
|
||||
char msg[80];
|
||||
|
||||
ret = pthread_detach(th);
|
||||
/*
|
||||
sprintf(msg,
|
||||
"remove_workers(): pid= %lu pthread_detach(%lu)= %d",
|
||||
(unsigned long) getpid(), (unsigned long) th, ret);
|
||||
@ -354,7 +355,7 @@ void burn_disc_erase(struct burn_drive *drive, int fast)
|
||||
/* a ssert(!find_worker(drive)); */
|
||||
|
||||
if((drive == NULL)) {
|
||||
libdax_msgs_submit(libdax_messenger, -1,
|
||||
libdax_msgs_submit(libdax_messenger, drive->global_index,
|
||||
0x00020104,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"NULL pointer caught in burn_disc_erase", 0, 0);
|
||||
@ -382,9 +383,7 @@ void burn_disc_erase(struct burn_drive *drive, int fast)
|
||||
/* ts A70909 : the willingness to burn any BURN_DISC_FULL media is
|
||||
inappropriate. One would rather need a -force option
|
||||
Note: keep this in sync with mmc_read_disc_info() */
|
||||
/* ts B10321 : Allowed role 5 to be blanked */
|
||||
if ((drive->drive_role == 1 &&
|
||||
drive->current_profile != 0x0a &&
|
||||
if ((drive->current_profile != 0x0a &&
|
||||
drive->current_profile != 0x13 &&
|
||||
drive->current_profile != 0x14 &&
|
||||
drive->status != BURN_DISC_FULL)
|
||||
@ -393,7 +392,7 @@ void burn_disc_erase(struct burn_drive *drive, int fast)
|
||||
drive->status != BURN_DISC_APPENDABLE &&
|
||||
drive->status != BURN_DISC_BLANK)
|
||||
||
|
||||
(drive->drive_role != 1 && drive->drive_role != 5)
|
||||
(drive->drive_role != 1)
|
||||
) {
|
||||
libdax_msgs_submit(libdax_messenger, drive->global_index,
|
||||
0x00020130,
|
||||
@ -444,7 +443,7 @@ void burn_disc_format(struct burn_drive *drive, off_t size, int flag)
|
||||
{
|
||||
struct format_opts o;
|
||||
int ok = 0, ret;
|
||||
char msg[40];
|
||||
char msg[160];
|
||||
|
||||
reset_progress(drive, 1, 1, 1, 0x10000, 0);
|
||||
|
||||
@ -518,6 +517,42 @@ void burn_disc_format(struct burn_drive *drive, off_t size, int flag)
|
||||
return;
|
||||
|
||||
}
|
||||
if ((flag & 6) != 6 || (flag & 128)) {
|
||||
if ((flag & 64) && !(drive->current_feat23h_byte4 & 2)) {
|
||||
if (drive->current_feat23h_byte4 & 1) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
drive->global_index, 0x00020165,
|
||||
LIBDAX_MSGS_SEV_WARNING,
|
||||
LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive does not support fast formatting",
|
||||
0, 0);
|
||||
flag &= ~64;
|
||||
} else {
|
||||
no_non_default_bd_re:;
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
drive->global_index, 0x00020167,
|
||||
LIBDAX_MSGS_SEV_SORRY,
|
||||
LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive does not support non-default formatting",
|
||||
0, 0);
|
||||
drive->cancel = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ((!(flag & 64)) && !(drive->current_feat23h_byte4 & 1)){
|
||||
if (drive->current_feat23h_byte4 & 2) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
drive->global_index, 0x00020166,
|
||||
LIBDAX_MSGS_SEV_WARNING,
|
||||
LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive does not support full formatting",
|
||||
0, 0);
|
||||
flag |= 64;
|
||||
} else
|
||||
goto no_non_default_bd_re;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!ok) {
|
||||
@ -585,7 +620,7 @@ static void *write_disc_worker_func(struct w_list *w)
|
||||
void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
{
|
||||
struct write_opts o;
|
||||
char *reasons= NULL;
|
||||
char reasons[BURN_REASONS_LEN+80];
|
||||
struct burn_drive *d;
|
||||
|
||||
d = opts->drive;
|
||||
@ -624,14 +659,6 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
"Drive is a virtual placeholder (null-drive)", 0, 0);
|
||||
return;
|
||||
}
|
||||
if (d->drive_role == 4) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020181,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Pseudo-drive is a read-only file. Cannot write.",
|
||||
0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
/* ts A61007 : obsolete Assert in spc_select_write_params() */
|
||||
if (d->drive_role == 1 && d->mdata->valid <= 0) {
|
||||
@ -645,8 +672,6 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
/* ts A70219 : intended to replace all further tests here and many
|
||||
tests in burn_*_write_sync()
|
||||
*/
|
||||
|
||||
BURN_ALLOC_MEM_VOID(reasons, char, BURN_REASONS_LEN + 80);
|
||||
strcpy(reasons, "Write job parameters are unsuitable:\n");
|
||||
if (burn_precheck_write(opts, disc, reasons + strlen(reasons), 1)
|
||||
<= 0) {
|
||||
@ -654,9 +679,8 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
d->global_index, 0x00020139,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
reasons, 0, 0);
|
||||
goto ex;
|
||||
return;
|
||||
}
|
||||
BURN_FREE_MEM(reasons); reasons= NULL;
|
||||
|
||||
/* ts A90106 : early catching of unformatted BD-RE */
|
||||
if (d->current_profile == 0x43)
|
||||
@ -680,9 +704,6 @@ void burn_disc_write(struct burn_write_opts *opts, struct burn_disc *disc)
|
||||
|
||||
add_worker(Burnworker_type_writE, d,
|
||||
(WorkerFunc) write_disc_worker_func, &o);
|
||||
|
||||
ex:;
|
||||
BURN_FREE_MEM(reasons);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
cleanup.c , Copyright 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
cleanup.c , Copyright 2006 Thomas Schmitt <scdbackup@gmx.net>
|
||||
|
||||
A signal handler which cleans up an application and exits.
|
||||
|
||||
@ -205,10 +205,9 @@ main()
|
||||
Cleanup_set_handlers(&demoapp,(Cleanup_app_handler_T) Demo_app_handler,0);
|
||||
|
||||
if(1) { /* change to 0 in order to wait for external signals */
|
||||
char *cpt= NULL, c= ' ';
|
||||
char *cpt= NULL,c;
|
||||
printf("Intentionally provoking SIGSEGV ...\n");
|
||||
c= *cpt;
|
||||
printf("Strange: The system ignored a SIGSEGV: c= %u\n", (unsigned int) c);
|
||||
} else {
|
||||
printf("killme: %d\n",getpid());
|
||||
sleep(3600);
|
||||
|
@ -25,4 +25,20 @@ void burn_set_verbosity(int v)
|
||||
burn_verbosity = v;
|
||||
}
|
||||
|
||||
void burn_print(int level, const char *a, ...)
|
||||
{
|
||||
#ifdef WIN32
|
||||
char debug_string_data[256];
|
||||
#endif
|
||||
va_list vl;
|
||||
|
||||
if (level <= burn_verbosity) {
|
||||
va_start(vl, a);
|
||||
#ifdef WIN32
|
||||
vsprintf(debug_string_data, a, vl);
|
||||
OutputDebugString(debug_string_data);
|
||||
#else
|
||||
vfprintf(stderr, a, vl);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
802
libburn/drive.c
802
libburn/drive.c
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
#include "libburn.h"
|
||||
#include "toc.h"
|
||||
#include "structure.h"
|
||||
#include <pthread.h>
|
||||
|
||||
struct burn_drive;
|
||||
struct command;
|
||||
@ -85,7 +84,7 @@ struct burn_drive *burn_drive_finish_enum(struct burn_drive *d);
|
||||
int burn_drive_inquire_media(struct burn_drive *d);
|
||||
|
||||
/* ts A61125 : model aspects of burn_drive_release */
|
||||
int burn_drive_mark_unready(struct burn_drive *d, int flag);
|
||||
int burn_drive_mark_unready(struct burn_drive *d);
|
||||
|
||||
|
||||
/* ts A61226 */
|
||||
@ -151,8 +150,4 @@ int burn_abort_5(int patience,
|
||||
int (*pacifier_func)(void *handle, int patience, int elapsed),
|
||||
void *handle, int elapsed, int flag);
|
||||
|
||||
/* ts B10730 */
|
||||
/* Send a default mode page 05 to CD and DVD-R-oids */
|
||||
int burn_drive_send_default_page_05(struct burn_drive *d, int flag);
|
||||
|
||||
#endif /* __DRIVE */
|
||||
|
@ -211,10 +211,9 @@ struct burn_source *burn_fd_source_new(int datafd, int subfd, off_t size)
|
||||
|
||||
static int fifo_sleep(int flag)
|
||||
{
|
||||
static unsigned long sleeptime = 50000; /* 50 ms */
|
||||
static struct timespec sleeptime = { 0, 50000000}; /* 50 ms */
|
||||
|
||||
usleep(sleeptime);
|
||||
return 0;
|
||||
return nanosleep(&sleeptime, NULL);
|
||||
}
|
||||
|
||||
|
||||
@ -625,9 +624,7 @@ void burn_fifo_next_interval(struct burn_source *source,
|
||||
|
||||
*interval_min_fill = fs->interval_min_fill;
|
||||
ret = burn_fifo_inquire_status(source,
|
||||
&size, &free_bytes, &status_text);
|
||||
if (ret < 0)
|
||||
return;
|
||||
&size, &free_bytes, &status_text);
|
||||
fs->interval_min_fill = size - free_bytes - 1;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -105,14 +105,6 @@ int burn_support_untested_profiles = 0;
|
||||
*/
|
||||
int burn_sg_log_scsi = 0;
|
||||
|
||||
|
||||
/* ts B10312 :
|
||||
Whether to map random-access readonly files to drive role 4.
|
||||
Else it is role 2 overwriteable drive
|
||||
*/
|
||||
int burn_drive_role_4_allowed = 0;
|
||||
|
||||
|
||||
/* ts A60925 : ticket 74 */
|
||||
/** Create the messenger object for libburn. */
|
||||
int burn_msgs_initialize(void)
|
||||
@ -177,8 +169,6 @@ void burn_finish(void)
|
||||
|
||||
sg_shutdown(0);
|
||||
|
||||
burn_drive_clear_whitelist();
|
||||
|
||||
burn_running = 0;
|
||||
}
|
||||
|
||||
@ -354,7 +344,7 @@ char *burn_util_thread_id(pid_t pid, pthread_t tid, char text[80])
|
||||
|
||||
sprintf(text, "[%lu,", (unsigned long int) getpid());
|
||||
l= strlen(text);
|
||||
for(i= 0; i < ((int) sizeof(pthread_t)) && 2 * i < 80 - l - 3; i++)
|
||||
for(i= 0; i < sizeof(pthread_t) && 2 * i < 80 - l - 3; i++)
|
||||
sprintf(text + l + 2 * i,
|
||||
"%2.2X", ((unsigned char *) &tid)[i]);
|
||||
|
||||
@ -575,25 +565,3 @@ void burn_set_scsi_logging(int flag)
|
||||
{
|
||||
burn_sg_log_scsi = flag & 7;
|
||||
}
|
||||
|
||||
|
||||
/* ts B10312 API */
|
||||
void burn_allow_drive_role_4(int allowed)
|
||||
{
|
||||
burn_drive_role_4_allowed = (allowed & 0xf);
|
||||
}
|
||||
|
||||
|
||||
/* ts B10606 */
|
||||
void *burn_alloc_mem(size_t size, size_t count, int flag)
|
||||
{
|
||||
void *pt;
|
||||
|
||||
pt = calloc(size, count);
|
||||
if(pt == NULL)
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000003,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Out of virtual memory", 0, 0);
|
||||
return pt;
|
||||
}
|
||||
|
||||
|
@ -27,25 +27,5 @@ extern volatile int burn_builtin_triggered_action; /* burn_is_aborting() */
|
||||
*/
|
||||
int burn_init_catch_on_abort(int flag);
|
||||
|
||||
/* ts B10606 */
|
||||
void *burn_alloc_mem(size_t size, size_t count, int flag);
|
||||
|
||||
#define BURN_ALLOC_MEM(pt, typ, count) { \
|
||||
pt= (typ *) burn_alloc_mem(sizeof(typ), (size_t) (count), 0); \
|
||||
if(pt == NULL) { \
|
||||
ret= -1; goto ex; \
|
||||
} }
|
||||
|
||||
#define BURN_ALLOC_MEM_VOID(pt, typ, count) { \
|
||||
pt= (typ *) burn_alloc_mem(sizeof(typ), (size_t) (count), 0); \
|
||||
if(pt == NULL) { \
|
||||
goto ex; \
|
||||
} }
|
||||
|
||||
#define BURN_FREE_MEM(pt) { \
|
||||
if(pt != NULL) \
|
||||
free((char *) pt); \
|
||||
}
|
||||
|
||||
|
||||
#endif /* BURN__INIT_H */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
|
||||
This is the official API definition of libburn.
|
||||
@ -561,9 +561,9 @@ struct burn_drive_info
|
||||
char revision[5];
|
||||
|
||||
/** Invalid: Was: "Location of the drive in the filesystem." */
|
||||
/** This string has no meaning any more. Once it stored the drive
|
||||
device file address. Now always use function burn_drive_d_get_adr()
|
||||
to inquire a device file address. ^^^^^ ALWAYS ^^^^^^^*/
|
||||
/** This string has no meaning any more. Once it stored the persistent
|
||||
drive address. Now always use function burn_drive_d_get_adr() to
|
||||
inquire a persistent address. ^^^^^^ ALWAYS ^^^^^^^^ */
|
||||
char location[17];
|
||||
|
||||
/** Can the drive read DVD-RAM discs */
|
||||
@ -782,7 +782,7 @@ int burn_abort_pacifier(void *handle, int patience, int elapsed);
|
||||
void burn_set_verbosity(int level);
|
||||
|
||||
/* ts A91111 */
|
||||
/** Enable resp. disable logging of SCSI commands.
|
||||
/** Enable resp. disable logging of SCSI commands (currently GNU/Linux only).
|
||||
This call can be made at any time - even before burn_initialize().
|
||||
It is in effect for all active drives and currently not very thread
|
||||
safe for multiple drives.
|
||||
@ -840,7 +840,7 @@ void burn_allow_untested_profiles(int yes);
|
||||
|
||||
|
||||
/* ts A60823 */
|
||||
/** Aquire a drive with known device file address.
|
||||
/** Aquire a drive with known persistent address.
|
||||
|
||||
This is the sysadmin friendly way to open one drive and to leave all
|
||||
others untouched. It bundles the following API calls to form a
|
||||
@ -912,7 +912,7 @@ void burn_allow_untested_profiles(int yes);
|
||||
when it is no longer needed.
|
||||
This is a result from call burn_drive_scan(). See there.
|
||||
Use with driveno 0 only.
|
||||
@param adr The device file address of the desired drive. Either once
|
||||
@param adr The persistent address of the desired drive. Either once
|
||||
obtained by burn_drive_d_get_adr() or composed skillfully by
|
||||
application resp. its user. E.g. "/dev/sr0".
|
||||
Consider to preprocess it by burn_drive_convert_fs_adr().
|
||||
@ -994,25 +994,25 @@ void burn_drive_info_free(struct burn_drive_info drive_infos[]);
|
||||
|
||||
/* ts A60823 */
|
||||
/* @since 0.2.2 */
|
||||
/** Maximum length+1 to expect with a drive device file address string */
|
||||
/** Maximum length+1 to expect with a persistent drive address string */
|
||||
#define BURN_DRIVE_ADR_LEN 1024
|
||||
|
||||
/* ts A70906 */
|
||||
/** Inquire the device file address of the given drive.
|
||||
/** Inquire the persistent address of the given drive.
|
||||
@param drive The drive to inquire.
|
||||
@param adr An application provided array of at least BURN_DRIVE_ADR_LEN
|
||||
characters size. The device file address gets copied to it.
|
||||
characters size. The persistent address gets copied to it.
|
||||
@return >0 success , <=0 error (due to libburn internal problem)
|
||||
@since 0.4.0
|
||||
*/
|
||||
int burn_drive_d_get_adr(struct burn_drive *drive, char adr[]);
|
||||
|
||||
/* A60823 */
|
||||
/** Inquire the device file address of a drive via a given drive_info object.
|
||||
/** Inquire the persistent address of a drive via a given drive_info object.
|
||||
(Note: This is a legacy call.)
|
||||
@param drive_info The drive to inquire.Usually some &(drive_infos[driveno])
|
||||
@param adr An application provided array of at least BURN_DRIVE_ADR_LEN
|
||||
characters size. The device file address gets copied to it.
|
||||
characters size. The persistent address gets copied to it.
|
||||
@return >0 success , <=0 error (due to libburn internal problem)
|
||||
@since 0.2.6
|
||||
*/
|
||||
@ -1020,23 +1020,21 @@ int burn_drive_get_adr(struct burn_drive_info *drive_info, char adr[]);
|
||||
|
||||
|
||||
/* ts A60922 ticket 33 */
|
||||
/** Evaluate whether the given address would be a drive device file address
|
||||
which could be listed by a run of burn_drive_scan(). No check is made
|
||||
whether a device file with this address exists or whether it leads
|
||||
to a usable MMC drive.
|
||||
/** Evaluate whether the given address would be a possible persistent drive
|
||||
address of libburn.
|
||||
@return 1 means yes, 0 means no
|
||||
@since 0.2.6
|
||||
*/
|
||||
int burn_drive_is_enumerable_adr(char *adr);
|
||||
|
||||
/* ts A60922 ticket 33 */
|
||||
/** Try to convert a given existing filesystem address into a drive device file
|
||||
/** Try to convert a given existing filesystem address into a persistent drive
|
||||
address. This succeeds with symbolic links or if a hint about the drive's
|
||||
system address can be read from the filesystem object and a matching drive
|
||||
is found.
|
||||
@param path The address of an existing file system object
|
||||
@param adr An application provided array of at least BURN_DRIVE_ADR_LEN
|
||||
characters size. The device file address gets copied to it.
|
||||
characters size. The persistent address gets copied to it.
|
||||
@return 1 = success , 0 = failure , -1 = severe error
|
||||
@since 0.2.6
|
||||
*/
|
||||
@ -1044,7 +1042,7 @@ int burn_drive_convert_fs_adr(char *path, char adr[]);
|
||||
|
||||
/* ts A60923 */
|
||||
/** Try to convert a given SCSI address of bus,host,channel,target,lun into
|
||||
a drive device file address. If a SCSI address component parameter is < 0
|
||||
a persistent drive address. If a SCSI address component parameter is < 0
|
||||
then it is not decisive and the first enumerated address which matches
|
||||
the >= 0 parameters is taken as result.
|
||||
Note: bus and (host,channel) are supposed to be redundant.
|
||||
@ -1054,50 +1052,17 @@ int burn_drive_convert_fs_adr(char *path, char adr[]);
|
||||
@param target_no "Target Number" or "SCSI Id" (a device)
|
||||
@param lun_no "Logical Unit Number" (a sub device)
|
||||
@param adr An application provided array of at least BURN_DRIVE_ADR_LEN
|
||||
characters size. The device file address gets copied to it.
|
||||
characters size. The persistent address gets copied to it.
|
||||
@return 1 = success , 0 = failure , -1 = severe error
|
||||
@since 0.2.6
|
||||
*/
|
||||
int burn_drive_convert_scsi_adr(int bus_no, int host_no, int channel_no,
|
||||
int target_no, int lun_no, char adr[]);
|
||||
|
||||
/* ts B10728 */
|
||||
/** Try to convert a given drive device file address into the address of a
|
||||
symbolic link that points to this drive address.
|
||||
Modern GNU/Linux systems may shuffle drive addresses from boot to boot.
|
||||
The udev daemon is supposed to create links which always point to the
|
||||
same drive, regardless of its system address.
|
||||
This call tries to find such links.
|
||||
@param dev_adr Should contain a drive address as returned by
|
||||
burn_drive_scan().
|
||||
@param link_adr An application provided array of at least
|
||||
BURN_DRIVE_ADR_LEN characters size. The found link
|
||||
address gets copied to it.
|
||||
@param dir_adr The address of the directory where to look for links.
|
||||
Normally: "/dev"
|
||||
@param templ An array of pointers to name templates, which
|
||||
links have to match. A symbolic link in dir_adr matches
|
||||
a name template if it begins by that text. E.g.
|
||||
link address "/dev/dvdrw1" matches template "dvdrw".
|
||||
If templ is NULL, then the default array gets used:
|
||||
{"dvdrw", "cdrw", "dvd", "cdrom", "cd"}
|
||||
If several links would match, then a link will win,
|
||||
which matches the template with the lowest array index.
|
||||
Among these candidates, the one with the lowest strcmp()
|
||||
rank will be chosen as link_adr.
|
||||
@param num_templ Number of array elements in templ.
|
||||
@param flag Bitfield for control purposes. Unused yet. Submit 0.
|
||||
@return <0 severe error, 0 failed to search, 2 nothing found
|
||||
1 success, link_adr is valid
|
||||
@since 1.1.4
|
||||
*/
|
||||
int burn_lookup_device_link(char *dev_adr, char link_adr[],
|
||||
char *dir_adr, char **templ, int num_templ, int flag);
|
||||
|
||||
/* ts A60923 - A61005 */
|
||||
/** Try to obtain bus,host,channel,target,lun from path. If there is an SCSI
|
||||
address at all, then this call should succeed with a drive device file
|
||||
address obtained via burn_drive_d_get_adr(). It is also supposed to
|
||||
address at all, then this call should succeed with a persistent
|
||||
drive address obtained via burn_drive_d_get_adr(). It is also supposed to
|
||||
succeed with any device file of a (possibly emulated) SCSI device.
|
||||
@return 1 = success , 0 = failure , -1 = severe error
|
||||
@since 0.2.6
|
||||
@ -1146,17 +1111,6 @@ int burn_drive_probe_cd_write_modes(struct burn_drive_info *drive_info);
|
||||
int burn_drive_snooze(struct burn_drive *d, int flag);
|
||||
|
||||
|
||||
/** Re-assess drive and media status. This should be done after a drive
|
||||
underwent a status change and shall be further used without intermediate
|
||||
burn_drive_release(), burn_drive_grab(). E.g. after blanking or burning.
|
||||
@param drive The already grabbed drive to re-assess.
|
||||
@param flag Unused yet. Submit 0.
|
||||
@return 1 success , <= 0 could not determine drive and media state
|
||||
@since 1.1.8
|
||||
*/
|
||||
int burn_drive_re_assess(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).
|
||||
@param drive The drive to release.
|
||||
@ -1307,27 +1261,6 @@ int burn_disc_get_cd_info(struct burn_drive *d, char disc_type[80],
|
||||
int burn_disc_get_bd_spare_info(struct burn_drive *d,
|
||||
int *alloc_blocks, int *free_blocks, int flag);
|
||||
|
||||
/* ts B10801 */
|
||||
/** Retrieve some media information which is mainly specific to media of
|
||||
the DVD-R family: DVD-R , DVD-RW , DVD-R DL , HD DVD-R
|
||||
Currently the information cannot be retrieved from other media types.
|
||||
@param d The drive to query.
|
||||
@param disk_category returns DVD Book to which the media complies
|
||||
@param book_name returns a pointer to the book name of disk_category.
|
||||
This memory is static. Do not alter or free it !
|
||||
@param part_version returns the Media Version in the DVD Book
|
||||
@param num_layers returns the number of media layers
|
||||
@param num_blocks returns the number of blocks between pysical start
|
||||
and physical end of the media
|
||||
@param flag Bitfield for control purposes (unused yet, submit 0)
|
||||
@return 1 = reply prarameters are valid,
|
||||
<=0 = reply is invalid (e.g. because no DVD-R)
|
||||
@since 1.1.4
|
||||
*/
|
||||
int burn_disc_get_phys_format_info(struct burn_drive *d, int *disk_category,
|
||||
char **book_name, int *part_version, int *num_layers,
|
||||
int *num_blocks, int flag);
|
||||
|
||||
/* 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().
|
||||
@ -1346,45 +1279,6 @@ int burn_disc_get_phys_format_info(struct burn_drive *d, int *disk_category,
|
||||
int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
|
||||
int trackno, int *lba, int *nwa);
|
||||
|
||||
/* ts B10525 */
|
||||
/** Tells whether a previous attempt to determine the Next Writeable Address
|
||||
of the upcomming track reveiled that the READ TRACK INFORMATION Damage Bit
|
||||
is set for this track, resp. that no valid writable address is available.
|
||||
See MMC-5 6.27.3.7 Damage Bit, 6.27.3.11 NWA_V (NWA valid)
|
||||
@param d The drive to query.
|
||||
@param flag Bitfield for control purposes (unused yet, submit 0)
|
||||
@return 0= Looks ok: Damage Bit is not set, NWA_V is set
|
||||
1= Damaged and theoretically writable (NWA_V is set)
|
||||
2= Not writable: NWA_V is not set
|
||||
3= Damaged and not writable (NWA_V is not set),
|
||||
@since 1.1.0
|
||||
*/
|
||||
int burn_disc_next_track_is_damaged(struct burn_drive *d, int flag);
|
||||
|
||||
/* ts B10527 */
|
||||
/** Try to close the last track and session of media which have bit0 set in
|
||||
the return value of call burn_disc_next_track_is_damaged().
|
||||
Whether it helps depends much on the reason why the media is reported
|
||||
as damaged by the drive.
|
||||
This call works only for profiles 0x09 CD-R, 0x0a CD-RW, 0x11 DVD-R,
|
||||
0x14 DVD-RW sequential, 0x1b DVD+R, 0x2b DVD+R DL, 0x41 BD-R sequential.
|
||||
Note: After writing it is advised to give up the drive and to grab it again
|
||||
in order to learn about its view on the new media state.
|
||||
@param o Write options created by burn_write_opts_new() and
|
||||
manipulated by burn_write_opts_set_multi().
|
||||
burn_write_opts_set_write_type() should be set to
|
||||
BURN_WRITE_TAO, burn_write_opts_set_simulate() should be
|
||||
set to 0.
|
||||
@param flag Bitfield for control purposes
|
||||
bit0= force close, even if no damage was seen
|
||||
@return <=0 media not marked as damaged, or media type not suitable,
|
||||
or closing attempted but failed
|
||||
1= attempt finished without error indication
|
||||
@since 1.1.0
|
||||
*/
|
||||
int burn_disc_close_damaged(struct burn_write_opts *o, int flag);
|
||||
|
||||
|
||||
/* ts A70131 */
|
||||
/** Read start lba of the first track in the last complete session.
|
||||
This is the first parameter of mkisofs option -C. The second parameter
|
||||
@ -1406,9 +1300,6 @@ int burn_disc_get_msc1(struct burn_drive *d, int *start_lba);
|
||||
An eventual start address from burn_write_opts_set_start_byte() will be
|
||||
subtracted from the obtained capacity estimation. Negative results get
|
||||
defaulted to 0.
|
||||
If the drive is actually a file in a large filesystem or a large block
|
||||
device, then the capacity is curbed to a maximum of 0x7ffffff0 blocks
|
||||
= 4 TB - 32 KB.
|
||||
@param d The drive to query.
|
||||
@param o If not NULL: write parameters to be set on drive before query
|
||||
@return number of most probably available free bytes
|
||||
@ -1417,6 +1308,7 @@ int burn_disc_get_msc1(struct burn_drive *d, int *start_lba);
|
||||
off_t burn_disc_available_space(struct burn_drive *d,
|
||||
struct burn_write_opts *o);
|
||||
|
||||
|
||||
/* ts A61202 */
|
||||
/** Tells the MMC Profile identifier of the loaded media. The drive must be
|
||||
grabbed in order to get a non-zero result.
|
||||
@ -1556,8 +1448,6 @@ void burn_read_opts_free(struct burn_read_opts *opts);
|
||||
cancellable, as control of the operation is passed wholly to the drive and
|
||||
there is no way to interrupt it safely.
|
||||
@param drive The drive with which to erase a disc.
|
||||
Only drive roles 1 (MMC) and 5 (stdio random write-only)
|
||||
support erasing.
|
||||
@param fast Nonzero to do a fast erase, where only the disc's headers are
|
||||
erased; zero to erase the entire disc.
|
||||
With DVD-RW, fast blanking yields media capable only of DAO.
|
||||
@ -1702,13 +1592,8 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
|
||||
of data and audio tracks. You must use BURN_WRITE_TAO for such sessions.
|
||||
To be set by burn_write_opts_set_write_type().
|
||||
Note: This function is not suitable for overwriting data in the middle of
|
||||
a valid data area because it is allowed to append trailing data.
|
||||
For exact random access overwriting use burn_random_access_write().
|
||||
Note: After writing it is advised to give up the drive and to grab it again
|
||||
in order to learn about its view on the new media state.
|
||||
Note: Before mounting the written media it might be necessary to eject
|
||||
and reload in order to allow the operating system to notice the new
|
||||
media state.
|
||||
a valid data area because it is allowed to append trailing data.
|
||||
For exact random access overwriting use burn_random_access_write().
|
||||
@param o The options for the writing operation.
|
||||
@param disc The struct burn_disc * that described the disc to be created
|
||||
*/
|
||||
@ -2272,11 +2157,7 @@ int burn_drive_set_buffer_waiting(struct burn_drive *d, int enable,
|
||||
int min_percent, int max_percent);
|
||||
|
||||
|
||||
/* these are for my [Derek Foreman's ?] debugging, they will disappear */
|
||||
/* ts B11012 :
|
||||
Of course, API symbols will not disappear. But these functions are of
|
||||
few use, as they only print DEBUG messages.
|
||||
*/
|
||||
/* these are for my debugging, they will disappear */
|
||||
void burn_structure_print_disc(struct burn_disc *d);
|
||||
void burn_structure_print_session(struct burn_session *s);
|
||||
void burn_structure_print_track(struct burn_track *t);
|
||||
@ -2333,7 +2214,7 @@ void burn_write_opts_set_format(struct burn_write_opts *opts, int format);
|
||||
This corresponds to the Test Write bit in MMC mode page 05h. Several media
|
||||
types do not support this. See struct burn_multi_caps.might_simulate for
|
||||
actual availability of this feature.
|
||||
If the media is suitable, the drive will perform burn_disc_write() as a
|
||||
If the media is suitable, the drive will perform burn_write_disc() as a
|
||||
simulation instead of effective write operations. This means that the
|
||||
media content and burn_disc_get_status() stay unchanged.
|
||||
Note: With stdio-drives, the target file gets eventually created, opened,
|
||||
@ -2809,8 +2690,8 @@ void burn_version(int *major, int *minor, int *micro);
|
||||
}
|
||||
|
||||
*/
|
||||
#define burn_header_version_major 1
|
||||
#define burn_header_version_minor 1
|
||||
#define burn_header_version_major 0
|
||||
#define burn_header_version_minor 8
|
||||
#define burn_header_version_micro 8
|
||||
/** Note:
|
||||
Above version numbers are also recorded in configure.ac because libtool
|
||||
@ -3087,8 +2968,6 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
can be read via burn_read_data() although some of them may never have been
|
||||
recorded. If tracks are recognizable then it is better to only read
|
||||
LBAs which are part of some track.
|
||||
If the drive is actually a large file or block device, then the capacity
|
||||
is curbed to a maximum of 0x7ffffff0 blocks = 4 TB - 32 KB.
|
||||
@param d The drive from which to read
|
||||
@param capacity Will return the result if valid
|
||||
@param flag Bitfield for control purposes: Unused yet, submit 0.
|
||||
@ -3117,20 +2996,15 @@ int burn_get_read_capacity(struct burn_drive *d, int *capacity, int flag);
|
||||
bit0= - reserved -
|
||||
bit1= do not submit error message if read error
|
||||
bit2= on error do not try to read a second time
|
||||
with single block steps.
|
||||
@since 0.5.2
|
||||
bit3= return -2 on permission denied error rather than
|
||||
issueing a warning message.
|
||||
@since 1.0.6
|
||||
with single block steps. @since 0.5.2
|
||||
@return 1=sucessful , <=0 an error occured
|
||||
with bit3: -2= permission denied error
|
||||
@since 0.4.0
|
||||
*/
|
||||
int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
char data[], off_t data_size, off_t *data_count, int flag);
|
||||
|
||||
|
||||
/* ts A70904 */
|
||||
/* A70904 */
|
||||
/** Inquire whether the drive object is a real MMC drive or a pseudo-drive
|
||||
created by a stdio: address.
|
||||
@param d The drive to inquire
|
||||
@ -3138,49 +3012,11 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
1= real MMC drive
|
||||
2= stdio-drive, random access, read-write
|
||||
3= stdio-drive, sequential, write-only
|
||||
4= stdio-drive, random access, read-only
|
||||
(only if enabled by burn_allow_drive_role_4())
|
||||
5= stdio-drive, random access, write-only
|
||||
(only if enabled by burn_allow_drive_role_4())
|
||||
@since 0.4.0
|
||||
*/
|
||||
int burn_drive_get_drive_role(struct burn_drive *d);
|
||||
|
||||
|
||||
/* ts B10312 */
|
||||
/** Allow drive role 4 "random access read-only"
|
||||
and drive role 5 "random access write-only".
|
||||
By default a random access file assumes drive role 2 "read-write"
|
||||
regardless whether it is actually readable or writeable.
|
||||
If enabled, random-access file objects which recognizably allow no
|
||||
writing will be classified as role 4 and those which allow no reading
|
||||
will get role 5.
|
||||
Candidates are drive addresses of the form stdio:/dev/fd/# , where # is
|
||||
the integer number of an open file descriptor. If this descriptor was
|
||||
opened read-only resp. write-only, then it gets role 4 resp. role 5.
|
||||
Other paths may get tested by an attempt to open them for read-write
|
||||
(role 2) resp. read-only (role 4) resp. write-only (role 5). See bit1.
|
||||
@param allowed Bitfield for control purposes:
|
||||
bit0= Enable roles 4 and 5 for drives which get
|
||||
aquired after this call
|
||||
bit1= with bit0:
|
||||
Test whether the file can be opened for
|
||||
read-write resp. read-only resp. write-only.
|
||||
Classify as roles 2 resp. 4 resp. 5.
|
||||
bit2= with bit0 and bit1:
|
||||
Classify files which cannot be opened at all
|
||||
as role 0 : useless dummy.
|
||||
Else classify as role 2.
|
||||
bit3= Classify non-empty role 5 drives as
|
||||
BURN_DISC_APPENDABLE with Next Writeable Address
|
||||
after the end of the file. It is nevertheless
|
||||
possible to change this address by call
|
||||
burn_write_opts_set_start_byte().
|
||||
@since 1.0.6
|
||||
*/
|
||||
void burn_allow_drive_role_4(int allowed);
|
||||
|
||||
|
||||
/* ts A70923 */
|
||||
/** Find out whether a given address string would lead to the given drive
|
||||
object. This should be done in advance for track source addresses
|
||||
|
@ -2,11 +2,9 @@ LIBBURN4 {
|
||||
global:
|
||||
burn_abort;
|
||||
burn_abort_pacifier;
|
||||
burn_allow_drive_role_4;
|
||||
burn_allow_untested_profiles;
|
||||
burn_disc_add_session;
|
||||
burn_disc_available_space;
|
||||
burn_disc_close_damaged;
|
||||
burn_disc_create;
|
||||
burn_disc_erasable;
|
||||
burn_disc_erase;
|
||||
@ -20,12 +18,10 @@ burn_disc_get_formats;
|
||||
burn_disc_get_media_id;
|
||||
burn_disc_get_msc1;
|
||||
burn_disc_get_multi_caps;
|
||||
burn_disc_get_phys_format_info;
|
||||
burn_disc_get_profile;
|
||||
burn_disc_get_sectors;
|
||||
burn_disc_get_sessions;
|
||||
burn_disc_get_status;
|
||||
burn_disc_next_track_is_damaged;
|
||||
burn_disc_pretend_blank;
|
||||
burn_disc_pretend_full;
|
||||
burn_disc_read;
|
||||
@ -59,7 +55,6 @@ burn_drive_is_enumerable_adr;
|
||||
burn_drive_leave_locked;
|
||||
burn_drive_obtain_scsi_adr;
|
||||
burn_drive_probe_cd_write_modes;
|
||||
burn_drive_re_assess;
|
||||
burn_drive_release;
|
||||
burn_drive_scan;
|
||||
burn_drive_scan_and_grab;
|
||||
@ -83,7 +78,6 @@ burn_guess_manufacturer;
|
||||
burn_initialize;
|
||||
burn_is_aborting;
|
||||
burn_lba_to_msf;
|
||||
burn_lookup_device_link;
|
||||
burn_msf_to_lba;
|
||||
burn_msf_to_sectors;
|
||||
burn_msgs_obtain;
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* libdax_msgs
|
||||
Message handling facility of libburn and libisofs.
|
||||
Copyright (C) 2006-2011 Thomas Schmitt <scdbackup@gmx.net>,
|
||||
Message handling facility of libdax.
|
||||
Copyright (C) 2006-2010 Thomas Schmitt <scdbackup@gmx.net>,
|
||||
provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -519,7 +519,7 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
|
||||
0x0002014d (SORRY,HIGH) = Asynchromous SCSI error
|
||||
0x0002014f (SORRY,HIGH) = Timeout with asynchromous SCSI command
|
||||
0x00020150 (DEBUG,LOW) = Reporting asynchronous waiting time
|
||||
0x00020151 (FAILURE,HIGH) = Read attempt on write-only drive
|
||||
0x00020151 (FATAL,HIGH) = Read attempt on write-only drive
|
||||
0x00020152 (FATAL,HIGH) = Cannot start fifo thread
|
||||
0x00020153 (SORRY,HIGH) = Read error on fifo input
|
||||
0x00020154 (NOTE,HIGH) = Forwarded input error ends output
|
||||
@ -563,18 +563,6 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
|
||||
0x0002017b (WARNING,HIGH) = Sequential BD-R media likely to soon fail writing
|
||||
0x0002017c (FAILURE,HIGH) = No valid write type selected
|
||||
0x0002017d (FATAL,HIGH) = Invalid file descriptor with stdio pseudo-drive
|
||||
0x0002017e (FAILURE,HIGH) = Failed to close track, session, or disc
|
||||
0x0002017f (FAILURE,HIGH) = Failed to synchronize drive cache
|
||||
0x00020180 (FAILURE,HIGH) = Premature end of input encountered
|
||||
0x00020181 (FAILURE,HIGH) = Pseudo-drive is a read-only file. Cannot write.
|
||||
0x00020182 (FAILURE,HIGH) = Cannot truncate disk file for pseudo blanking
|
||||
0x00020183 (WARNING,HIGH) = Failed to open device (a pseudo-drive) for reading
|
||||
0x00020184 (WARNING,HIGH) = No Next-Writable-Address
|
||||
0x00020185 (WARNING,HIGH) = Track damaged, not closed and not writable
|
||||
0x00020186 (WARNING,HIGH) = Track damaged and not closed
|
||||
0x00020187 (NOTE,HIGH) = Track not marked as damaged. No action taken.
|
||||
0x00020188 (FAILURE,HIGH) = Cannot close damaged track on given media type
|
||||
0x00020189 (FATAL,HIGH) = Drive is already grabbed by libburn
|
||||
|
||||
libdax_audioxtr:
|
||||
0x00020200 (SORRY,HIGH) = Cannot open audio source file
|
||||
|
1614
libburn/mmc.c
1614
libburn/mmc.c
File diff suppressed because it is too large
Load Diff
@ -110,9 +110,4 @@ int mmc_start_if_needed(struct burn_drive *d, int flag);
|
||||
int mmc_get_bd_spare_info(struct burn_drive *d,
|
||||
int *alloc_blocks, int *free_blocks, int flag);
|
||||
|
||||
/* ts B10801 */
|
||||
int mmc_get_phys_format_info(struct burn_drive *d, int *disk_category,
|
||||
char **book_name, int *part_version, int *num_layers,
|
||||
int *num_blocks, int flag);
|
||||
|
||||
#endif /*__MMC*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -54,7 +54,7 @@ void burn_disc_read(struct burn_drive *d, const struct burn_read_opts *o)
|
||||
int drive_lba;
|
||||
unsigned short crc;
|
||||
unsigned char fakesub[96];
|
||||
struct buffer page; <- needs to become dynamic memory
|
||||
struct buffer page;
|
||||
int speed;
|
||||
|
||||
/* ts A61007 : if this function gets revived, then these
|
||||
@ -115,6 +115,7 @@ drive, or only store a subset of the _opts structs in drives */
|
||||
while (1) {
|
||||
seclen = burn_sector_length_read(d, o);
|
||||
|
||||
burn_print(12, "received %d blocks\n", page.sectors);
|
||||
for (i = 0; i < page.sectors; i++) {
|
||||
burn_packet_process(d, page.data + seclen * i, o);
|
||||
d->track_end--;
|
||||
@ -122,6 +123,7 @@ drive, or only store a subset of the _opts structs in drives */
|
||||
}
|
||||
|
||||
if ((d->cancel) || (drive_lba == LAST_SESSION_END(d))) {
|
||||
burn_print(1, "finished or cancelled\n");
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
if (!d->cancel)
|
||||
d->toc->complete = 1;
|
||||
@ -135,14 +137,16 @@ drive, or only store a subset of the _opts structs in drives */
|
||||
if (d->currtrack >
|
||||
d->toc->session[d->currsession].lasttrack) {
|
||||
d->currsession++;
|
||||
/* session switch to d->currsession */
|
||||
/* skipping a lead out */
|
||||
burn_print(12, "session switch to %d\n",
|
||||
d->currsession);
|
||||
burn_print(12, "skipping a lead out\n");
|
||||
drive_lba = CURRENT_SESSION_START(d);
|
||||
burn_print(12, "new lba %d\n", drive_lba);
|
||||
/* XXX more of the same
|
||||
end = burn_track_end(d, d->currsession,
|
||||
d->currtrack);
|
||||
*/
|
||||
}
|
||||
*/ }
|
||||
burn_print(12, "track switch to %d\n", d->currtrack);
|
||||
}
|
||||
|
||||
page.sectors = 0;
|
||||
@ -197,21 +201,23 @@ static int bitcount(unsigned char *data, int n)
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
void burn_packet_process(struct burn_drive *d, unsigned char *data,
|
||||
const struct burn_read_opts *o)
|
||||
{
|
||||
unsigned char sub[96];
|
||||
unsigned short crc;
|
||||
int ptr = 2352, i, j, code, fb;
|
||||
int audio = 1;
|
||||
#ifndef Libburn_no_crc_C
|
||||
unsigned short crc;
|
||||
#endif
|
||||
|
||||
if (o->c2errors) {
|
||||
fb = bitcount(data + ptr, 294);
|
||||
if (fb) {
|
||||
/* bitcount(data + ptr, 294) damaged bits */;
|
||||
burn_print(1, "%d damaged bits\n",
|
||||
bitcount(data + ptr, 294));
|
||||
burn_print(1, "sending error on %s %s\n",
|
||||
d->idata->vendor, d->idata->product);
|
||||
/* XXX send a burn_message! burn_message_error(d,
|
||||
something); */
|
||||
}
|
||||
ptr += 294;
|
||||
}
|
||||
@ -247,17 +253,16 @@ void burn_packet_process(struct burn_drive *d, unsigned char *data,
|
||||
}
|
||||
}
|
||||
}
|
||||
crc = (*(sub + 22) << 8) + *(sub + 23);
|
||||
|
||||
#ifndef Libburn_no_crc_C
|
||||
crc = (*(sub + 22) << 8) + *(sub + 23);
|
||||
if (crc != crc_ccitt(sub + 12, 10)) {
|
||||
/*
|
||||
burn_print(1, "sending error on %s %s\n",
|
||||
d->idata->vendor, d->idata->product);
|
||||
e = burn_error();
|
||||
/* e = burn_error();
|
||||
e->drive = d;
|
||||
*/
|
||||
burn_print(1, "crc mismatch in Q\n");
|
||||
*/;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -281,12 +286,8 @@ void burn_packet_process(struct burn_drive *d, unsigned char *data,
|
||||
/* so yeah, when you uncomment these, make them write zeros insted of crap
|
||||
static void write_empty_sector(int fd)
|
||||
{
|
||||
static char sec[2352], initialized = 0;
|
||||
char sec[2352];
|
||||
|
||||
if (!initialized) {
|
||||
memset(sec, 0, 2352);
|
||||
initialized = 1;
|
||||
}
|
||||
burn_print(1, "writing an 'empty' sector\n");
|
||||
write(fd, sec, 2352);
|
||||
}
|
||||
@ -338,7 +339,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
int alignment = 2048, start, upto, chunksize = 1, err, cpy_size, i;
|
||||
int sose_mem = 0, fd = -1, ret;
|
||||
char msg[81], *wpt;
|
||||
struct buffer *buf = NULL, *buffer_mem = d->buffer;
|
||||
struct buffer buf, *buffer_mem = d->buffer;
|
||||
|
||||
/*
|
||||
#define Libburn_read_data_adr_logginG 1
|
||||
@ -352,7 +353,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
fprintf(log_fp, "%d\n", (int) (byte_address / 2048));
|
||||
#endif /* Libburn_read_data_logginG */
|
||||
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
|
||||
*data_count = 0;
|
||||
sose_mem = d->silent_on_scsi_error;
|
||||
|
||||
@ -361,20 +362,20 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
d->global_index, 0x00020142,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is not grabbed on random access read", 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
if (d->drive_role == 0) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020146,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is a virtual placeholder (null-drive)", 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
} else if (d->drive_role == 3) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020151,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Read attempt on write-only drive", 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
if ((byte_address % alignment) != 0) {
|
||||
sprintf(msg,
|
||||
@ -384,7 +385,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
0x00020143,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
if (d->media_read_capacity != 0x7fffffff && byte_address >=
|
||||
((off_t) d->media_read_capacity + (off_t) 1) * (off_t) 2048) {
|
||||
@ -398,7 +399,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
}
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (d->busy != BURN_DRIVE_IDLE) {
|
||||
@ -406,7 +407,7 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
d->global_index, 0x00020145,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is busy on attempt to read data", 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (d->drive_role != 1) {
|
||||
@ -422,41 +423,28 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
d->stdio_fd = fd =
|
||||
open(d->devname, O_RDONLY | O_LARGEFILE);
|
||||
if (fd == -1) {
|
||||
if (errno == EACCES && (flag & 2)) {
|
||||
if (!(flag & 8))
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020183,
|
||||
LIBDAX_MSGS_SEV_WARNING,
|
||||
LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Failed to open device (a pseudo-drive) for reading",
|
||||
errno, 0);
|
||||
} else if (errno!= ENOENT || !(flag & 2))
|
||||
if (errno != ENOENT || !(flag & 2))
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020005,
|
||||
d->global_index,
|
||||
0x00020005,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Failed to open device (a pseudo-drive) for reading",
|
||||
errno, 0);
|
||||
ret = 0;
|
||||
if (errno == EACCES && (flag & 8))
|
||||
ret= -2;
|
||||
goto ex;
|
||||
ret = 0; goto ex;
|
||||
}
|
||||
if (lseek(fd, byte_address, SEEK_SET) == -1) {
|
||||
if (!(flag & 2)) {
|
||||
sprintf(msg, "Cannot address start byte %.f",
|
||||
(double) byte_address);
|
||||
if (!(flag & 2))
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index,
|
||||
0x00020147,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, errno, 0);
|
||||
}
|
||||
"Cannot address start byte", errno, 0);
|
||||
ret = 0; goto ex;
|
||||
}
|
||||
}
|
||||
|
||||
d->busy = BURN_DRIVE_READING_SYNC;
|
||||
d->buffer = buf;
|
||||
d->buffer = &buf;
|
||||
|
||||
start = byte_address / 2048;
|
||||
upto = start + data_size / 2048;
|
||||
@ -523,7 +511,10 @@ int burn_read_data(struct burn_drive *d, off_t byte_address,
|
||||
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
/* <<< let it open until drive is given up or writing shall happen
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
*/
|
||||
d->buffer = buffer_mem;
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
return ret;
|
||||
|
@ -54,21 +54,20 @@ static unsigned char SBC_STOP_UNIT[] = { 0x1b, 0, 0, 0, 0, 0 };
|
||||
|
||||
void sbc_load(struct burn_drive *d)
|
||||
{
|
||||
struct command *c;
|
||||
struct command c;
|
||||
|
||||
c = &(d->casual_command);
|
||||
if (mmc_function_spy(d, "load") <= 0)
|
||||
return;
|
||||
|
||||
scsi_init_command(c, SBC_LOAD, sizeof(SBC_LOAD));
|
||||
c->retry = 1;
|
||||
scsi_init_command(&c, SBC_LOAD, sizeof(SBC_LOAD));
|
||||
c.retry = 1;
|
||||
|
||||
/* ts A70921 : Had to revoke Immed because of LG GSA-4082B */
|
||||
/* c->opcode[1] |= 1; / * ts A70918 : Immed */
|
||||
/* c.opcode[1] |= 1; / * ts A70918 : Immed */
|
||||
|
||||
c->dir = NO_TRANSFER;
|
||||
d->issue_command(d, c);
|
||||
if (c->error)
|
||||
c.dir = NO_TRANSFER;
|
||||
d->issue_command(d, &c);
|
||||
if (c.error)
|
||||
return;
|
||||
/* ts A70923 : Needed regardless of Immed bit. Was once 1 minute, now
|
||||
5 minutes for loading. If this does not suffice then other commands
|
||||
@ -78,21 +77,20 @@ void sbc_load(struct burn_drive *d)
|
||||
|
||||
void sbc_eject(struct burn_drive *d)
|
||||
{
|
||||
struct command *c;
|
||||
struct command c;
|
||||
|
||||
c = &(d->casual_command);
|
||||
if (mmc_function_spy(d, "eject") <= 0)
|
||||
return;
|
||||
|
||||
scsi_init_command(c, SBC_UNLOAD, sizeof(SBC_UNLOAD));
|
||||
/* c->opcode[1] |= 1; / * ts A70918 : Immed , ts B00109 : revoked */
|
||||
c->page = NULL;
|
||||
c->dir = NO_TRANSFER;
|
||||
d->issue_command(d, c);
|
||||
scsi_init_command(&c, SBC_UNLOAD, sizeof(SBC_UNLOAD));
|
||||
/* c.opcode[1] |= 1; / * ts A70918 : Immed , ts B00109 : revoked */
|
||||
c.page = NULL;
|
||||
c.dir = NO_TRANSFER;
|
||||
d->issue_command(d, &c);
|
||||
/* ts A70918 : Wait long. A late eject could surprise or hurt user.
|
||||
ts B00109 : Asynchronous eject revoked, as one cannot reliably
|
||||
distinguish out from unready.
|
||||
if (c->error)
|
||||
if (c.error)
|
||||
return;
|
||||
spc_wait_unit_attention(d, 1800, "STOP UNIT (+ EJECT)", 0);
|
||||
*/
|
||||
@ -104,19 +102,18 @@ void sbc_eject(struct burn_drive *d)
|
||||
*/
|
||||
int sbc_start_unit_flag(struct burn_drive *d, int flag)
|
||||
{
|
||||
struct command *c;
|
||||
struct command c;
|
||||
int ret;
|
||||
|
||||
c = &(d->casual_command);
|
||||
if (mmc_function_spy(d, "start_unit") <= 0)
|
||||
return 0;
|
||||
|
||||
scsi_init_command(c, SBC_START_UNIT, sizeof(SBC_START_UNIT));
|
||||
c->retry = 1;
|
||||
c->opcode[1] |= (flag & 1); /* ts A70918 : Immed */
|
||||
c->dir = NO_TRANSFER;
|
||||
d->issue_command(d, c);
|
||||
if (c->error)
|
||||
scsi_init_command(&c, SBC_START_UNIT, sizeof(SBC_START_UNIT));
|
||||
c.retry = 1;
|
||||
c.opcode[1] |= (flag & 1); /* ts A70918 : Immed */
|
||||
c.dir = NO_TRANSFER;
|
||||
d->issue_command(d, &c);
|
||||
if (c.error)
|
||||
return 0;
|
||||
if (!(flag & 1))
|
||||
return 1;
|
||||
@ -147,19 +144,18 @@ int sbc_start_unit(struct burn_drive *d)
|
||||
/* ts A90824 : Trying to reduce drive noise */
|
||||
int sbc_stop_unit(struct burn_drive *d)
|
||||
{
|
||||
struct command *c;
|
||||
struct command c;
|
||||
int ret;
|
||||
|
||||
c = &(d->casual_command);
|
||||
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)
|
||||
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;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -179,22 +179,10 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data)
|
||||
if (!shortage)
|
||||
goto ex;
|
||||
|
||||
/* ts A61031 - B10103 */
|
||||
/* ts A61031 */
|
||||
if (shortage >= count)
|
||||
track->track_data_done = 1;
|
||||
if (track->end_on_premature_eoi && shortage >= count &&
|
||||
!track->open_ended) {
|
||||
char msg[80];
|
||||
/* Memorize that premature end of input happened */
|
||||
sprintf(msg,
|
||||
"Premature end of input encountered. Missing: %d bytes",
|
||||
shortage);
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00020180,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0,0);
|
||||
track->end_on_premature_eoi = 2;
|
||||
}
|
||||
if (track->open_ended || track->end_on_premature_eoi)
|
||||
if (track->open_ended)
|
||||
goto ex;
|
||||
|
||||
/* If we're still short, and there's a "next" pointer, we pull from that.
|
||||
@ -700,7 +688,7 @@ int sector_data(struct burn_write_opts *o, struct burn_track *t, int psub)
|
||||
return 0;
|
||||
|
||||
/* ts A61031 */
|
||||
if ((t->open_ended || t->end_on_premature_eoi) && t->track_data_done) {
|
||||
if (t->open_ended && t->track_data_done) {
|
||||
unget_sector(o, t->mode);
|
||||
return 2;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/*
|
||||
Copyright (c) 2009 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2009 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -44,7 +44,6 @@ Present implementation: default dummy which enables libburn only to work
|
||||
#include "debug.h"
|
||||
#include "toc.h"
|
||||
#include "util.h"
|
||||
#include "init.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
@ -252,13 +251,12 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
struct statvfs vfsbuf;
|
||||
#endif
|
||||
|
||||
char *testpath = NULL, *cpt;
|
||||
char testpath[4096], *cpt;
|
||||
long blocks;
|
||||
off_t add_size = 0;
|
||||
int ret;
|
||||
|
||||
BURN_ALLOC_MEM(testpath, char, 4096);
|
||||
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
if (stat(path, &stbuf) == -1) {
|
||||
strcpy(testpath, path);
|
||||
cpt = strrchr(testpath, '/');
|
||||
@ -269,21 +267,18 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
{ret = -1; goto ex;}
|
||||
return -1;
|
||||
|
||||
#ifdef Libburn_if_this_was_linuX
|
||||
|
||||
} else if(S_ISBLK(stbuf.st_mode)) {
|
||||
long blocks;
|
||||
|
||||
blocks = *bytes / 512;
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
ret = ioctl(fd, BLKGETSIZE, &blocks);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = ((off_t) blocks) * (off_t) 512;
|
||||
|
||||
#endif /* Libburn_if_this_was_linuX */
|
||||
@ -292,28 +287,25 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
|
||||
if (testpath[0]) {
|
||||
|
||||
#ifdef Libburn_os_has_statvfS
|
||||
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
|
||||
#else /* Libburn_os_has_statvfS */
|
||||
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
|
||||
#endif /* ! Libburn_os_has_stavtfS */
|
||||
|
||||
}
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(testpath);
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,14 +1,11 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/*
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
|
||||
/* THIS CODE IS NOT FUNCTIONAL YET !!! */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
This is the main operating system dependent SCSI part of libburn. It implements
|
||||
@ -163,7 +160,7 @@ static int sg_init_enumerator(burn_drive_enumerator_t *idx)
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&(idx->ccb), 0, sizeof(union ccb));
|
||||
bzero(&(idx->ccb), sizeof(union ccb));
|
||||
|
||||
idx->ccb.ccb_h.path_id = CAM_XPT_PATH_ID;
|
||||
idx->ccb.ccb_h.target_id = CAM_TARGET_WILDCARD;
|
||||
@ -493,8 +490,10 @@ int sg_grab(struct burn_drive *d)
|
||||
*/
|
||||
int sg_release(struct burn_drive *d)
|
||||
{
|
||||
if (d->cam == NULL)
|
||||
if (d->cam == NULL) {
|
||||
burn_print(1, "release an ungrabbed drive. die\n");
|
||||
return 0;
|
||||
}
|
||||
sg_close_drive(d);
|
||||
return 0;
|
||||
}
|
||||
@ -721,12 +720,13 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
{
|
||||
struct stat stbuf;
|
||||
struct statvfs vfsbuf;
|
||||
char *testpath = NULL, *cpt;
|
||||
char testpath[4096], *cpt;
|
||||
long blocks;
|
||||
int open_mode = O_RDWR, fd, ret;
|
||||
off_t add_size = 0;
|
||||
int fd, ret;
|
||||
|
||||
BURN_ALLOC_MEM(testpath, char, 4096);
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
if (stat(path, &stbuf) == -1) {
|
||||
strcpy(testpath, path);
|
||||
cpt = strrchr(testpath, '/');
|
||||
@ -737,54 +737,38 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
{ret = -1; goto ex;}
|
||||
return -1;
|
||||
|
||||
#ifdef Libburn_if_this_was_linuX
|
||||
|
||||
} else if(S_ISBLK(stbuf.st_mode)) {
|
||||
int open_mode = O_RDWR, fd, ret;
|
||||
long blocks;
|
||||
|
||||
blocks = *bytes / 512;
|
||||
if(burn_sg_open_o_excl)
|
||||
open_mode |= O_EXCL;
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
ret = ioctl(fd, BLKGETSIZE, &blocks);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = ((off_t) blocks) * (off_t) 512;
|
||||
|
||||
#endif /* Libburn_if_this_was_linuX */
|
||||
|
||||
|
||||
} else if(S_ISCHR(stbuf.st_mode)) {
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd == -1)
|
||||
{ret = -2; goto ex;}
|
||||
ret = ioctl(fd, DIOCGMEDIASIZE, &add_size);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
{ret = -2; goto ex;}
|
||||
*bytes = add_size;
|
||||
} else if(S_ISREG(stbuf.st_mode)) {
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
|
||||
if (testpath[0]) {
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
}
|
||||
ret = 1;
|
||||
ex:
|
||||
BURN_FREE_MEM(testpath);
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,9 +1,8 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/*
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later
|
||||
and under FreeBSD license revised, i.e. without advertising clause.
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -55,7 +54,6 @@
|
||||
#include "debug.h"
|
||||
#include "toc.h"
|
||||
#include "util.h"
|
||||
#include "init.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
@ -176,7 +174,7 @@ static int sg_init_enumerator(burn_drive_enumerator_t *idx_)
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&(idx->ccb), 0, sizeof(union ccb));
|
||||
bzero(&(idx->ccb), sizeof(union ccb));
|
||||
|
||||
idx->ccb.ccb_h.path_id = CAM_XPT_PATH_ID;
|
||||
idx->ccb.ccb_h.target_id = CAM_TARGET_WILDCARD;
|
||||
@ -508,9 +506,12 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
|
||||
|
||||
/* try to get the drive info */
|
||||
if (t->grab(t)) {
|
||||
burn_print(2, "getting drive info\n");
|
||||
t->getcaps(t);
|
||||
t->unlock(t);
|
||||
t->released = 1;
|
||||
} else {
|
||||
burn_print(2, "unable to grab new located drive\n");
|
||||
}
|
||||
|
||||
/* ts A60821
|
||||
@ -672,9 +673,8 @@ static int freebsd_dev_lock(int dev_fd, char *devname,
|
||||
static int sg_lock(struct burn_drive *d, int flag)
|
||||
{
|
||||
int ret, os_errno, pass_dev_no = -1, flock_fd = -1;
|
||||
char *msg = NULL;
|
||||
char msg[4096];
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 4096);
|
||||
ret = freebsd_dev_lock(d->cam->fd, d->devname,
|
||||
&os_errno, &pass_dev_no, &flock_fd, msg, 0);
|
||||
if (ret <= 0) {
|
||||
@ -683,15 +683,12 @@ static int sg_lock(struct burn_drive *d, int flag)
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, os_errno, 0);
|
||||
sg_close_drive(d);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
if (d->lock_fd > 0)
|
||||
close(d->lock_fd);
|
||||
d->lock_fd = flock_fd;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -748,8 +745,10 @@ int sg_release(struct burn_drive *d)
|
||||
if (mmc_function_spy(d, "sg_release") <= 0)
|
||||
return 0;
|
||||
|
||||
if (d->cam == NULL)
|
||||
if (d->cam == NULL) {
|
||||
burn_print(1, "release an ungrabbed drive. die\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
mmc_function_spy(NULL, "sg_release ----------- closing.");
|
||||
|
||||
@ -760,13 +759,19 @@ int sg_release(struct burn_drive *d)
|
||||
|
||||
int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
{
|
||||
int done = 0, err, sense_len = 0, ret, ignore_error, i;
|
||||
int done = 0, err, sense_len = 0, ret, ignore_error, no_retry = 0, i;
|
||||
int cam_pass_err_recover = 0, key, asc, ascq, timeout_ms;
|
||||
union ccb *ccb;
|
||||
char buf[161];
|
||||
static FILE *fp = NULL;
|
||||
time_t start_time;
|
||||
|
||||
mmc_function_spy(NULL, "sg_issue_command");
|
||||
#define Libburn_use_scsi_eval_cmd_outcomE yes
|
||||
|
||||
snprintf(buf, sizeof (buf),
|
||||
"sg_issue_command d->cam=%p d->released=%d",
|
||||
(void*)d->cam, d->released);
|
||||
mmc_function_spy(NULL, buf);
|
||||
|
||||
if (d->cam == NULL) {
|
||||
c->error = 0;
|
||||
@ -865,7 +870,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
/* ts B00110 */
|
||||
/* Better curb sense_len */
|
||||
sense_len = ccb->csio.sense_len;
|
||||
if (sense_len > (int) sizeof(c->sense))
|
||||
if (sense_len > sizeof(c->sense))
|
||||
sense_len = sizeof(c->sense);
|
||||
memcpy(c->sense, &ccb->csio.sense_data, sense_len);
|
||||
spc_decode_sense(c->sense, sense_len,
|
||||
@ -953,22 +958,70 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
c->sense[2] = 0x02;
|
||||
c->sense[12] = 0x04;
|
||||
c->sense[13] = 0x00;
|
||||
done = 1;
|
||||
no_retry = 1;
|
||||
}
|
||||
|
||||
/* >>> Need own duration time measurement.
|
||||
Then remove bit1 from flag.
|
||||
*/
|
||||
|
||||
#ifdef Libburn_use_scsi_eval_cmd_outcomE
|
||||
|
||||
done = scsi_eval_cmd_outcome(d, c, fp, c->sense,
|
||||
sense_len, 0, start_time,
|
||||
timeout_ms, i,
|
||||
2 | !!ignore_error);
|
||||
|
||||
#else /* Libburn_use_scsi_eval_cmd_outcomE */
|
||||
|
||||
if (no_retry || ignore_error || !c->retry) {
|
||||
c->error = 1;
|
||||
{ret = 1; goto ex;}
|
||||
}
|
||||
switch (scsi_error(d, c->sense, 0)) {
|
||||
case RETRY:
|
||||
done = 0;
|
||||
if (burn_sg_log_scsi & 3) {
|
||||
/* >>> Need own duration time
|
||||
measurement. Then remove bit1 */
|
||||
scsi_log_err(c, fp, c->sense,
|
||||
sense_len > 0 ? sense_len : 18,
|
||||
0, 1 | 2);
|
||||
scsi_log_cmd(c,fp,0);
|
||||
}
|
||||
break;
|
||||
case FAIL:
|
||||
done = 1;
|
||||
c->error = 1;
|
||||
break;
|
||||
case GO_ON:
|
||||
if (burn_sg_log_scsi & 3)
|
||||
/* >>> Need own duration time
|
||||
measurement. Then remove bit1 */
|
||||
scsi_log_err(c, fp, c->sense,
|
||||
sense_len > 0 ? sense_len : 18,
|
||||
0, 1 | 2);
|
||||
{ret = 1; goto ex;}
|
||||
}
|
||||
|
||||
#endif /* ! Libburn_use_scsi_eval_cmd_outcomE */
|
||||
|
||||
} else {
|
||||
done = 1;
|
||||
}
|
||||
} while (!done);
|
||||
ret = 1;
|
||||
ex:;
|
||||
|
||||
#ifndef Libburn_use_scsi_eval_cmd_outcomE
|
||||
|
||||
if (c->error)
|
||||
scsi_notify_error(d, c, c->sense, 18, 0);
|
||||
|
||||
if (burn_sg_log_scsi & 3)
|
||||
/* >>> Need own duration time measurement. Then remove bit1 */
|
||||
scsi_log_err(c, fp, c->sense, sense_len > 0 ? sense_len : 18,
|
||||
0, (c->error != 0) | 2);
|
||||
|
||||
#endif /* ! Libburn_use_scsi_eval_cmd_outcomE */
|
||||
|
||||
cam_freeccb(ccb);
|
||||
return ret;
|
||||
}
|
||||
@ -981,13 +1034,12 @@ ex:;
|
||||
int burn_os_is_2k_seekrw(char *path, int flag)
|
||||
{
|
||||
struct stat stbuf;
|
||||
#ifdef Libburn_DIOCGMEDIASIZE_ISBLK
|
||||
int fd, ret;
|
||||
off_t add_size;
|
||||
#else
|
||||
char *spt;
|
||||
int i, e;
|
||||
#endif /* ! Libburn_DIOCGMEDIASIZE_ISBLK */
|
||||
#ifdef Libburn_DIOCGMEDIASIZE_ISBLK
|
||||
int fd;
|
||||
off_t add_size;
|
||||
#endif
|
||||
|
||||
if (stat(path, &stbuf) == -1)
|
||||
return 0;
|
||||
@ -1007,7 +1059,7 @@ int burn_os_is_2k_seekrw(char *path, int flag)
|
||||
ret = ioctl(fd, DIOCGMEDIASIZE, &add_size);
|
||||
close(fd);
|
||||
|
||||
return (ret != -1);
|
||||
return 1;
|
||||
|
||||
#else /* Libburn_DIOCGMEDIASIZE_ISBLK */
|
||||
|
||||
@ -1053,12 +1105,13 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
{
|
||||
struct stat stbuf;
|
||||
struct statvfs vfsbuf;
|
||||
char *testpath = NULL, *cpt;
|
||||
char testpath[4096], *cpt;
|
||||
long blocks;
|
||||
off_t add_size = 0;
|
||||
int fd, ret;
|
||||
|
||||
BURN_ALLOC_MEM(testpath, char, 4096);
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
if (stat(path, &stbuf) == -1) {
|
||||
strcpy(testpath, path);
|
||||
cpt = strrchr(testpath, '/');
|
||||
@ -1069,24 +1122,22 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
{ret = -1; goto ex;}
|
||||
return -1;
|
||||
|
||||
#ifdef Libburn_if_this_was_linuX
|
||||
|
||||
} else if(S_ISBLK(stbuf.st_mode)) {
|
||||
int open_mode = O_RDWR, fd, ret;
|
||||
long blocks;
|
||||
|
||||
blocks = *bytes / 512;
|
||||
if(burn_sg_open_o_excl)
|
||||
open_mode |= O_EXCL;
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
ret = ioctl(fd, BLKGETSIZE, &blocks);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = ((off_t) blocks) * (off_t) 512;
|
||||
|
||||
#endif /* Libburn_if_this_was_linuX */
|
||||
@ -1095,28 +1146,25 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
} else if(S_ISCHR(stbuf.st_mode)) {
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
ret = ioctl(fd, DIOCGMEDIASIZE, &add_size);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = add_size;
|
||||
} else if(S_ISREG(stbuf.st_mode)) {
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
|
||||
if (testpath[0]) {
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
}
|
||||
ret = 1;
|
||||
ex:
|
||||
BURN_FREE_MEM(testpath);
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/*
|
||||
Copyright (c) 2009 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -142,9 +142,6 @@ Send feedback to libburn-hackers@pykix.org .
|
||||
#define Libburn_is_on_solariS 1
|
||||
#endif
|
||||
|
||||
/* Proposal by Rocky Bernstein to avoid macro clashes with cdio_config.h */
|
||||
#define __CDIO_CONFIG_H__ 1
|
||||
|
||||
#include <cdio/cdio.h>
|
||||
#include <cdio/logging.h>
|
||||
#include <cdio/mmc.h>
|
||||
@ -171,7 +168,6 @@ Send feedback to libburn-hackers@pykix.org .
|
||||
#include "debug.h"
|
||||
#include "toc.h"
|
||||
#include "util.h"
|
||||
#include "init.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
@ -262,7 +258,7 @@ try_next:;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((ssize_t) strlen(*(idx->pos)) >= adr_size)
|
||||
if (strlen(*(idx->pos)) >= adr_size)
|
||||
return -1;
|
||||
strcpy(adr, *(idx->pos));
|
||||
(idx->pos)++;
|
||||
@ -433,18 +429,17 @@ int sg_dispose_drive(struct burn_drive *d, int flag)
|
||||
int sg_give_next_adr(burn_drive_enumerator_t *idx,
|
||||
char adr[], int adr_size, int initialize)
|
||||
{
|
||||
int ret, recursion_count = 0, path_size = 4096;
|
||||
char *path = NULL;
|
||||
int ret, recursion_count = 0;
|
||||
char path[4096];
|
||||
#ifdef Libburn_is_on_solariS
|
||||
int l;
|
||||
#endif
|
||||
BURN_ALLOC_MEM(path, char, path_size);
|
||||
|
||||
ret = sg_give_next_adr_raw(idx, adr, adr_size, initialize);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
if ((ssize_t) strlen(adr) >= path_size)
|
||||
goto ex;
|
||||
return ret;
|
||||
if (strlen(adr) >= sizeof(path))
|
||||
return ret;
|
||||
|
||||
#ifdef Libburn_is_on_solariS
|
||||
/* >>> provisory : preserve Solaris /dev/rdsk/cXtYdZs2 addresses */
|
||||
@ -452,16 +447,13 @@ int sg_give_next_adr(burn_drive_enumerator_t *idx,
|
||||
if (l >= 18)
|
||||
if (strncmp(adr, "/dev/rdsk/c", 11) == 0 && adr[11] >= '0' &&
|
||||
adr[11] <= '9' && strcmp(adr + (l - 2), "s2") == 0)
|
||||
{ret = 1; goto ex;}
|
||||
return 1;
|
||||
#endif /* Libburn_is_on_solariS */
|
||||
|
||||
ret = burn_drive_resolve_link(adr, path, &recursion_count, 2);
|
||||
if(ret > 0 && (ssize_t) strlen(path) < adr_size)
|
||||
strcpy(adr, path);
|
||||
ret = (ret >= 0);
|
||||
ex:
|
||||
BURN_FREE_MEM(path);
|
||||
return ret;
|
||||
if(ret > 0 && strlen(path) < adr_size)
|
||||
strcpy(path, adr);
|
||||
return (ret >= 0);
|
||||
}
|
||||
|
||||
|
||||
@ -473,17 +465,13 @@ int scsi_enumerate_drives(void)
|
||||
burn_drive_enumerator_t idx;
|
||||
int initialize = 1, ret, i_bus_no = -1, recursion_count = 0;
|
||||
int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
|
||||
int buf_size = 4096;
|
||||
char *buf = NULL, *target = NULL;
|
||||
char buf[4096], target[4096];
|
||||
#ifdef Libburn_is_on_solariS
|
||||
int l;
|
||||
#endif
|
||||
|
||||
BURN_ALLOC_MEM(buf, char, buf_size);
|
||||
BURN_ALLOC_MEM(target, char, buf_size);
|
||||
|
||||
while(1) {
|
||||
ret = sg_give_next_adr_raw(&idx, buf, buf_size, initialize);
|
||||
ret = sg_give_next_adr_raw(&idx, buf, sizeof(buf), initialize);
|
||||
initialize = 0;
|
||||
if (ret <= 0)
|
||||
break;
|
||||
@ -513,12 +501,8 @@ int scsi_enumerate_drives(void)
|
||||
i_bus_no, i_host_no, i_channel_no,
|
||||
i_target_no, i_lun_no);
|
||||
}
|
||||
sg_give_next_adr(&idx, buf, buf_size, -1);
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
BURN_FREE_MEM(target);
|
||||
return ret;
|
||||
sg_give_next_adr(&idx, buf, sizeof(buf), -1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -542,12 +526,12 @@ int sg_drive_is_open(struct burn_drive * d)
|
||||
int sg_grab(struct burn_drive *d)
|
||||
{
|
||||
CdIo_t *p_cdio;
|
||||
char *am_eff, *msg = NULL, *am_wanted;
|
||||
int os_errno, second_try = 0, ret;
|
||||
char *am_eff, msg[4096], *am_wanted;
|
||||
int os_errno, second_try = 0;
|
||||
|
||||
if (d->p_cdio != NULL) {
|
||||
d->released = 0;
|
||||
{ret = 1; goto ex;}
|
||||
return 1;
|
||||
}
|
||||
if (d->libcdio_name[0] == 0) /* just to be sure it is initialized */
|
||||
strcpy(d->libcdio_name, d->devname);
|
||||
@ -555,14 +539,13 @@ int sg_grab(struct burn_drive *d)
|
||||
try_to_open:;
|
||||
p_cdio = cdio_open_am(d->libcdio_name, DRIVER_DEVICE, am_wanted);
|
||||
if (p_cdio == NULL) {
|
||||
BURN_ALLOC_MEM(msg, char, 4096);
|
||||
os_errno = errno;
|
||||
sprintf(msg, "Could not grab drive '%s'", d->devname);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020003,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, os_errno, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
am_eff = (char *) cdio_get_arg(p_cdio, "access-mode");
|
||||
if (strncmp(am_eff, "MMC_RDWR", 8) != 0) {
|
||||
@ -577,15 +560,12 @@ try_to_open:;
|
||||
0x00020003,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"libcdio provides no MMC_RDWR access mode", 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
|
||||
d->p_cdio = p_cdio;
|
||||
d->released = 0;
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -597,13 +577,18 @@ ex:;
|
||||
*/
|
||||
int sg_release(struct burn_drive *d)
|
||||
{
|
||||
if (d->p_cdio == NULL)
|
||||
if (d->p_cdio == NULL) {
|
||||
burn_print(1, "release an ungrabbed drive. die\n");
|
||||
return 0;
|
||||
}
|
||||
sg_close_drive(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#define Libburn_use_scsi_eval_cmd_outcomE yes
|
||||
|
||||
|
||||
/** Sends a SCSI command to the drive, receives reply and evaluates wether
|
||||
the command succeeded or shall be retried or finally failed.
|
||||
Returned SCSI errors shall not lead to a return value indicating failure.
|
||||
@ -615,7 +600,7 @@ int sg_release(struct burn_drive *d)
|
||||
*/
|
||||
int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
{
|
||||
int sense_valid = 0, i, timeout_ms, sense_len;
|
||||
int sense_valid = 0, i, timeout_ms, no_retry = 0;
|
||||
int key = 0, asc = 0, ascq = 0, done = 0;
|
||||
time_t start_time;
|
||||
driver_return_code_t i_status;
|
||||
@ -624,7 +609,11 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
mmc_cdb_t cdb = {{0, }};
|
||||
cdio_mmc_direction_t e_direction;
|
||||
CdIo_t *p_cdio;
|
||||
cdio_mmc_request_sense_t *sense_pt = NULL;
|
||||
unsigned char *sense_pt = NULL;
|
||||
|
||||
#ifndef Libburn_use_scsi_eval_cmd_outcomE
|
||||
int usleep_time;
|
||||
#endif
|
||||
|
||||
c->error = 0;
|
||||
if (d->p_cdio == NULL) {
|
||||
@ -667,9 +656,9 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
dxfer_len, c->page->data);
|
||||
sense_valid = mmc_last_cmd_sense(p_cdio, &sense_pt);
|
||||
if (sense_valid >= 18) {
|
||||
memcpy(c->sense, (unsigned char *) sense_pt,
|
||||
(size_t) sense_valid >= sizeof(c->sense) ?
|
||||
sizeof(c->sense) : (size_t) sense_valid );
|
||||
memcpy(c->sense, sense_pt,
|
||||
sense_valid >= sizeof(c->sense) ?
|
||||
sizeof(c->sense) : sense_valid );
|
||||
spc_decode_sense(c->sense, 0, &key, &asc, &ascq);
|
||||
} else
|
||||
key = asc = ascq = 0;
|
||||
@ -702,18 +691,72 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
c->sense[0] = 0x70; /*Fixed format sense data*/
|
||||
c->sense[2] = 0x02;
|
||||
c->sense[12] = 0x04;
|
||||
done = 1;
|
||||
no_retry = 1;
|
||||
}
|
||||
}
|
||||
if (key || asc || ascq)
|
||||
sense_len = 18;
|
||||
else
|
||||
sense_len = 0;
|
||||
done = scsi_eval_cmd_outcome(d, c, fp, c->sense, sense_len,
|
||||
if (i_status != 0 || (key || asc || ascq)) {
|
||||
|
||||
#ifdef Libburn_use_scsi_eval_cmd_outcomE
|
||||
|
||||
done = scsi_eval_cmd_outcome(d, c, fp, c->sense, 18,
|
||||
0, start_time, timeout_ms, i, 2);
|
||||
|
||||
#else /* Libburn_use_scsi_eval_cmd_outcomE */
|
||||
|
||||
if (no_retry || !c->retry) {
|
||||
c->error = 1;
|
||||
goto ex;
|
||||
}
|
||||
switch (scsi_error(d, c->sense, 18)) {
|
||||
case RETRY:
|
||||
if (burn_sg_log_scsi & 3) {
|
||||
/* >>> Need own duration time
|
||||
measurement. Then remove bit1 */
|
||||
scsi_log_err(c, fp, c->sense, 18, 0,
|
||||
1 | 2);
|
||||
scsi_log_cmd(c,fp,0);
|
||||
}
|
||||
break;
|
||||
case FAIL:
|
||||
c->error = 1;
|
||||
goto ex;
|
||||
case GO_ON:
|
||||
if (burn_sg_log_scsi & 3)
|
||||
/* >>> Need own duration time
|
||||
measurement. Then remove bit1 */
|
||||
scsi_log_err(c, fp, c->sense, 18, 0,
|
||||
1 | 2);
|
||||
goto ex;
|
||||
}
|
||||
/*
|
||||
Calming down retries and breaking up endless cycle
|
||||
*/
|
||||
usleep_time = Libburn_sg_libcdio_retry_usleeP +
|
||||
i * Libburn_sg_libcdio_retry_incR;
|
||||
if (time(NULL) + usleep_time / 1000000 - start_time >
|
||||
timeout_ms / 1000 + 1) {
|
||||
c->error = 1;
|
||||
goto ex;
|
||||
}
|
||||
usleep(usleep_time);
|
||||
#endif /* ! Libburn_use_scsi_eval_cmd_outcomE */
|
||||
|
||||
} else
|
||||
done = 1;
|
||||
|
||||
} /* end of retry-loop */
|
||||
|
||||
#ifndef Libburn_use_scsi_eval_cmd_outcomE
|
||||
|
||||
ex:;
|
||||
if (c->error)
|
||||
scsi_notify_error(d, c, c->sense, 18, 0);
|
||||
if (burn_sg_log_scsi & 3)
|
||||
/* >>> Need own duration time measurement. Then remove bit1 */
|
||||
scsi_log_err(c, fp, c->sense, 18, 0, (c->error != 0) | 2);
|
||||
|
||||
#endif /* ! Libburn_use_scsi_eval_cmd_outcomE */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -861,12 +904,12 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
struct statvfs vfsbuf;
|
||||
#endif
|
||||
|
||||
char *testpath = NULL, *cpt;
|
||||
char testpath[4096], *cpt;
|
||||
long blocks;
|
||||
off_t add_size = 0;
|
||||
int ret;
|
||||
|
||||
BURN_ALLOC_MEM(testpath, char, 4096);
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
if (stat(path, &stbuf) == -1) {
|
||||
strcpy(testpath, path);
|
||||
cpt = strrchr(testpath, '/');
|
||||
@ -877,23 +920,21 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
{ret = -1; goto ex;}
|
||||
return -1;
|
||||
|
||||
#ifdef __linux
|
||||
|
||||
/* GNU/Linux specific determination of block device size */
|
||||
} else if(S_ISBLK(stbuf.st_mode)) {
|
||||
int open_mode = O_RDONLY, fd;
|
||||
long blocks;
|
||||
int open_mode = O_RDONLY, fd, ret;
|
||||
|
||||
blocks = *bytes / 512;
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
ret = ioctl(fd, BLKGETSIZE, &blocks);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = ((off_t) blocks) * (off_t) 512;
|
||||
|
||||
#endif /* __linux */
|
||||
@ -901,15 +942,15 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
#ifdef Libburn_is_on_freebsD
|
||||
|
||||
} else if(S_ISCHR(stbuf.st_mode)) {
|
||||
int fd;
|
||||
int fd, ret;
|
||||
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
ret = ioctl(fd, DIOCGMEDIASIZE, &add_size);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = add_size;
|
||||
|
||||
#endif /* Libburn_is_on_freebsD */
|
||||
@ -921,12 +962,12 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = lseek(fd, 0, SEEK_END);
|
||||
close(fd);
|
||||
if (*bytes == -1) {
|
||||
*bytes = 0;
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* Libburn_is_on_solariS */
|
||||
@ -935,28 +976,25 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
|
||||
if (testpath[0]) {
|
||||
|
||||
#ifdef Libburn_os_has_statvfS
|
||||
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
|
||||
#else /* Libburn_os_has_statvfS */
|
||||
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
|
||||
#endif /* ! Libburn_os_has_stavtfS */
|
||||
|
||||
}
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(testpath);
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/*
|
||||
Copyright (c) 2010 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -140,7 +140,6 @@ Send feedback to libburn-hackers@pykix.org .
|
||||
#include "debug.h"
|
||||
#include "toc.h"
|
||||
#include "util.h"
|
||||
#include "init.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
@ -250,14 +249,12 @@ static int start_enum_cXtYdZs2(burn_drive_enumerator_t *idx, int flag)
|
||||
static int next_enum_cXtYdZs2(burn_drive_enumerator_t *idx,
|
||||
char adr[], int adr_size, int flag)
|
||||
{
|
||||
int busno, tgtno, lunno, ret, fd = -1, volpath_size = 160;
|
||||
char *volpath = NULL;
|
||||
int busno, tgtno, lunno, ret, fd = -1;
|
||||
char volpath[160];
|
||||
struct dirent *entry;
|
||||
struct dk_cinfo cinfo;
|
||||
DIR *dir;
|
||||
|
||||
BURN_ALLOC_MEM(volpath, char, volpath_size);
|
||||
|
||||
dir = idx->dir;
|
||||
while (1) {
|
||||
errno = 0;
|
||||
@ -269,11 +266,11 @@ static int next_enum_cXtYdZs2(burn_drive_enumerator_t *idx,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Cannot enumerate next device. readdir() from \"/dev/rdsk\" failed.",
|
||||
errno, 0);
|
||||
{ret = -1; goto ex;}
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (strlen(entry->d_name) > (size_t) (volpath_size - 11))
|
||||
if (strlen(entry->d_name) > sizeof(volpath) - 11)
|
||||
continue;
|
||||
ret = decode_btl_solaris(entry->d_name,
|
||||
&busno, &tgtno, &lunno, 0);
|
||||
@ -294,15 +291,12 @@ static int next_enum_cXtYdZs2(burn_drive_enumerator_t *idx,
|
||||
continue;
|
||||
if (cinfo.dki_ctype != DKC_CDROM)
|
||||
continue;
|
||||
if (adr_size <= (int) strlen(volpath))
|
||||
{ret = -1; goto ex;}
|
||||
if (adr_size <= strlen(volpath))
|
||||
return -1;
|
||||
strcpy(adr, volpath);
|
||||
{ret = 1; goto ex;}
|
||||
return 1;
|
||||
}
|
||||
ret = 0;
|
||||
ex:;
|
||||
BURN_FREE_MEM(volpath);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -463,14 +457,12 @@ int sg_give_next_adr(burn_drive_enumerator_t *idx,
|
||||
int scsi_enumerate_drives(void)
|
||||
{
|
||||
burn_drive_enumerator_t idx;
|
||||
int initialize = 1, ret, i_bus_no = -1, buf_size = 4096;
|
||||
int initialize = 1, ret, i_bus_no = -1;
|
||||
int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
|
||||
char *buf = NULL;
|
||||
|
||||
BURN_ALLOC_MEM(buf, char, buf_size);
|
||||
char buf[4096];
|
||||
|
||||
while(1) {
|
||||
ret = sg_give_next_adr(&idx, buf, buf_size, initialize);
|
||||
ret = sg_give_next_adr(&idx, buf, sizeof(buf), initialize);
|
||||
initialize = 0;
|
||||
if (ret <= 0)
|
||||
break;
|
||||
@ -482,11 +474,8 @@ int scsi_enumerate_drives(void)
|
||||
i_bus_no, i_host_no, i_channel_no,
|
||||
i_target_no, i_lun_no);
|
||||
}
|
||||
sg_give_next_adr(&idx, buf, buf_size, -1);
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(buf);
|
||||
return ret;
|
||||
sg_give_next_adr(&idx, buf, sizeof(buf), -1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -509,15 +498,13 @@ int sg_drive_is_open(struct burn_drive * d)
|
||||
*/
|
||||
int sg_grab(struct burn_drive *d)
|
||||
{
|
||||
char *msg = NULL;
|
||||
char msg[4096];
|
||||
int os_errno, ret;
|
||||
struct dk_cinfo cinfo;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 4096);
|
||||
|
||||
if (d->fd != -1) {
|
||||
d->released = 0;
|
||||
{ret = 1; goto ex;}
|
||||
return 1;
|
||||
}
|
||||
d->fd = open(d->devname, O_RDONLY | O_NDELAY);
|
||||
if (d->fd == -1) {
|
||||
@ -527,7 +514,7 @@ int sg_grab(struct burn_drive *d)
|
||||
0x00020003,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, os_errno, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
ret = ioctl(d->fd, DKIOCINFO, &cinfo);
|
||||
if (ret < 0)
|
||||
@ -538,7 +525,7 @@ int sg_grab(struct burn_drive *d)
|
||||
/* >>> obtain eventual locks */;
|
||||
|
||||
d->released = 0;
|
||||
{ret = 1; goto ex;}
|
||||
return 1;
|
||||
revoke:;
|
||||
sprintf(msg, "Could not grab drive '%s'. Not a CDROM device.",
|
||||
d->devname);
|
||||
@ -546,10 +533,7 @@ revoke:;
|
||||
0x00020003,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
ret = 0;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -561,8 +545,10 @@ ex:;
|
||||
*/
|
||||
int sg_release(struct burn_drive *d)
|
||||
{
|
||||
if (d->fd < 0)
|
||||
if (d->fd < 0) {
|
||||
burn_print(1, "release an ungrabbed drive. die\n");
|
||||
return 0;
|
||||
}
|
||||
sg_close_drive(d);
|
||||
return 0;
|
||||
}
|
||||
@ -579,12 +565,17 @@ int sg_release(struct burn_drive *d)
|
||||
*/
|
||||
int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
{
|
||||
int i, timeout_ms, ret, key, asc, ascq, done = 0, sense_len;
|
||||
int i, timeout_ms, ret, key, asc, ascq, done = 0;
|
||||
time_t start_time;
|
||||
struct uscsi_cmd cgc;
|
||||
char msg[80];
|
||||
static FILE *fp = NULL;
|
||||
|
||||
#define Libburn_use_scsi_eval_cmd_outcomE yes
|
||||
#ifndef Libburn_use_scsi_eval_cmd_outcomE
|
||||
int usleep_time, no_retry = 0;
|
||||
#endif
|
||||
|
||||
c->error = 0;
|
||||
memset(c->sense, 0, sizeof(c->sense));
|
||||
if (d->fd == -1)
|
||||
@ -653,6 +644,8 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef Libburn_use_scsi_eval_cmd_outcomE
|
||||
|
||||
|
||||
/* >>> Should replace "18" by realistic sense length.
|
||||
What's about following older remark ?
|
||||
@ -660,15 +653,76 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
/* >>> valid sense: cgc.uscsi_rqlen - cgc.uscsi_rqresid */;
|
||||
|
||||
spc_decode_sense(c->sense, 0, &key, &asc, &ascq);
|
||||
if (key || asc || ascq)
|
||||
sense_len = 18;
|
||||
else
|
||||
sense_len = 0;
|
||||
done = scsi_eval_cmd_outcome(d, c, fp, c->sense, sense_len, 0,
|
||||
if (key || asc || ascq) {
|
||||
done = scsi_eval_cmd_outcome(d, c, fp, c->sense, 18, 0,
|
||||
start_time, timeout_ms, i, 2);
|
||||
} else
|
||||
done = 1;
|
||||
|
||||
|
||||
#else /* Libburn_use_scsi_eval_cmd_outcomE */
|
||||
|
||||
|
||||
/* >>> valid sense: cgc.uscsi_rqlen - cgc.uscsi_rqresid */;
|
||||
|
||||
spc_decode_sense(c->sense, 0, &key, &asc, &ascq);
|
||||
if (key || asc || ascq) {
|
||||
if (no_retry || !c->retry) {
|
||||
c->error = 1;
|
||||
goto ex;
|
||||
}
|
||||
switch (scsi_error(d, c->sense, 18)) {
|
||||
case RETRY:
|
||||
if (burn_sg_log_scsi & 3) {
|
||||
/* >>> Need own duration time
|
||||
measurement. Then remove bit1 */
|
||||
scsi_log_err(c, fp, c->sense, 18, 0,
|
||||
1 | 2);
|
||||
scsi_log_cmd(c,fp,0);
|
||||
}
|
||||
break;
|
||||
case FAIL:
|
||||
c->error = 1;
|
||||
goto ex;
|
||||
case GO_ON:
|
||||
if (burn_sg_log_scsi & 3)
|
||||
/* >>> Need own duration time
|
||||
measurement. Then remove bit1 */
|
||||
scsi_log_err(c, fp, c->sense, 18, 0,
|
||||
1 | 2);
|
||||
goto ex;
|
||||
}
|
||||
/*
|
||||
Calming down retries and breaking up endless cycle
|
||||
*/
|
||||
usleep_time = Libburn_sg_solaris_retry_usleeP +
|
||||
i * Libburn_sg_solaris_retry_incR;
|
||||
if (time(NULL) + usleep_time / 1000000 - start_time >
|
||||
timeout_ms / 1000 + 1) {
|
||||
c->error = 1;
|
||||
goto ex;
|
||||
}
|
||||
usleep(usleep_time);
|
||||
} else
|
||||
break; /* retry-loop */
|
||||
|
||||
#endif /* ! Libburn_use_scsi_eval_cmd_outcomE */
|
||||
|
||||
} /* end of retry-loop */
|
||||
|
||||
#ifndef Libburn_use_scsi_eval_cmd_outcomE
|
||||
|
||||
ex:;
|
||||
|
||||
if (c->error)
|
||||
scsi_notify_error(d, c, c->sense, 18, 0);
|
||||
|
||||
if (burn_sg_log_scsi & 3)
|
||||
/* >>> Need own duration time measurement. Then remove bit1 */
|
||||
scsi_log_err(c, fp, c->sense, 18, 0, (c->error != 0) | 2);
|
||||
|
||||
#endif /* ! Libburn_use_scsi_eval_cmd_outcomE */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -777,18 +831,17 @@ int burn_os_is_2k_seekrw(char *path, int flag)
|
||||
int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
{
|
||||
struct stat stbuf;
|
||||
int ret;
|
||||
|
||||
#ifdef Libburn_os_has_statvfS
|
||||
struct statvfs vfsbuf;
|
||||
#endif
|
||||
|
||||
char *testpath = NULL, *cpt;
|
||||
char testpath[4096], *cpt;
|
||||
long blocks;
|
||||
off_t add_size = 0;
|
||||
|
||||
BURN_ALLOC_MEM(testpath, char, 4096);
|
||||
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
if (stat(path, &stbuf) == -1) {
|
||||
strcpy(testpath, path);
|
||||
cpt = strrchr(testpath, '/');
|
||||
@ -799,47 +852,44 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
{ret = -1; goto ex;}
|
||||
return -1;
|
||||
|
||||
} else if(S_ISBLK(stbuf.st_mode)) {
|
||||
int open_mode = O_RDONLY, fd;
|
||||
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = lseek(fd, 0, SEEK_END);
|
||||
close(fd);
|
||||
if (*bytes == -1) {
|
||||
*bytes = 0;
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
|
||||
} else if(S_ISREG(stbuf.st_mode)) {
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
|
||||
if (testpath[0]) {
|
||||
|
||||
#ifdef Libburn_os_has_statvfS
|
||||
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
{ret = -2; goto ex;}
|
||||
return -2;
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
|
||||
#else /* Libburn_os_has_statvfS */
|
||||
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
|
||||
#endif /* ! Libburn_os_has_stavtfS */
|
||||
|
||||
}
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(testpath);
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
12
libburn/sg.c
12
libburn/sg.c
@ -23,20 +23,12 @@
|
||||
#else
|
||||
#ifdef __FreeBSD__
|
||||
|
||||
#ifdef Libburn_use_sg_freebsd_porT
|
||||
#include "sg-freebsd-port.c"
|
||||
#else
|
||||
#include "sg-freebsd.c"
|
||||
#endif
|
||||
|
||||
#else
|
||||
#ifdef __FreeBSD_kernel__
|
||||
|
||||
#ifdef Libburn_use_sg_freebsd_porT
|
||||
#include "sg-freebsd-port.c"
|
||||
#else
|
||||
#include "sg-freebsd.c"
|
||||
#endif
|
||||
|
||||
#else
|
||||
#ifdef __linux
|
||||
@ -58,11 +50,11 @@
|
||||
static int intentional_compiler_warning(void)
|
||||
{
|
||||
int INTENTIONAL_COMPILER_WARNING_;
|
||||
int Cannot_recognize_GNU_Linux_nor_FreeBSD_nor_Solaris_;
|
||||
int Cannot_recognize_GNU_Linux_nor_FreeBSD_;
|
||||
int Have_to_use_dummy_MMC_transport_adapter_;
|
||||
int This_libburn_will_not_be_able_to_operate_on_real_CD_drives;
|
||||
int Have_to_use_dummy_MMC_transport_adapter;
|
||||
int Cannot_recognize_GNU_Linux_nor_FreeBSD_nor_Solaris;
|
||||
int Cannot_recognize_GNU_Linux_nor_FreeBSD;
|
||||
int INTENTIONAL_COMPILER_WARNING;
|
||||
|
||||
return(0);
|
||||
|
709
libburn/spc.c
709
libburn/spc.c
File diff suppressed because it is too large
Load Diff
@ -68,30 +68,15 @@ int scsi_init_command(struct command *c, unsigned char *opcode, int oplen);
|
||||
/* ts A91106 */
|
||||
int scsi_show_cmd_text(struct command *c, void *fp, int flag);
|
||||
|
||||
/* ts B11110 */
|
||||
/** Logs command (before execution). */
|
||||
int scsi_log_command(unsigned char *opcode, int oplen, int data_dir,
|
||||
unsigned char *data, int bytes,
|
||||
void *fp_in, int flag);
|
||||
/* ts A91106 */
|
||||
int scsi_show_cmd_reply(struct command *c, void *fp, int flag);
|
||||
|
||||
/* ts A91218 (former sg_log_cmd ts A70518) */
|
||||
/** Legacy frontend to scsi_log_command() */
|
||||
/** Logs command (before execution) */
|
||||
int scsi_log_cmd(struct command *c, void *fp, int flag);
|
||||
|
||||
/* ts B11110 */
|
||||
/** Logs outcome of a sg command.
|
||||
@param flag bit0 causes an error message
|
||||
bit1 do not print duration
|
||||
*/
|
||||
int scsi_log_reply(unsigned char *opcode, int data_dir, unsigned char *data,
|
||||
int dxfer_len, void *fp_in, unsigned char sense[18],
|
||||
int sense_len, int duration, int flag);
|
||||
|
||||
/* ts A91221 (former sg_log_err ts A91108) */
|
||||
/** Legacy frontend to scsi_log_reply().
|
||||
@param flag bit0 causes an error message
|
||||
bit1 do not print duration
|
||||
*/
|
||||
/** Logs outcome of a sg command. */
|
||||
int scsi_log_err(struct command *c, void *fp, unsigned char sense[18],
|
||||
int sense_len, int duration, int flag);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -18,7 +18,6 @@
|
||||
#include "structure.h"
|
||||
#include "write.h"
|
||||
#include "debug.h"
|
||||
#include "init.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
@ -34,7 +33,7 @@ extern struct libdax_msgs *libdax_messenger;
|
||||
return 0;\
|
||||
if (pos == BURN_POS_END)\
|
||||
pos = TO->NEW##s;\
|
||||
if ((int) pos > TO->NEW##s)\
|
||||
if (pos > TO->NEW##s)\
|
||||
return 0;\
|
||||
\
|
||||
tmp = realloc(TO->NEW, sizeof(struct NEW *) * (TO->NEW##s + 1));\
|
||||
@ -171,8 +170,6 @@ struct burn_track *burn_track_create(void)
|
||||
/* ts A61031 */
|
||||
t->open_ended = 0;
|
||||
t->track_data_done = 0;
|
||||
/* ts B10103 */
|
||||
t->end_on_premature_eoi = 0;
|
||||
|
||||
t->postgap = 0;
|
||||
t->pregap1 = 0;
|
||||
@ -242,12 +239,8 @@ int burn_session_remove_track(struct burn_session *s, struct burn_track *t)
|
||||
void burn_structure_print_disc(struct burn_disc *d)
|
||||
{
|
||||
int i;
|
||||
char msg[40];
|
||||
|
||||
sprintf(msg, "This disc has %d sessions", d->sessions);
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
burn_print(12, "This disc has %d sessions\n", d->sessions);
|
||||
for (i = 0; i < d->sessions; i++) {
|
||||
burn_structure_print_session(d->session[i]);
|
||||
}
|
||||
@ -255,25 +248,16 @@ void burn_structure_print_disc(struct burn_disc *d)
|
||||
void burn_structure_print_session(struct burn_session *s)
|
||||
{
|
||||
int i;
|
||||
char msg[40];
|
||||
|
||||
sprintf(msg, " Session has %d tracks", s->tracks);
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
burn_print(12, " Session has %d tracks\n", s->tracks);
|
||||
for (i = 0; i < s->tracks; i++) {
|
||||
burn_structure_print_track(s->track[i]);
|
||||
}
|
||||
}
|
||||
void burn_structure_print_track(struct burn_track *t)
|
||||
{
|
||||
char msg[80];
|
||||
|
||||
sprintf(msg, " track size %d sectors",
|
||||
burn_track_get_sectors(t));
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
burn_print(12, "(%p) track size %d sectors\n", t,
|
||||
burn_track_get_sectors(t));
|
||||
}
|
||||
|
||||
void burn_track_define_data(struct burn_track *t, int offset, int tail,
|
||||
@ -283,14 +267,13 @@ void burn_track_define_data(struct burn_track *t, int offset, int tail,
|
||||
int burn_sector_length(int tracktype);
|
||||
unsigned char ctladr;
|
||||
int form = -1; /* unchanged form will be considered an error too */
|
||||
char msg[80];
|
||||
|
||||
type_to_form(mode, &ctladr, &form);
|
||||
if (form == -1 || burn_sector_length(mode) <= 0) {
|
||||
char msg[160];
|
||||
|
||||
sprintf(msg,
|
||||
"Attempt to set track mode to unusable value 0x%X",
|
||||
(unsigned int) mode);
|
||||
sprintf(msg, "Attempt to set track mode to unusable value %d",
|
||||
mode);
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00020115,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
@ -411,6 +394,7 @@ int burn_track_get_sectors(struct burn_track *t)
|
||||
sectors = size / seclen;
|
||||
if (size % seclen)
|
||||
sectors++;
|
||||
burn_print(1, "%d sectors of %d length\n", sectors, seclen);
|
||||
return sectors;
|
||||
}
|
||||
|
||||
@ -460,16 +444,14 @@ int burn_track_set_fillup(struct burn_track *t, int fill_up_media)
|
||||
int burn_track_apply_fillup(struct burn_track *t, off_t max_size, int flag)
|
||||
{
|
||||
int max_sectors, ret = 2;
|
||||
char msg[80];
|
||||
char msg[160];
|
||||
|
||||
if (t->fill_up_media <= 0)
|
||||
return 2;
|
||||
max_sectors = max_size / 2048;
|
||||
if (burn_track_get_sectors(t) < max_sectors || (flag & 1)) {
|
||||
sprintf(msg, "Setting total track size to %ds (payload %ds)\n",
|
||||
max_sectors & 0x7fffffff,
|
||||
(int) ((t->source->get_size(t->source) / 2048)
|
||||
& 0x7fffffff));
|
||||
max_sectors, (int) (t->source->get_size(t->source)/2048));
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||
msg, 0, 0);
|
||||
@ -595,12 +577,11 @@ int burn_session_get_hidefirst(struct burn_session *session)
|
||||
/* ts A80808 : Enhance CD toc to DVD toc */
|
||||
int burn_disc_cd_toc_extensions(struct burn_disc *d, int flag)
|
||||
{
|
||||
int sidx= 0, tidx= 0, ret;
|
||||
int sidx= 0, tidx= 0;
|
||||
struct burn_toc_entry *entry, *prev_entry= NULL;
|
||||
/* ts A81126 : ticket 146 : There was a SIGSEGV in here */
|
||||
char *msg_data = NULL, *msg;
|
||||
char msg_data[321], *msg;
|
||||
|
||||
BURN_ALLOC_MEM(msg_data, char, 321);
|
||||
strcpy(msg_data,
|
||||
"Damaged CD table-of-content detected and truncated.");
|
||||
strcat(msg_data, " In burn_disc_cd_toc_extensions: ");
|
||||
@ -663,15 +644,12 @@ int burn_disc_cd_toc_extensions(struct burn_disc *d, int flag)
|
||||
prev_entry = entry;
|
||||
}
|
||||
}
|
||||
{ret = 1; goto ex;}
|
||||
return 1;
|
||||
failure:
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x0002015f,
|
||||
LIBDAX_MSGS_SEV_MISHAP, LIBDAX_MSGS_PRIO_HIGH, msg_data, 0, 0);
|
||||
d->sessions= sidx;
|
||||
ret = 0;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg_data);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -55,14 +55,6 @@ struct burn_track
|
||||
int open_ended;
|
||||
/** End of open ended track flag : offset+payload+tail are delivered */
|
||||
int track_data_done;
|
||||
/* ts B10103 */
|
||||
/** End track writing on premature End-of-input if source is of
|
||||
defined length.
|
||||
0= normal operation in case of eoi
|
||||
1= be ready to end track writing on eoi
|
||||
2= eoi was encountered with previously set value of 1
|
||||
*/
|
||||
int end_on_premature_eoi;
|
||||
|
||||
/** The audio/data mode for the entry. Derived from control and
|
||||
possibly from reading the track's first sector. */
|
||||
|
@ -1,7 +1,6 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2011 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -21,7 +20,6 @@
|
||||
#include "libburn.h"
|
||||
#include "sector.h"
|
||||
#include "options.h"
|
||||
#include "init.h"
|
||||
|
||||
#if 0
|
||||
static void write_clonecd2(volatile struct toc *toc, int f);
|
||||
@ -105,14 +103,17 @@ static void write_clonecd2(volatile struct toc *toc, int f)
|
||||
|
||||
void toc_find_modes(struct burn_drive *d)
|
||||
{
|
||||
struct burn_read_opts o;
|
||||
int lba;
|
||||
int i, j;
|
||||
struct buffer *mem = NULL;
|
||||
struct buffer mem;
|
||||
struct burn_toc_entry *e;
|
||||
|
||||
/* ts A70519 : the code which needs this does not work with GNU/Linux 2.4 USB
|
||||
int lba;
|
||||
struct burn_read_opts o;
|
||||
/* ts A61008 : to be prevented on the higher levels */
|
||||
/* a ssert(d->busy); */
|
||||
|
||||
mem.bytes = 0;
|
||||
mem.sectors = 1;
|
||||
o.raw = 1;
|
||||
o.c2errors = 0;
|
||||
o.subcodes_audio = 1;
|
||||
@ -121,18 +122,17 @@ void toc_find_modes(struct burn_drive *d)
|
||||
o.report_recovered_errors = 0;
|
||||
o.transfer_damaged_blocks = 1;
|
||||
o.hardware_error_retries = 1;
|
||||
*/
|
||||
|
||||
BURN_ALLOC_MEM_VOID(mem, struct buffer, 1);
|
||||
|
||||
mem->bytes = 0;
|
||||
mem->sectors = 1;
|
||||
|
||||
for (i = 0; i < d->disc->sessions; i++)
|
||||
for (j = 0; j < d->disc->session[i]->tracks; j++) {
|
||||
struct burn_track *t = d->disc->session[i]->track[j];
|
||||
|
||||
e = t->entry;
|
||||
if (!e)
|
||||
lba = 0;
|
||||
else
|
||||
lba = burn_msf_to_lba(e->pmin, e->psec,
|
||||
e->pframe);
|
||||
/* XXX | in the subcodes if appropriate! */
|
||||
if (e && !(e->control & 4)) {
|
||||
t->mode = BURN_AUDIO;
|
||||
@ -141,18 +141,10 @@ void toc_find_modes(struct burn_drive *d)
|
||||
t->mode = BURN_MODE1;
|
||||
/* ts A70519 : this does not work with GNU/Linux 2.4 USB because one cannot
|
||||
predict the exact dxfer_size without knowing the sector type.
|
||||
if (!e)
|
||||
lba = 0;
|
||||
else
|
||||
lba = burn_msf_to_lba(e->pmin, e->psec,
|
||||
e->pframe);
|
||||
mem->sectors = 1;
|
||||
d->read_sectors(d, lba, mem.sectors, &o, mem);
|
||||
t->mode = sector_identify(mem->data);
|
||||
mem.sectors = 1;
|
||||
d->read_sectors(d, lba, mem.sectors, &o, &mem);
|
||||
t->mode = sector_identify(mem.data);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
ex:
|
||||
BURN_FREE_MEM(mem);
|
||||
}
|
||||
|
@ -134,8 +134,6 @@ struct burn_drive
|
||||
1=MMC drive ,
|
||||
2=stdio random read-write
|
||||
3=stdio sequential write-only
|
||||
4=stdio random read-only
|
||||
5=stdio random write-only
|
||||
*/
|
||||
int drive_role;
|
||||
|
||||
@ -208,11 +206,6 @@ struct burn_drive
|
||||
*/
|
||||
int current_feat2fh_byte4;
|
||||
|
||||
/* ts B10524 : whether the damage bit was set for the future track.
|
||||
bit0= damage bit , bit1= nwa valid bit
|
||||
*/
|
||||
int next_track_damaged;
|
||||
|
||||
/* ts A70114 : whether a DVD-RW media holds an incomplete session
|
||||
(which could need closing after write) */
|
||||
int needs_close_session;
|
||||
@ -279,10 +272,6 @@ struct burn_drive
|
||||
/* ts A70129 :
|
||||
from 51h READ DISC INFORMATION Last Track Number in Last Session */
|
||||
int last_track_no;
|
||||
|
||||
/* ts B10730 : whether a default mode page 05 was already sent.
|
||||
*/
|
||||
int sent_default_page_05;
|
||||
/* ts A70212 : from various sources : free space on media (in bytes)
|
||||
With CD this might change after particular write
|
||||
parameters have been set and nwa has been inquired.
|
||||
@ -293,30 +282,15 @@ struct burn_drive
|
||||
int media_lba_limit;
|
||||
|
||||
/* ts A81210 : Upper limit of readable data size,
|
||||
0x7fffffff = unknown
|
||||
0x7ffffff0 = 32 bit overflow, or unknown stdio size
|
||||
*/
|
||||
0x7fffffff = unknown */
|
||||
int media_read_capacity;
|
||||
|
||||
/* ts B10314 : Next Writeable Adress for drive_role == 5 */
|
||||
int role_5_nwa;
|
||||
|
||||
int toc_temp;
|
||||
struct burn_disc *disc; /* disc structure */
|
||||
int block_types[4];
|
||||
struct buffer *buffer;
|
||||
struct burn_progress progress;
|
||||
|
||||
/* To be used by mmc.c, sbc.c, spc.c for SCSI commands where the struct
|
||||
content surely does not have to persist while another command gets
|
||||
composed and executed.
|
||||
(Inherently, sending SCSI commands to the same drive cannot be
|
||||
thread-safe. But there are functions which send SCSI commands
|
||||
and also call other such functions. These shall use own allocated
|
||||
command structs and not this struct here.)
|
||||
*/
|
||||
struct command casual_command;
|
||||
|
||||
/* ts A70711 : keeping an eye on the drive buffer */
|
||||
off_t pessimistic_buffer_free;
|
||||
int pbf_altered;
|
||||
|
180
libburn/util.c
180
libburn/util.c
@ -74,6 +74,9 @@ struct cd_mid_record {
|
||||
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;
|
||||
@ -88,51 +91,51 @@ 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, ""},
|
||||
{"Ritek Corp" , 96, 43, 30, ""},
|
||||
{"TDK / Ritek" , 97, 10, 0, "TRAXDATA"},
|
||||
{"TDK Corporation" , 97, 15, 0, ""},
|
||||
{"Ritek Corp" , 97, 15, 10, "7-plus, Aopen, PONY, Power Source, TDK, TRAXDATA, HiCO, PHILIPS, Primdisc, Victor.JVC, OPTI STORAGE, Samsung"},
|
||||
{"Mitsubishi Chemical Corporation" , 97, 15, 20, ""},
|
||||
{"Nan-Ya Plastics Corporation" , 97, 15, 30, "Hatron, MMore, Acer, LITEON"},
|
||||
{"Delphi" , 97, 15, 50, ""},
|
||||
{"Shenzhen SG&SAST" , 97, 16, 20, ""},
|
||||
{"Moser Baer India Limited" , 97, 17, 0, "EMTEC, Intenso, YAKUMO, PLATINUM, Silver Circle"},
|
||||
{"SKY media Manufacturing SA" , 97, 17, 10, ""},
|
||||
{"Wing" , 97, 18, 10, ""},
|
||||
{"DDT" , 97, 18, 20, ""},
|
||||
{"Daxon Technology Inc. / Acer" , 97, 22, 60, "Maxmax, Diamond Data, BenQ, gold, SONY"},
|
||||
{"Taiyo Yuden Company Limited" , 97, 24, 0, "Maxell, FUJIFILM, SONY"},
|
||||
{"Sony Corporation" , 97, 24, 10, "LeadData, Imation"},
|
||||
{"Computer Support Italcard s.r.l" , 97, 24, 20, ""},
|
||||
{"Unitech Japan Inc." , 97, 24, 30, ""},
|
||||
{"MPO, France" , 97, 25, 0, "TDK"},
|
||||
{"Hitachi Maxell Ltd." , 97, 25, 20, ""},
|
||||
{"Infodisc Technology Co,Ltd." , 97, 25, 30, "MEMOREX, SPEEDA, Lead data"},
|
||||
{"Xcitec" , 97, 25, 60, ""},
|
||||
{"Fornet International Pte Ltd" , 97, 26, 0, "COMPUSA, Cdhouse"},
|
||||
{"Postech Corporation" , 97, 26, 10, "Mr.Platinum"},
|
||||
{"SKC Co Ltd." , 97, 26, 20, "Infinite"},
|
||||
{"Fuji Photo Film Co,Ltd." , 97, 26, 40, ""},
|
||||
{"Lead Data Inc." , 97, 26, 50, "SONY, Gigastorage, MIRAGE"},
|
||||
{"CMC Magnetics Corporation" , 97, 26, 60, "Daxon, Verbatim, Memorex, Bi-Winner, PLEXTOR, YAMAHA, Melody, Office DEPOT, Philips, eMARK, imation, HyperMedia, Samsung, Shintaro, Techworks"},
|
||||
{"Ricoh Company Limited" , 97, 27, 0, "Sony, Digital Storage, Csita"},
|
||||
{"Plasmon Data Systems Ltd" , 97, 27, 10, "Ritek, TDK, EMTEC, ALPHAPET, MANIA"},
|
||||
{"Princo Corporation" , 97, 27, 20, ""},
|
||||
{"Pioneer" , 97, 27, 30, ""},
|
||||
{"Eastman Kodak Company" , 97, 27, 40, ""},
|
||||
{"Mitsui Chemicals Inc." , 97, 27, 50, "MAM-A, TDK"},
|
||||
{"Ricoh Company Limited" , 97, 27, 60, "Ritek"},
|
||||
{"Gigastorage Corporation" , 97, 28, 10, "MaxMax, Nan-Ya"},
|
||||
{"Multi Media Masters&Machinary SA" , 97, 28, 20, "King, Mmirex"},
|
||||
{"Ritek Corp" , 97, 31, 0, "TDK"},
|
||||
{"Grand Advance Technology Sdn. Bhd." , 97, 31, 30, ""},
|
||||
{"TDK Corporation" , 97, 32, 00, ""},
|
||||
{"Prodisc Technology Inc." , 97, 32, 10, "Smartbuy, Mitsubishi, Digmaster, LG, Media Market"},
|
||||
{"Mitsubishi Chemical Corporation" , 97, 34, 20, "YAMAHA, Verbatim"},
|
||||
{"Mitsui Chemicals Inc." , 97, 48, 50, ""},
|
||||
{"TDK Corporation" , 97, 49, 0, ""},
|
||||
{"", 0, 0, 0, ""}
|
||||
{"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;
|
||||
@ -170,6 +173,7 @@ char *burn_guess_cd_manufacturer(int m_li, int s_li, int f_li,
|
||||
/* ts A90904 */
|
||||
struct dvd_mid_record {
|
||||
char *mc1;
|
||||
char *mc2;
|
||||
int mc1_sig_len;
|
||||
char *manufacturer;
|
||||
};
|
||||
@ -188,49 +192,49 @@ char *burn_guess_manufacturer(int prf,
|
||||
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, ""}
|
||||
{"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 &&
|
||||
|
360
libburn/write.c
360
libburn/write.c
@ -1,7 +1,7 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
|
||||
Copyright (c) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later.
|
||||
*/
|
||||
|
||||
@ -244,6 +244,7 @@ int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
{
|
||||
char msg[81];
|
||||
struct burn_drive *d;
|
||||
struct burn_track *t;
|
||||
|
||||
/* ts A61106 */
|
||||
#ifdef Libburn_experimental_no_close_tracK
|
||||
@ -251,6 +252,7 @@ int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
#endif
|
||||
|
||||
d = o->drive;
|
||||
t = s->track[tnum];
|
||||
|
||||
d->busy = BURN_DRIVE_CLOSING_TRACK;
|
||||
|
||||
@ -274,7 +276,7 @@ int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
|
||||
|
||||
/* ts A61030 */
|
||||
int burn_write_close_session(struct burn_write_opts *o)
|
||||
int burn_write_close_session(struct burn_write_opts *o, struct burn_session *s)
|
||||
{
|
||||
|
||||
/* ts A61106 */
|
||||
@ -412,6 +414,7 @@ struct cue_sheet *burn_create_toc_entries(struct burn_write_opts *o,
|
||||
goto failed;
|
||||
runtime += 150;
|
||||
|
||||
burn_print(1, "toc for %d tracks:\n", ntr);
|
||||
d->toc_entries = ntr + 3;
|
||||
|
||||
/* ts A61009 */
|
||||
@ -512,6 +515,8 @@ struct cue_sheet *burn_create_toc_entries(struct burn_write_opts *o,
|
||||
e[3 + i].pframe = f;
|
||||
e[3 + i].adr = 1;
|
||||
e[3 + i].control = type_to_ctrl(tar[i]->mode);
|
||||
burn_print(1, "track %d control %d\n", tar[i]->mode,
|
||||
e[3 + i].control);
|
||||
|
||||
ret = add_cue(sheet, ctladr | 1, i + 1, 1, form, 0, runtime);
|
||||
if (ret <= 0)
|
||||
@ -563,6 +568,11 @@ XXX this is untested :)
|
||||
e[2].pmin = m;
|
||||
e[2].psec = s;
|
||||
e[2].pframe = f;
|
||||
burn_print(1, "run time is %d (%d:%d:%d)\n", runtime, m, s, f);
|
||||
for (i = 0; i < d->toc_entries; i++)
|
||||
burn_print(1, "point %d (%02d:%02d:%02d)\n",
|
||||
d->toc_entry[i].point, d->toc_entry[i].pmin,
|
||||
d->toc_entry[i].psec, d->toc_entry[i].pframe);
|
||||
ret = add_cue(sheet, ctladr | 1, 0xAA, 1, 1, 0, runtime);
|
||||
if (ret <= 0)
|
||||
goto failed;
|
||||
@ -604,6 +614,8 @@ int burn_write_leadin(struct burn_write_opts *o,
|
||||
|
||||
d->busy = BURN_DRIVE_WRITING_LEADIN;
|
||||
|
||||
burn_print(5, first ? " first leadin\n" : " leadin\n");
|
||||
|
||||
if (first)
|
||||
count = 0 - d->alba - 150;
|
||||
else
|
||||
@ -632,6 +644,7 @@ int burn_write_leadout(struct burn_write_opts *o,
|
||||
d->busy = BURN_DRIVE_WRITING_LEADOUT;
|
||||
|
||||
d->rlba = -150;
|
||||
burn_print(5, first ? " first leadout\n" : " leadout\n");
|
||||
if (first)
|
||||
count = 6750;
|
||||
else
|
||||
@ -653,10 +666,19 @@ int burn_write_leadout(struct burn_write_opts *o,
|
||||
int burn_write_session(struct burn_write_opts *o, struct burn_session *s)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
struct burn_track *prev = NULL, *next = NULL;
|
||||
int i, ret;
|
||||
|
||||
d->rlba = 0;
|
||||
burn_print(1, " writing a session\n");
|
||||
for (i = 0; i < s->tracks; i++) {
|
||||
if (i > 0)
|
||||
prev = s->track[i - 1];
|
||||
if (i + 1 < s->tracks)
|
||||
next = s->track[i + 1];
|
||||
else
|
||||
next = NULL;
|
||||
|
||||
if (!burn_write_track(o, s, i))
|
||||
{ ret = 0; goto ex; }
|
||||
}
|
||||
@ -665,7 +687,7 @@ int burn_write_session(struct burn_write_opts *o, struct burn_session *s)
|
||||
ret = 1;
|
||||
ex:;
|
||||
if (o->write_type == BURN_WRITE_TAO)
|
||||
burn_write_close_session(o);
|
||||
burn_write_close_session(o, s);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -786,6 +808,8 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
|
||||
burn_disc_init_track_status(o, s, tnum, sectors);
|
||||
|
||||
burn_print(12, "track %d is %d sectors long\n", tnum, sectors);
|
||||
|
||||
/* ts A61030 : this cannot happen. tnum is always < s->tracks */
|
||||
if (tnum == s->tracks)
|
||||
tmp = sectors > 150 ? 150 : sectors;
|
||||
@ -816,6 +840,8 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
fprintf(stderr,"LIBBURN_DEBUG: TNUM=%d TRACKS=%d TMP=%d\n",
|
||||
tnum, s->tracks, tmp);
|
||||
|
||||
burn_print(1, "last track, leadout prep\n");
|
||||
|
||||
/* ts A61023 */
|
||||
if ((i%64)==0)
|
||||
d->read_buffer_capacity(d);
|
||||
@ -973,18 +999,15 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
|
||||
{
|
||||
enum burn_write_types wt;
|
||||
struct burn_drive *d = o->drive;
|
||||
char *msg = NULL, *reason_pt;
|
||||
char msg[160], *reason_pt;
|
||||
int no_media = 0;
|
||||
|
||||
reason_pt= reasons;
|
||||
reasons[0] = 0;
|
||||
|
||||
if (d->drive_role == 0 || d->drive_role == 4) {
|
||||
if (d->drive_role == 0)
|
||||
sprintf(reasons,
|
||||
"DRIVE: is a virtual placeholder (null-drive)");
|
||||
else
|
||||
sprintf(reasons, "DRIVE: read-only pseudo drive");
|
||||
if (d->drive_role == 0) {
|
||||
sprintf(reasons,
|
||||
"DRIVE: is a virtual placeholder (null-drive)");
|
||||
no_media = 1;
|
||||
goto ex;
|
||||
}
|
||||
@ -1001,7 +1024,7 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
|
||||
reason_pt= reasons + strlen(reasons);
|
||||
if (d->status == BURN_DISC_UNSUITABLE)
|
||||
goto unsuitable_profile;
|
||||
if (d->drive_role == 2 || d->drive_role == 5 ||
|
||||
if (d->drive_role == 2 ||
|
||||
d->current_profile == 0x1a || d->current_profile == 0x12 ||
|
||||
d->current_profile == 0x43) {
|
||||
/* DVD+RW , DVD-RAM , BD-RE, emulated drive on stdio file */
|
||||
@ -1030,18 +1053,13 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
|
||||
strcat(reasons, "write start address not supported, ");
|
||||
} else {
|
||||
unsuitable_profile:;
|
||||
msg = calloc(1, 160);
|
||||
if (msg != NULL && !silent) {
|
||||
sprintf(msg,
|
||||
"Unsuitable media detected. Profile %4.4Xh %s",
|
||||
d->current_profile, d->current_profile_text);
|
||||
sprintf(msg, "Unsuitable media detected. Profile %4.4Xh %s",
|
||||
d->current_profile, d->current_profile_text);
|
||||
if (!silent)
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x0002011e,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
}
|
||||
if (msg != NULL)
|
||||
free(msg);
|
||||
strcat(reasons, "no suitable media profile detected, ");
|
||||
return 0;
|
||||
}
|
||||
@ -1071,11 +1089,10 @@ int burn_disc_open_track_dvd_minus_r(struct burn_write_opts *o,
|
||||
struct burn_session *s, int tnum)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
char *msg = NULL;
|
||||
char msg[160];
|
||||
int ret, lba, nwa;
|
||||
off_t size;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 160);
|
||||
d->send_write_parameters(d, o);
|
||||
ret = d->get_nwa(d, -1, &lba, &nwa);
|
||||
sprintf(msg,
|
||||
@ -1102,13 +1119,11 @@ int burn_disc_open_track_dvd_minus_r(struct burn_write_opts *o,
|
||||
#endif
|
||||
|
||||
if (o->write_type == BURN_WRITE_SAO) { /* DAO */
|
||||
/* Round track size up to write chunk size and reserve track */
|
||||
size = ((off_t) burn_track_get_sectors(s->track[tnum]))
|
||||
* (off_t) 2048;
|
||||
|
||||
/* Eventually round track size up to write chunk */
|
||||
if (o->obs_pad && (size % o->obs))
|
||||
if (size % o->obs)
|
||||
size += (off_t) (o->obs - (size % o->obs));
|
||||
|
||||
ret = d->reserve_track(d, size);
|
||||
if (ret <= 0) {
|
||||
sprintf(msg, "Cannot reserve track of %.f bytes",
|
||||
@ -1117,13 +1132,10 @@ int burn_disc_open_track_dvd_minus_r(struct burn_write_opts *o,
|
||||
0x00020138,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -1132,11 +1144,10 @@ int burn_disc_open_track_dvd_plus_r(struct burn_write_opts *o,
|
||||
struct burn_session *s, int tnum)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
char *msg = NULL;
|
||||
char msg[160];
|
||||
int ret, lba, nwa;
|
||||
off_t size;
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 160);
|
||||
ret = d->get_nwa(d, -1, &lba, &nwa);
|
||||
sprintf(msg,
|
||||
"DVD+R pre-track %2.2d : get_nwa(%d), ret= %d , d->nwa= %d",
|
||||
@ -1153,10 +1164,6 @@ int burn_disc_open_track_dvd_plus_r(struct burn_write_opts *o,
|
||||
/* Round track size up to write chunk size and reserve track */
|
||||
size = ((off_t) burn_track_get_sectors(s->track[tnum]))
|
||||
* (off_t) 2048;
|
||||
/* o->obs should be 32k or 64k already. But 32k alignment
|
||||
was once performed in d->reserve_track() */
|
||||
if (o->obs % 32768)
|
||||
o->obs += 32768 - (o->obs % 32768);
|
||||
if (size % o->obs)
|
||||
size += (off_t) (o->obs - (size % o->obs));
|
||||
ret = d->reserve_track(d, size);
|
||||
@ -1167,18 +1174,16 @@ int burn_disc_open_track_dvd_plus_r(struct burn_write_opts *o,
|
||||
0x00020138,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* ts A70129 */
|
||||
int burn_disc_close_track_dvd_minus_r(struct burn_write_opts *o, int tnum)
|
||||
int burn_disc_close_track_dvd_minus_r(struct burn_write_opts *o,
|
||||
struct burn_session *s, int tnum)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
char msg[80];
|
||||
@ -1235,7 +1240,7 @@ int burn_disc_finalize_dvd_plus_r(struct burn_write_opts *o)
|
||||
|
||||
/* ts A70226 */
|
||||
int burn_disc_close_track_dvd_plus_r(struct burn_write_opts *o,
|
||||
int tnum, int is_last_track)
|
||||
struct burn_session *s, int tnum, int is_last_track)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
char msg[80];
|
||||
@ -1427,6 +1432,20 @@ int burn_dvd_write_track(struct burn_write_opts *o,
|
||||
|
||||
sectors = burn_track_get_sectors(t);
|
||||
open_ended = burn_track_is_open_ended(t);
|
||||
/* <<< */
|
||||
{
|
||||
char msg[160];
|
||||
|
||||
sprintf(msg,
|
||||
"DVD pre-track %2.2d : demand=%.f%s, cap=%.f\n",
|
||||
tnum+1, (double) sectors * 2048.0,
|
||||
(open_ended ? " (open ended)" : ""),
|
||||
(double) d->media_capacity_remaining);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index, 0x000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||
msg, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
/* (offset padding is done within sector_data()) */
|
||||
|
||||
@ -1486,18 +1505,18 @@ int burn_dvd_write_track(struct burn_write_opts *o,
|
||||
if (d->current_profile == 0x11 || d->current_profile == 0x14 ||
|
||||
d->current_profile == 0x15) {
|
||||
/* DVD-R, DVD-RW Sequential, DVD-R/DL Sequential */
|
||||
ret = burn_disc_close_track_dvd_minus_r(o, tnum);
|
||||
ret = burn_disc_close_track_dvd_minus_r(o, s, tnum);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
} else if (d->current_profile == 0x1b || d->current_profile == 0x2b) {
|
||||
/* DVD+R , DVD+R/DL */
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, tnum,
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, s, tnum,
|
||||
is_last_track);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
} else if (d->current_profile == 0x41) {
|
||||
/* BD-R SRM */
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, tnum,
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, s, tnum,
|
||||
is_last_track);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
@ -1552,7 +1571,8 @@ int burn_disc_close_session_dvd_minus_rw(struct burn_write_opts *o,
|
||||
|
||||
|
||||
/* ts A70129 : for profile 0x11 DVD-R, 0x14 DVD-RW Seq, 0x15 DVD-R/DL Seq */
|
||||
int burn_disc_close_session_dvd_minus_r(struct burn_write_opts *o)
|
||||
int burn_disc_close_session_dvd_minus_r(struct burn_write_opts *o,
|
||||
struct burn_session *s)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
|
||||
@ -1657,7 +1677,7 @@ int burn_dvd_write_session(struct burn_write_opts *o,
|
||||
multi_mem = o->multi;
|
||||
if (!is_last_session)
|
||||
o->multi = 1;
|
||||
ret = burn_disc_close_session_dvd_minus_r(o);
|
||||
ret = burn_disc_close_session_dvd_minus_r(o, s);
|
||||
o->multi = multi_mem;
|
||||
if (ret <= 0)
|
||||
return 0;
|
||||
@ -1717,7 +1737,7 @@ int burn_disc_setup_dvd_minus_rw(struct burn_write_opts *o,
|
||||
struct burn_disc *disc)
|
||||
{
|
||||
struct burn_drive *d = o->drive;
|
||||
char msg[60];
|
||||
char msg[160];
|
||||
int ret;
|
||||
|
||||
d->nwa = 0;
|
||||
@ -1800,9 +1820,8 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
|
||||
off_t default_size = 0;
|
||||
struct burn_drive *d = o->drive;
|
||||
struct burn_track *t;
|
||||
char *msg = NULL;
|
||||
char msg[160];
|
||||
|
||||
BURN_ALLOC_MEM(msg, char, 160);
|
||||
d->needs_close_session = 0;
|
||||
|
||||
/* buffer flush trigger for sector.c:get_sector() */
|
||||
@ -1873,8 +1892,6 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
|
||||
msg, 0, 0);
|
||||
burn_track_set_size(t, default_size);
|
||||
}
|
||||
/* Whether to fill-up last 32k buffer of track. */
|
||||
o->obs_pad = (o->write_type != BURN_WRITE_SAO);
|
||||
ret = burn_disc_setup_dvd_minus_r(o, disc);
|
||||
if (ret <= 0) {
|
||||
sprintf(msg,
|
||||
@ -1885,6 +1902,8 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
|
||||
msg, 0, 0);
|
||||
goto early_failure;
|
||||
}
|
||||
/* ??? padding needed ??? cowardly doing it for now */
|
||||
o->obs_pad = 1; /* fill-up track's last 32k buffer */
|
||||
|
||||
} else if (d->current_profile == 0x1b || d->current_profile == 0x2b ||
|
||||
d->current_profile == 0x41) {
|
||||
@ -1984,7 +2003,7 @@ ex:;
|
||||
/* >>> eventual emergency finalization measures */
|
||||
|
||||
/* update media state records */
|
||||
burn_drive_mark_unready(d, 0);
|
||||
burn_drive_mark_unready(d);
|
||||
burn_drive_inquire_media(d);
|
||||
|
||||
if (d->current_profile == 0x41 && d->complete_sessions >= 300) {
|
||||
@ -1993,10 +2012,9 @@ ex:;
|
||||
0x0002017b, LIBDAX_MSGS_SEV_WARNING,
|
||||
LIBDAX_MSGS_PRIO_ZERO, msg, 0, 0);
|
||||
}
|
||||
BURN_FREE_MEM(msg);
|
||||
|
||||
return ret;
|
||||
early_failure:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2006,8 +2024,7 @@ int burn_stdio_open_write(struct burn_drive *d, off_t start_byte,
|
||||
int sector_size, int flag)
|
||||
{
|
||||
|
||||
/* We normally need _LARGEFILE64_SOURCE defined by the build system.
|
||||
Nevertheless the system might use large address integers by default.
|
||||
/* <<< We need _LARGEFILE64_SOURCE defined by the build system.
|
||||
*/
|
||||
#ifndef O_LARGEFILE
|
||||
#define O_LARGEFILE 0
|
||||
@ -2015,27 +2032,15 @@ int burn_stdio_open_write(struct burn_drive *d, off_t start_byte,
|
||||
|
||||
int fd = -1;
|
||||
int mode = O_RDWR | O_CREAT | O_LARGEFILE;
|
||||
char msg[60];
|
||||
off_t lseek_res;
|
||||
char msg[160];
|
||||
|
||||
if(d->drive_role == 4) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020181,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Pseudo-drive is a read-only file. Cannot write.",
|
||||
0, 0);
|
||||
return 0;
|
||||
}
|
||||
if (d->drive_role == 5 || d->drive_role == 3)
|
||||
mode = O_WRONLY | O_CREAT | O_LARGEFILE;
|
||||
if (d->devname[0] == 0) /* null drives should not come here */
|
||||
return -1;
|
||||
fd = burn_drive__fd_from_special_adr(d->devname);
|
||||
if (fd >= 0)
|
||||
fd = dup(fd); /* check validity and make closeable */
|
||||
else
|
||||
fd = open(d->devname, mode,
|
||||
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
|
||||
fd = open(d->devname, mode, S_IRUSR | S_IWUSR);
|
||||
if (fd == -1) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020005,
|
||||
@ -2046,11 +2051,10 @@ int burn_stdio_open_write(struct burn_drive *d, off_t start_byte,
|
||||
}
|
||||
if (start_byte < 0)
|
||||
start_byte = 0;
|
||||
if (d->drive_role == 2 || d->drive_role == 5) {
|
||||
lseek_res = lseek(fd, start_byte, SEEK_SET);
|
||||
if (lseek_res == -1) {
|
||||
if (d->drive_role == 2)
|
||||
if (lseek(fd, start_byte, SEEK_SET)==-1) {
|
||||
sprintf(msg, "Cannot address start byte %.f",
|
||||
(double) start_byte);
|
||||
(double) start_byte);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020147,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
@ -2059,7 +2063,6 @@ int burn_stdio_open_write(struct burn_drive *d, off_t start_byte,
|
||||
d->cancel = 1;
|
||||
fd = -1;
|
||||
}
|
||||
}
|
||||
d->nwa = start_byte / sector_size;
|
||||
return fd;
|
||||
}
|
||||
@ -2089,9 +2092,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)
|
||||
{
|
||||
int ret;
|
||||
char *msg = NULL;
|
||||
|
||||
if (d->cancel)
|
||||
return 0;
|
||||
/*
|
||||
@ -2099,23 +2099,15 @@ fprintf(stderr, "libburn_DEBUG: write(%d, %lX, %d)\n",
|
||||
fd, (unsigned long) buf, count);
|
||||
*/
|
||||
|
||||
ret = write(fd, buf, count);
|
||||
if (ret != count) {
|
||||
BURN_ALLOC_MEM(msg, char, 160);
|
||||
|
||||
sprintf(msg,
|
||||
"Cannot write desired amount of data. write(2) returned %d.",
|
||||
ret);
|
||||
if (write(fd, buf, count) != count) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020148,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, errno, 0);
|
||||
"Cannot write desired amount of data", errno, 0);
|
||||
d->cancel = 1;
|
||||
return 0;
|
||||
}
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
@ -2179,9 +2171,6 @@ int burn_stdio_mmc_dummy_write(struct burn_drive *d, int start,
|
||||
*/
|
||||
int burn_stdio_sync_cache(int fd, struct burn_drive *d, int flag)
|
||||
{
|
||||
int ret;
|
||||
char *msg = NULL;
|
||||
|
||||
if (fd < 0) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x0002017d,
|
||||
@ -2196,24 +2185,17 @@ int burn_stdio_sync_cache(int fd, struct burn_drive *d, int flag)
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
|
||||
"syncing cache (stdio fsync)", 0, 0);
|
||||
ret = fsync(fd);
|
||||
if (ret != 0 && errno == EIO) {
|
||||
BURN_ALLOC_MEM(msg, char, 160);
|
||||
|
||||
sprintf(msg,
|
||||
"Cannot write desired amount of data. fsync(2) returned %d.",
|
||||
ret);
|
||||
if (fsync(fd) != 0) {
|
||||
if (errno == EINVAL) /* E.g. /dev/null cannot fsync */
|
||||
return 1;
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020148,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, errno, 0);
|
||||
"Cannot write desired amount of data", errno, 0);
|
||||
d->cancel = 1;
|
||||
return 0;
|
||||
}
|
||||
ret = 1;
|
||||
ex:;
|
||||
BURN_FREE_MEM(msg);
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -2258,22 +2240,21 @@ int burn_stdio_slowdown(struct burn_drive *d, struct timeval *prev_time,
|
||||
int burn_stdio_write_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
int tnum, int flag)
|
||||
{
|
||||
int open_ended, bufsize = 16 * 2048, ret, sectors;
|
||||
int open_ended, bufsize, ret, sectors, fd;
|
||||
struct burn_track *t = s->track[tnum];
|
||||
struct burn_drive *d = o->drive;
|
||||
char *buf = NULL;
|
||||
char buf[16*2048];
|
||||
int i, prev_sync_sector = 0;
|
||||
struct buffer *out = d->buffer;
|
||||
struct timeval prev_time;
|
||||
|
||||
BURN_ALLOC_MEM(buf, char, bufsize);
|
||||
bufsize = sizeof(buf);
|
||||
fd = d->stdio_fd;
|
||||
|
||||
sectors = burn_track_get_sectors(t);
|
||||
burn_disc_init_track_status(o, s, tnum, sectors);
|
||||
open_ended = burn_track_is_open_ended(t);
|
||||
|
||||
t->end_on_premature_eoi = (o->write_type == BURN_WRITE_TAO);
|
||||
|
||||
/* attach stdio emulators for mmc_*() functions */
|
||||
if (o->simulate)
|
||||
d->write = burn_stdio_mmc_dummy_write;
|
||||
@ -2286,9 +2267,8 @@ int burn_stdio_write_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
/* transact a (CD sized) sector */
|
||||
if (!sector_data(o, t, 0))
|
||||
{ret= 0; goto ex;}
|
||||
if (open_ended)
|
||||
if (open_ended) {
|
||||
d->progress.sectors = sectors = d->progress.sector;
|
||||
if (open_ended || t->end_on_premature_eoi) {
|
||||
if (burn_track_is_data_done(t))
|
||||
break;
|
||||
}
|
||||
@ -2315,9 +2295,6 @@ int burn_stdio_write_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
ex:;
|
||||
if (d->cancel)
|
||||
burn_source_cancel(t->source);
|
||||
if (t->end_on_premature_eoi == 2)
|
||||
d->cancel = 1;
|
||||
BURN_FREE_MEM(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -2343,15 +2320,9 @@ int burn_stdio_write_sync(struct burn_write_opts *o,
|
||||
d->progress.tracks = 1;
|
||||
|
||||
/* >>> adjust sector size (2048) to eventual audio or even raw */
|
||||
|
||||
/* >>> ??? ts B11004 : Why this eagerness to close and open ? */
|
||||
|
||||
/* open target file */
|
||||
if (d->stdio_fd >= 0)
|
||||
close(d->stdio_fd);
|
||||
if (d->drive_role == 5 && d->status == BURN_DISC_APPENDABLE &&
|
||||
o->start_byte < 0)
|
||||
o->start_byte = d->role_5_nwa * 2048;
|
||||
d->stdio_fd = burn_stdio_open_write(d, o->start_byte, 2048, 0);
|
||||
if (d->stdio_fd == -1)
|
||||
{ret = 0; goto ex;}
|
||||
@ -2366,15 +2337,12 @@ int burn_stdio_write_sync(struct burn_write_opts *o,
|
||||
d->progress.sectors = 0;
|
||||
ret = 1;
|
||||
ex:;
|
||||
|
||||
/* >>> ??? ts B11004 : Why this eagerness to close ? */
|
||||
|
||||
if (d->stdio_fd >= 0)
|
||||
close(d->stdio_fd);
|
||||
d->stdio_fd = -1;
|
||||
|
||||
/* update media state records */
|
||||
burn_drive_mark_unready(d, 8);
|
||||
burn_drive_mark_unready(d);
|
||||
|
||||
/* <<< d->busy = BURN_DRIVE_IDLE; */
|
||||
return ret;
|
||||
@ -2437,14 +2405,6 @@ calloc() seems not to have the desired effect. valgrind warns:
|
||||
d->rlba = -150;
|
||||
d->toc_temp = 9;
|
||||
|
||||
if(d->drive_role == 4) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020181,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Pseudo-drive is a read-only file. Cannot write.",
|
||||
0, 0);
|
||||
goto fail_wo_sync;
|
||||
}
|
||||
/* ts A70904 */
|
||||
if (d->drive_role != 1) {
|
||||
ret = burn_stdio_write_sync(o, disc);
|
||||
@ -2488,6 +2448,8 @@ calloc() seems not to have the desired effect. valgrind warns:
|
||||
}
|
||||
}
|
||||
|
||||
burn_print(1, "sync write of %d CD sessions\n", disc->sessions);
|
||||
|
||||
/* Apparently some drives require this command to be sent, and a few drives
|
||||
return crap. so we send the command, then ignore the result.
|
||||
*/
|
||||
@ -2529,8 +2491,6 @@ return crap. so we send the command, then ignore the result.
|
||||
/* print_cue(sheet);*/
|
||||
if (o->write_type == BURN_WRITE_SAO)
|
||||
d->send_cue_sheet(d, sheet);
|
||||
if (sheet->data != NULL)
|
||||
free(sheet->data);
|
||||
free(sheet);
|
||||
|
||||
if (o->write_type == BURN_WRITE_RAW) {
|
||||
@ -2617,9 +2577,12 @@ return crap. so we send the command, then ignore the result.
|
||||
sleep(1);
|
||||
|
||||
/* ts A61125 : update media state records */
|
||||
burn_drive_mark_unready(d, 0);
|
||||
burn_drive_mark_unready(d);
|
||||
burn_drive_inquire_media(d);
|
||||
|
||||
burn_print(1, "done\n");
|
||||
/* <<< d->busy = BURN_DRIVE_IDLE; */
|
||||
|
||||
/* ts A61012 : This return was traditionally missing. I suspect this
|
||||
to have caused Cdrskin_eject() failures */
|
||||
goto ex;
|
||||
@ -2628,6 +2591,7 @@ fail:
|
||||
d->sync_cache(d);
|
||||
fail_wo_sync:;
|
||||
usleep(500001); /* ts A61222: to avoid a warning from remove_worker()*/
|
||||
burn_print(1, "done - failed\n");
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index, 0x0002010b,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Burn run failed", 0, 0);
|
||||
@ -2648,33 +2612,24 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
{
|
||||
int alignment = 0, start, upto, chunksize, err, fd = -1, ret;
|
||||
char msg[81], *rpt;
|
||||
struct buffer *buf = NULL, *buffer_mem = d->buffer;
|
||||
struct buffer buf, *buffer_mem = d->buffer;
|
||||
|
||||
BURN_ALLOC_MEM(buf, struct buffer, 1);
|
||||
if (d->released) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020142,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is not grabbed on random access write", 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
if(d->drive_role == 0) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020146,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is a virtual placeholder (null-drive)", 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if(d->drive_role == 4) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020181,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Pseudo-drive is a read-only file. Cannot write.",
|
||||
0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(d->drive_role == 2 || d->drive_role == 5)
|
||||
if(d->drive_role == 2)
|
||||
alignment = 2 * 1024;
|
||||
if (d->current_profile == 0x12) /* DVD-RAM */
|
||||
alignment = 2 * 1024;
|
||||
@ -2690,7 +2645,7 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
0x00020125,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Write start address not supported", 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
if ((byte_address % alignment) != 0) {
|
||||
sprintf(msg,
|
||||
@ -2700,7 +2655,7 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
0x00020126,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
if ((data_count % alignment) != 0) {
|
||||
sprintf(msg,
|
||||
@ -2710,22 +2665,22 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
0x00020141,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
if (d->busy != BURN_DRIVE_IDLE) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020140,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is busy on attempt to write random access",0,0);
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
if(d->drive_role != 1) {
|
||||
fd = burn_stdio_open_write(d, byte_address, 2048, 0);
|
||||
if (fd == -1)
|
||||
{ret = 0; goto ex;}
|
||||
return 0;
|
||||
}
|
||||
d->busy = BURN_DRIVE_WRITING_SYNC;
|
||||
d->buffer = buf;
|
||||
d->buffer = &buf;
|
||||
|
||||
start = byte_address / 2048;
|
||||
upto = start + data_count / 2048;
|
||||
@ -2752,7 +2707,7 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
if(fd >= 0)
|
||||
close(fd);
|
||||
{ret = -(start * 2048 - byte_address); goto ex;}
|
||||
return (-(start * 2048 - byte_address));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2770,95 +2725,6 @@ int burn_random_access_write(struct burn_drive *d, off_t byte_address,
|
||||
close(fd);
|
||||
d->buffer = buffer_mem;
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
ret = 1;
|
||||
ex:
|
||||
BURN_FREE_MEM(buf);
|
||||
return ret;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* ts B10527 */
|
||||
/* @param bit0= force close, even if no damage was seen
|
||||
*/
|
||||
int burn_disc_close_damaged(struct burn_write_opts *o, int flag)
|
||||
{
|
||||
struct burn_drive *d;
|
||||
int ret;
|
||||
enum burn_drive_status busy;
|
||||
|
||||
d = o->drive;
|
||||
busy = d->busy;
|
||||
|
||||
if (busy != BURN_DRIVE_IDLE) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020106,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Drive is busy on attempt to close damaged session",
|
||||
0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
if (!((d->next_track_damaged & 1) || (flag & 1))) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020187,
|
||||
LIBDAX_MSGS_SEV_NOTE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Track not marked as damaged. No action taken.",
|
||||
0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
}
|
||||
d->busy = BURN_DRIVE_WRITING;
|
||||
|
||||
if (d->current_profile == 0x09 || d->current_profile == 0x0a) {
|
||||
/* Close CD track and session */
|
||||
o->write_type = BURN_WRITE_TAO; /* no action without TAO */
|
||||
|
||||
/* Send mode page 5 */;
|
||||
d->send_write_parameters(d, o);
|
||||
|
||||
ret = burn_write_close_session(o);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
|
||||
} else if(d->current_profile == 0x11 || d->current_profile == 0x14) {
|
||||
/* Close DVD-R[W] track and session */
|
||||
o->write_type = BURN_WRITE_TAO; /* no action without TAO */
|
||||
|
||||
/* Send mode page 5 */;
|
||||
d->send_write_parameters(d, o);
|
||||
|
||||
ret = burn_disc_close_track_dvd_minus_r(o, 0);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
ret = burn_disc_close_session_dvd_minus_r(o);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
|
||||
} else if(d->current_profile == 0x1b || d->current_profile == 0x2b) {
|
||||
/* Close DVD+R track and session */
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, d->last_track_no, 1);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
|
||||
} else if(d->current_profile == 0x41) {
|
||||
/* Close BD-R track and session */
|
||||
ret = burn_disc_close_track_dvd_plus_r(o, d->last_track_no, 1);
|
||||
if (ret <= 0)
|
||||
goto ex;
|
||||
|
||||
} else {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x00020188,
|
||||
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Cannot close damaged track on given media type",
|
||||
0, 0);
|
||||
{ret = 0; goto ex;}
|
||||
|
||||
}
|
||||
ret = 1;
|
||||
ex:;
|
||||
d->busy = busy;
|
||||
/* Record with drive that repair was attempted */
|
||||
d->next_track_damaged &= ~1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ int burn_write_flush(struct burn_write_opts *o, struct burn_track *track);
|
||||
/* ts A61030 : necessary for TAO */
|
||||
int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
|
||||
int tnum);
|
||||
int burn_write_close_session(struct burn_write_opts *o);
|
||||
int burn_write_close_session(struct burn_write_opts *o,struct burn_session *s);
|
||||
|
||||
|
||||
|
||||
|
@ -1,41 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cd ..
|
||||
|
||||
if [ ! -x configure ]; then
|
||||
printf "\n*** please run ./bootstrap first.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build()
|
||||
{
|
||||
for F in ${1}
|
||||
do
|
||||
make clean
|
||||
clear
|
||||
printf "\n *** building with: %s\n" CPPFLAGS=-D${F}
|
||||
sleep 1
|
||||
# libcdio is not autodetected by default; should be available everywhere
|
||||
CPPFLAGS=-D${F} ./configure --enable-libcdio; make 2> releng/libburn.${F}.log
|
||||
make clean
|
||||
done
|
||||
}
|
||||
|
||||
OS=`uname -o`
|
||||
|
||||
case ${OS} in
|
||||
GNU/Linux)
|
||||
printf "OS: %s\n" ${OS}
|
||||
sleep 1
|
||||
build "__linux Libburn_use_sg_dummY Libburn_use_libcdiO"
|
||||
;;
|
||||
*)
|
||||
printf "Unknown OS: %s\n" ${OS}
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# just in case
|
||||
unset CPPFLAGS
|
@ -1,6 +1,6 @@
|
||||
|
||||
/* test/libburner.c , API illustration of burning data or audio tracks to CD */
|
||||
/* Copyright (C) 2005 - 2011 Thomas Schmitt <scdbackup@gmx.net> */
|
||||
/* Copyright (C) 2005 - 2010 Thomas Schmitt <scdbackup@gmx.net> */
|
||||
/* Provided under GPL, see also "License and copyright aspects" at file end */
|
||||
|
||||
|
||||
@ -218,7 +218,7 @@ int libburner_aquire_by_driveno(int *driveno)
|
||||
printf("\nOverview of accessible drives (%d found) :\n",
|
||||
drive_count);
|
||||
printf("-----------------------------------------------------------------------------\n");
|
||||
for (i = 0; i < (int) drive_count; i++) {
|
||||
for (i = 0; i < drive_count; i++) {
|
||||
if (burn_drive_get_adr(&(drive_list[i]), adr) <=0)
|
||||
strcpy(adr, "-get_adr_failed-");
|
||||
printf("%d --drive '%s' : '%s' '%s'\n",
|
||||
@ -255,7 +255,7 @@ int libburner_aquire_by_driveno(int *driveno)
|
||||
printf("Pseudo-drive \"-\" given : bus scanning done.\n");
|
||||
return 2; /* the program will end after this */
|
||||
}
|
||||
if ((int) drive_count <= *driveno) {
|
||||
if (drive_count <= *driveno) {
|
||||
fprintf(stderr,
|
||||
"Found only %d drives. Number %d not available.\n",
|
||||
drive_count, *driveno);
|
||||
@ -263,7 +263,7 @@ int libburner_aquire_by_driveno(int *driveno)
|
||||
}
|
||||
|
||||
/* Drop all drives which we do not want to use */
|
||||
for (i = 0; i < (int) drive_count; i++) {
|
||||
for (i = 0; i < drive_count; i++) {
|
||||
if (i == *driveno) /* the one drive we want to keep */
|
||||
continue;
|
||||
ret = burn_drive_info_forget(&(drive_list[i]),0);
|
||||
|
@ -20,6 +20,8 @@ static void catch_int ()
|
||||
|
||||
static void poll_drive(int d)
|
||||
{
|
||||
enum burn_disc_status s;
|
||||
|
||||
fprintf(stderr, "polling disc in %s - %s:\n",
|
||||
drives[d].vendor, drives[d].product);
|
||||
|
||||
@ -31,7 +33,8 @@ static void poll_drive(int d)
|
||||
while (burn_drive_get_status(drives[d].drive, NULL))
|
||||
usleep(1000);
|
||||
|
||||
while (burn_disc_get_status(drives[d].drive) == BURN_DISC_UNREADY)
|
||||
while ((s = burn_disc_get_status(drives[d].drive))
|
||||
== BURN_DISC_UNREADY)
|
||||
usleep(1000);
|
||||
|
||||
while (NEXT == 0) {
|
||||
@ -64,7 +67,7 @@ int main()
|
||||
|
||||
newact.sa_handler = catch_int;
|
||||
sigaction(SIGINT, &newact, &oldact);
|
||||
for (i = 0; i < (int) n_drives; i++) {
|
||||
for (i = 0; i < n_drives; i++) {
|
||||
NEXT=0;
|
||||
poll_drive(i);
|
||||
}
|
||||
|
@ -12,9 +12,6 @@ int main(int argc, char **argv)
|
||||
struct burn_session *session;
|
||||
struct burn_source *src;
|
||||
|
||||
burn_initialize();
|
||||
burn_msgs_set_severities("NEVER", "ALL", "structest: ");
|
||||
|
||||
disc = burn_disc_create();
|
||||
session = burn_session_create();
|
||||
burn_disc_add_session(disc, session, BURN_POS_END);
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
/* test/telltoc.c , API illustration of obtaining media status info */
|
||||
/* Copyright (C) 2006 - 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
/* Copyright (C) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL */
|
||||
|
||||
/** Overview
|
||||
@ -178,7 +178,7 @@ int telltoc_aquire_by_driveno(int *driveno, int silent_drive)
|
||||
}
|
||||
fprintf(stderr, "Done\n");
|
||||
|
||||
for (i = 0; i < (int) drive_count; i++) {
|
||||
for (i = 0; i < drive_count; i++) {
|
||||
if (*driveno >= 0 && (silent_drive || *driveno != i))
|
||||
continue;
|
||||
if (burn_drive_get_adr(&(drive_list[i]), adr) <=0)
|
||||
@ -197,7 +197,7 @@ int telltoc_aquire_by_driveno(int *driveno, int silent_drive)
|
||||
/* We already made our choice via command line. (default is 0)
|
||||
So we just have to keep our desired drive and drop all others.
|
||||
*/
|
||||
if ((int) drive_count <= *driveno) {
|
||||
if (drive_count <= *driveno) {
|
||||
fprintf(stderr,
|
||||
"Found only %d drives. Number %d not available.\n",
|
||||
drive_count, *driveno);
|
||||
@ -205,7 +205,7 @@ int telltoc_aquire_by_driveno(int *driveno, int silent_drive)
|
||||
}
|
||||
|
||||
/* Drop all drives which we do not want to use */
|
||||
for (i = 0; i < (int) drive_count; i++) {
|
||||
for (i = 0; i < drive_count; i++) {
|
||||
if (i == *driveno) /* the one drive we want to keep */
|
||||
continue;
|
||||
ret = burn_drive_info_forget(&(drive_list[i]),0);
|
||||
|
Reference in New Issue
Block a user