Add some cdrdao image reading support from Svend S. Sorensen's
cuetools cdio.c: remove some complicated and extraneous code for auto-driver detection.
This commit is contained in:
3
THANKS
3
THANKS
@@ -1,3 +1,6 @@
|
|||||||
|
Svend S. Sorensen <ssorensen@fastmail.fm>
|
||||||
|
cdrdao TOC-reading code
|
||||||
|
|
||||||
Nicolas Boullis <nboullis@debian.org>
|
Nicolas Boullis <nboullis@debian.org>
|
||||||
Build issues, library symbol versioning, Debian packaging and issues
|
Build issues, library symbol versioning, Debian packaging and issues
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* -*- c -*-
|
/* -*- c -*-
|
||||||
$Id: cdio.h,v 1.44 2004/04/30 06:54:15 rocky Exp $
|
$Id: cdio.h,v 1.45 2004/05/04 02:06:48 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
@@ -79,6 +79,9 @@ extern "C" {
|
|||||||
DRIVER_SOLARIS, /**< Sun Solaris Driver */
|
DRIVER_SOLARIS, /**< Sun Solaris Driver */
|
||||||
DRIVER_OSX, /**< Apple OSX Driver */
|
DRIVER_OSX, /**< Apple OSX Driver */
|
||||||
DRIVER_WIN32, /**< Microsoft Windows Driver */
|
DRIVER_WIN32, /**< Microsoft Windows Driver */
|
||||||
|
DRIVER_CDRDAO, /**< cdrdao format CD image. This is listed
|
||||||
|
before BINCUE, to make the code prefer cdrdao
|
||||||
|
over BINCUE when both exist. */
|
||||||
DRIVER_BINCUE, /**< BIN/CUE format CD image. This is listed before NRG,
|
DRIVER_BINCUE, /**< BIN/CUE format CD image. This is listed before NRG,
|
||||||
to make the code prefer BINCUE over NRG when both
|
to make the code prefer BINCUE over NRG when both
|
||||||
exist. */
|
exist. */
|
||||||
@@ -200,6 +203,13 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
const char * cdio_get_driver_name (const CdIo *obj);
|
const char * cdio_get_driver_name (const CdIo *obj);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Return the driver id.
|
||||||
|
if CdIo is NULL (we haven't initialized a specific device driver),
|
||||||
|
then return DRIVER_UNKNOWN.
|
||||||
|
*/
|
||||||
|
driver_id_t cdio_get_driver_id (const CdIo *obj);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Return the number of the first track.
|
Return the number of the first track.
|
||||||
CDIO_INVALID_TRACK is returned on error.
|
CDIO_INVALID_TRACK is returned on error.
|
||||||
@@ -361,6 +371,9 @@ extern "C" {
|
|||||||
/*! True if BIN/CUE driver is available. */
|
/*! True if BIN/CUE driver is available. */
|
||||||
bool cdio_have_bincue (void);
|
bool cdio_have_bincue (void);
|
||||||
|
|
||||||
|
/*! True if cdrdao CDRDAO driver is available. */
|
||||||
|
bool cdio_have_cdrdao (void);
|
||||||
|
|
||||||
/*! Like cdio_have_xxx but uses an enumeration instead. */
|
/*! Like cdio_have_xxx but uses an enumeration instead. */
|
||||||
bool cdio_have_driver (driver_id_t driver_id);
|
bool cdio_have_driver (driver_id_t driver_id);
|
||||||
|
|
||||||
@@ -403,6 +416,19 @@ extern "C" {
|
|||||||
CdIo * cdio_open_am_bincue (const char *psz_cue_name,
|
CdIo * cdio_open_am_bincue (const char *psz_cue_name,
|
||||||
const char *psz_access_mode);
|
const char *psz_access_mode);
|
||||||
|
|
||||||
|
/*! Set up cdrdao CD disk-image for reading. Source is the .toc file
|
||||||
|
|
||||||
|
NULL is returned on error.
|
||||||
|
*/
|
||||||
|
CdIo * cdio_open_cdrdao (const char *psz_toc_name);
|
||||||
|
|
||||||
|
/*! Set up cdrdao CD disk-image for reading. Source is the .toc file
|
||||||
|
|
||||||
|
NULL is returned on error.
|
||||||
|
*/
|
||||||
|
CdIo * cdio_open_am_cdrdao (const char *psz_toc_name,
|
||||||
|
const char *psz_access_mode);
|
||||||
|
|
||||||
/*! Return a string containing the default CUE file that would
|
/*! Return a string containing the default CUE file that would
|
||||||
be used when none is specified.
|
be used when none is specified.
|
||||||
|
|
||||||
@@ -412,6 +438,15 @@ extern "C" {
|
|||||||
|
|
||||||
char **cdio_get_devices_bincue(void);
|
char **cdio_get_devices_bincue(void);
|
||||||
|
|
||||||
|
/*! Return a string containing the default CUE file that would
|
||||||
|
be used when none is specified.
|
||||||
|
|
||||||
|
NULL is returned on error or there is no device.
|
||||||
|
*/
|
||||||
|
char * cdio_get_default_device_cdrdao(void);
|
||||||
|
|
||||||
|
char **cdio_get_devices_cdrdao(void);
|
||||||
|
|
||||||
/*! Set up CD-ROM for reading. The device_name is
|
/*! Set up CD-ROM for reading. The device_name is
|
||||||
the some sort of device name.
|
the some sort of device name.
|
||||||
|
|
||||||
@@ -646,9 +681,13 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
char *cdio_is_cuefile(const char *cue_name);
|
char *cdio_is_cuefile(const char *cue_name);
|
||||||
|
|
||||||
|
/*! Return true if toc_name is a cdrdao TOC file or false
|
||||||
|
if not a TOC file.
|
||||||
|
*/
|
||||||
|
bool cdio_is_tocfile(const char *toc_name);
|
||||||
|
|
||||||
/*! Return corresponding CUE file if bin_name is a fin file or NULL
|
/*! Return corresponding CUE file if bin_name is a fin file or NULL
|
||||||
if not a BIN file. NOTE: when we handle TOC something will have to
|
if not a BIN file.
|
||||||
change here....
|
|
||||||
*/
|
*/
|
||||||
char *cdio_is_binfile(const char *bin_name);
|
char *cdio_is_binfile(const char *bin_name);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: types.h,v 1.13 2004/04/25 14:07:23 rocky Exp $
|
$Id: types.h,v 1.14 2004/05/04 02:06:48 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
@@ -288,6 +288,20 @@ typedef int cdio_fs_anal_t;
|
|||||||
(CDIO_DRIVE_CAP_DVD_R|CDIO_DRIVE_CAP_DVD_RAM)
|
(CDIO_DRIVE_CAP_DVD_R|CDIO_DRIVE_CAP_DVD_RAM)
|
||||||
/**< Has some sort of DVD writer ability */
|
/**< Has some sort of DVD writer ability */
|
||||||
|
|
||||||
|
/*!
|
||||||
|
track flags
|
||||||
|
Q Sub-channel Control Field (4.2.3.3)
|
||||||
|
*/
|
||||||
|
typedef enum {
|
||||||
|
CDIO_TRACK_FLAG_NONE = 0x00, /**< no flags set */
|
||||||
|
CDIO_TRACK_FLAG_PRE_EMPHASIS = 0x01, /**< audio track recorded with
|
||||||
|
pre-emphasis */
|
||||||
|
CDIO_TRACK_FLAG_COPY_PERMITTED = 0x02, /**< digital copy permitted */
|
||||||
|
CDIO_TRACK_FLAG_DATA = 0x04, /**< data track */
|
||||||
|
CDIO_TRACK_FLAG_FOUR_CHANNEL_AUDIO = 0x08, /**< 4 audio channels */
|
||||||
|
CDIO_TRACK_FLAG_SCMS = 0x10 /**< SCMS (5.29.2.7) */
|
||||||
|
} cdio_track_flag;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile.am,v 1.33 2004/04/30 09:59:54 rocky Exp $
|
# $Id: Makefile.am,v 1.34 2004/05/04 02:06:48 rocky Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
# Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
#
|
#
|
||||||
@@ -72,6 +72,7 @@ libcdio_sources = \
|
|||||||
FreeBSD/freebsd_cam.c \
|
FreeBSD/freebsd_cam.c \
|
||||||
FreeBSD/freebsd_ioctl.c \
|
FreeBSD/freebsd_ioctl.c \
|
||||||
image/bincue.c \
|
image/bincue.c \
|
||||||
|
image/cdrdao.c \
|
||||||
image_common.h \
|
image_common.h \
|
||||||
image/nrg.c \
|
image/nrg.c \
|
||||||
logging.c \
|
logging.c \
|
||||||
|
|||||||
64
lib/cdio.c
64
lib/cdio.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cdio.c,v 1.48 2004/04/30 06:54:15 rocky Exp $
|
$Id: cdio.c,v 1.49 2004/05/04 02:06:48 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
#include <cdio/logging.h>
|
#include <cdio/logging.h>
|
||||||
#include "cdio_private.h"
|
#include "cdio_private.h"
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: cdio.c,v 1.48 2004/04/30 06:54:15 rocky Exp $";
|
static const char _rcsid[] = "$Id: cdio.c,v 1.49 2004/05/04 02:06:48 rocky Exp $";
|
||||||
|
|
||||||
|
|
||||||
const char *track_format2str[6] =
|
const char *track_format2str[6] =
|
||||||
@@ -153,6 +153,18 @@ CdIo_driver_t CdIo_all_drivers[CDIO_MAX_DRIVER+1] = {
|
|||||||
&cdio_get_devices_win32
|
&cdio_get_devices_win32
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{DRIVER_CDRDAO,
|
||||||
|
CDIO_SRC_IS_DISK_IMAGE_MASK,
|
||||||
|
"CDRDAO",
|
||||||
|
"cdrdao (TOC) disk image driver",
|
||||||
|
&cdio_have_cdrdao,
|
||||||
|
&cdio_open_cdrdao,
|
||||||
|
&cdio_open_am_cdrdao,
|
||||||
|
&cdio_get_default_device_cdrdao,
|
||||||
|
NULL,
|
||||||
|
&cdio_get_devices_cdrdao
|
||||||
|
},
|
||||||
|
|
||||||
{DRIVER_BINCUE,
|
{DRIVER_BINCUE,
|
||||||
CDIO_SRC_IS_DISK_IMAGE_MASK,
|
CDIO_SRC_IS_DISK_IMAGE_MASK,
|
||||||
"BIN/CUE",
|
"BIN/CUE",
|
||||||
@@ -434,9 +446,22 @@ cdio_get_drive_cap_dev (const char *device)
|
|||||||
const char *
|
const char *
|
||||||
cdio_get_driver_name (const CdIo *cdio)
|
cdio_get_driver_name (const CdIo *cdio)
|
||||||
{
|
{
|
||||||
|
if (NULL==cdio) return NULL;
|
||||||
return CdIo_all_drivers[cdio->driver_id].name;
|
return CdIo_all_drivers[cdio->driver_id].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Return the driver id.
|
||||||
|
if CdIo is NULL (we haven't initialized a specific device driver),
|
||||||
|
then return DRIVER_UNKNOWN.
|
||||||
|
*/
|
||||||
|
driver_id_t
|
||||||
|
cdio_get_driver_id (const CdIo *cdio)
|
||||||
|
{
|
||||||
|
if (NULL==cdio) return DRIVER_UNKNOWN;
|
||||||
|
return cdio->driver_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Return the number of of the first track.
|
Return the number of of the first track.
|
||||||
@@ -846,43 +871,13 @@ cdio_open (const char *orig_source_name, driver_id_t driver_id)
|
|||||||
else
|
else
|
||||||
source_name = strdup(orig_source_name);
|
source_name = strdup(orig_source_name);
|
||||||
|
|
||||||
retry:
|
|
||||||
switch (driver_id) {
|
switch (driver_id) {
|
||||||
case DRIVER_UNKNOWN:
|
case DRIVER_UNKNOWN:
|
||||||
{
|
{
|
||||||
CdIo *cdio=scan_for_driver(CDIO_MIN_DRIVER, CDIO_MAX_DRIVER,
|
CdIo *cdio=scan_for_driver(CDIO_MIN_DRIVER, CDIO_MAX_DRIVER,
|
||||||
source_name);
|
source_name);
|
||||||
if (cdio != NULL && cdio_is_device(source_name, cdio->driver_id)) {
|
free(source_name);
|
||||||
driver_id = cdio->driver_id;
|
return cdio;
|
||||||
} else {
|
|
||||||
struct stat buf;
|
|
||||||
if (0 != stat(source_name, &buf)) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
if (S_ISREG(buf.st_mode)) {
|
|
||||||
/* FIXME: check to see if is a text file. If so, then
|
|
||||||
set SOURCE_CUE. */
|
|
||||||
int i=strlen(source_name)-strlen("bin");
|
|
||||||
if (i > 0
|
|
||||||
&& ( (source_name)[i] =='n' || (source_name)[i] =='N' )
|
|
||||||
&& ( (source_name)[i+1] =='r' || (source_name)[i+1] =='R' )
|
|
||||||
&& ( (source_name)[i+2] =='g' || (source_name)[i+2] =='G' ) )
|
|
||||||
driver_id = DRIVER_NRG;
|
|
||||||
else if (i > 0
|
|
||||||
&& ( (source_name)[i] =='c' || (source_name)[i] =='C')
|
|
||||||
&& ( (source_name)[i+1] =='u' || (source_name)[i+1] =='U')
|
|
||||||
&& ( (source_name)[i+2] =='e' || (source_name)[i+2] =='E') )
|
|
||||||
driver_id = DRIVER_BINCUE;
|
|
||||||
else
|
|
||||||
driver_id = DRIVER_BINCUE;
|
|
||||||
} else {
|
|
||||||
cdio_destroy(cdio);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
cdio_destroy(cdio);
|
|
||||||
goto retry;
|
|
||||||
}
|
}
|
||||||
case DRIVER_DEVICE:
|
case DRIVER_DEVICE:
|
||||||
{
|
{
|
||||||
@@ -900,6 +895,7 @@ cdio_open (const char *orig_source_name, driver_id_t driver_id)
|
|||||||
case DRIVER_OSX:
|
case DRIVER_OSX:
|
||||||
case DRIVER_NRG:
|
case DRIVER_NRG:
|
||||||
case DRIVER_BINCUE:
|
case DRIVER_BINCUE:
|
||||||
|
case DRIVER_CDRDAO:
|
||||||
if ((*CdIo_all_drivers[driver_id].have_driver)()) {
|
if ((*CdIo_all_drivers[driver_id].have_driver)()) {
|
||||||
CdIo *ret = (*CdIo_all_drivers[driver_id].driver_open)(source_name);
|
CdIo *ret = (*CdIo_all_drivers[driver_id].driver_open)(source_name);
|
||||||
if (ret) ret->driver_id = driver_id;
|
if (ret) ret->driver_id = driver_id;
|
||||||
|
|||||||
1249
lib/image/cdrdao.c
Normal file
1249
lib/image/cdrdao.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cd-info.c,v 1.58 2004/04/25 00:46:34 rocky Exp $
|
$Id: cd-info.c,v 1.59 2004/05/04 02:06:48 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
Copyright (C) 1996, 1997, 1998 Gerd Knorr <kraxel@bytesex.org>
|
Copyright (C) 1996, 1997, 1998 Gerd Knorr <kraxel@bytesex.org>
|
||||||
@@ -105,6 +105,7 @@ enum {
|
|||||||
OP_SOURCE_AUTO,
|
OP_SOURCE_AUTO,
|
||||||
OP_SOURCE_BIN,
|
OP_SOURCE_BIN,
|
||||||
OP_SOURCE_CUE,
|
OP_SOURCE_CUE,
|
||||||
|
OP_SOURCE_CDRDAO,
|
||||||
OP_SOURCE_NRG ,
|
OP_SOURCE_NRG ,
|
||||||
OP_SOURCE_DEVICE,
|
OP_SOURCE_DEVICE,
|
||||||
|
|
||||||
@@ -197,6 +198,9 @@ parse_options (int argc, const char *argv[])
|
|||||||
{"nrg-file", 'N', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name,
|
{"nrg-file", 'N', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name,
|
||||||
OP_SOURCE_NRG, "set Nero CD-ROM disk image file as source", "FILE"},
|
OP_SOURCE_NRG, "set Nero CD-ROM disk image file as source", "FILE"},
|
||||||
|
|
||||||
|
{"toc-file", 't', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name,
|
||||||
|
OP_SOURCE_CDRDAO, "set cdrdao CD-ROM disk image file as source", "FILE"},
|
||||||
|
|
||||||
{"quiet", 'q', POPT_ARG_NONE, &opts.silent, 0,
|
{"quiet", 'q', POPT_ARG_NONE, &opts.silent, 0,
|
||||||
"Don't produce warning output" },
|
"Don't produce warning output" },
|
||||||
|
|
||||||
@@ -215,6 +219,7 @@ parse_options (int argc, const char *argv[])
|
|||||||
case OP_SOURCE_AUTO:
|
case OP_SOURCE_AUTO:
|
||||||
case OP_SOURCE_BIN:
|
case OP_SOURCE_BIN:
|
||||||
case OP_SOURCE_CUE:
|
case OP_SOURCE_CUE:
|
||||||
|
case OP_SOURCE_CDRDAO:
|
||||||
case OP_SOURCE_NRG:
|
case OP_SOURCE_NRG:
|
||||||
case OP_SOURCE_DEVICE:
|
case OP_SOURCE_DEVICE:
|
||||||
if (opts.source_image != IMAGE_UNKNOWN) {
|
if (opts.source_image != IMAGE_UNKNOWN) {
|
||||||
@@ -232,6 +237,9 @@ parse_options (int argc, const char *argv[])
|
|||||||
case OP_SOURCE_CUE:
|
case OP_SOURCE_CUE:
|
||||||
opts.source_image = IMAGE_CUE;
|
opts.source_image = IMAGE_CUE;
|
||||||
break;
|
break;
|
||||||
|
case OP_SOURCE_CDRDAO:
|
||||||
|
opts.source_image = IMAGE_CDRDAO;
|
||||||
|
break;
|
||||||
case OP_SOURCE_NRG:
|
case OP_SOURCE_NRG:
|
||||||
opts.source_image = IMAGE_NRG;
|
opts.source_image = IMAGE_NRG;
|
||||||
break;
|
break;
|
||||||
@@ -255,7 +263,8 @@ parse_options (int argc, const char *argv[])
|
|||||||
if ( remaining_arg != NULL) {
|
if ( remaining_arg != NULL) {
|
||||||
if (opts.source_image != IMAGE_UNKNOWN) {
|
if (opts.source_image != IMAGE_UNKNOWN) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"%s: Source specified in option %s and as %s\n",
|
"%s: Source '%s' given as an argument of an option and as "
|
||||||
|
"unnamed option '%s'\n",
|
||||||
program_name, source_name, remaining_arg);
|
program_name, source_name, remaining_arg);
|
||||||
poptFreeContext(optCon);
|
poptFreeContext(optCon);
|
||||||
free(program_name);
|
free(program_name);
|
||||||
@@ -444,10 +453,10 @@ print_cddb_info(CdIo *cdio, track_t num_tracks, track_t first_track_num) {
|
|||||||
|
|
||||||
#ifdef HAVE_VCDINFO
|
#ifdef HAVE_VCDINFO
|
||||||
static void
|
static void
|
||||||
print_vcd_info(void) {
|
print_vcd_info(driver_id_t driver) {
|
||||||
vcdinfo_open_return_t open_rc;
|
vcdinfo_open_return_t open_rc;
|
||||||
vcdinfo_obj_t *obj;
|
vcdinfo_obj_t *obj;
|
||||||
open_rc = vcdinfo_open(&obj, &source_name, DRIVER_UNKNOWN, NULL);
|
open_rc = vcdinfo_open(&obj, &source_name, driver, NULL);
|
||||||
switch (open_rc) {
|
switch (open_rc) {
|
||||||
case VCDINFO_OPEN_VCD:
|
case VCDINFO_OPEN_VCD:
|
||||||
if (vcdinfo_get_format_version (obj) == VCD_TYPE_INVALID) {
|
if (vcdinfo_get_format_version (obj) == VCD_TYPE_INVALID) {
|
||||||
@@ -691,7 +700,7 @@ print_analysis(int ms_offset, cdio_iso_analysis_t cdio_iso_analysis,
|
|||||||
if (fs & (CDIO_FS_ANAL_VIDEOCD|CDIO_FS_ANAL_CVD|CDIO_FS_ANAL_SVCD))
|
if (fs & (CDIO_FS_ANAL_VIDEOCD|CDIO_FS_ANAL_CVD|CDIO_FS_ANAL_SVCD))
|
||||||
if (!opts.no_vcd) {
|
if (!opts.no_vcd) {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
print_vcd_info();
|
print_vcd_info(cdio_get_driver_id(cdio));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -811,6 +820,14 @@ main(int argc, const char *argv[])
|
|||||||
program_name, source_name);
|
program_name, source_name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IMAGE_CDRDAO:
|
||||||
|
cdio = cdio_open (source_name, DRIVER_CDRDAO);
|
||||||
|
if (cdio==NULL) {
|
||||||
|
err_exit("%s: Error in opening TOC with input %s\n",
|
||||||
|
program_name, source_name);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cdio==NULL) {
|
if (cdio==NULL) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cd-read.c,v 1.16 2004/02/07 02:40:20 rocky Exp $
|
$Id: cd-read.c,v 1.17 2004/05/04 02:06:48 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -41,6 +41,7 @@ enum {
|
|||||||
OP_SOURCE_BIN,
|
OP_SOURCE_BIN,
|
||||||
OP_SOURCE_CUE,
|
OP_SOURCE_CUE,
|
||||||
OP_SOURCE_NRG = DRIVER_NRG,
|
OP_SOURCE_NRG = DRIVER_NRG,
|
||||||
|
OP_SOURCE_CDRDAO = DRIVER_CDRDAO,
|
||||||
OP_SOURCE_DEVICE = DRIVER_DEVICE,
|
OP_SOURCE_DEVICE = DRIVER_DEVICE,
|
||||||
|
|
||||||
/* These are the remaining configuration options */
|
/* These are the remaining configuration options */
|
||||||
@@ -219,6 +220,9 @@ parse_options (int argc, const char *argv[])
|
|||||||
{"nrg-file", 'N', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name,
|
{"nrg-file", 'N', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name,
|
||||||
OP_SOURCE_NRG, "set Nero CD-ROM disk image file as source", "FILE"},
|
OP_SOURCE_NRG, "set Nero CD-ROM disk image file as source", "FILE"},
|
||||||
|
|
||||||
|
{"toc-file", 't', POPT_ARG_STRING|POPT_ARGFLAG_OPTIONAL, &source_name,
|
||||||
|
OP_SOURCE_CDRDAO, "set \"TOC\" CD-ROM disk image file as source", "FILE"},
|
||||||
|
|
||||||
{"output-file", 'o', POPT_ARG_STRING, &opts.output_file, 0,
|
{"output-file", 'o', POPT_ARG_STRING, &opts.output_file, 0,
|
||||||
"Output blocks to file rather than give a hexdump."},
|
"Output blocks to file rather than give a hexdump."},
|
||||||
|
|
||||||
@@ -472,6 +476,14 @@ main(int argc, const char *argv[])
|
|||||||
source_name);
|
source_name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IMAGE_CDRDAO:
|
||||||
|
cdio = cdio_open (source_name, DRIVER_CDRDAO);
|
||||||
|
if (cdio==NULL) {
|
||||||
|
err_exit("Error in opening TOC file %s for input\n",
|
||||||
|
source_name);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts.access_mode!=NULL) {
|
if (opts.access_mode!=NULL) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: util.h,v 1.3 2004/04/25 00:46:34 rocky Exp $
|
$Id: util.h,v 1.4 2004/05/04 02:06:48 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -85,6 +85,7 @@ typedef enum
|
|||||||
IMAGE_BIN,
|
IMAGE_BIN,
|
||||||
IMAGE_CUE,
|
IMAGE_CUE,
|
||||||
IMAGE_NRG,
|
IMAGE_NRG,
|
||||||
|
IMAGE_CDRDAO,
|
||||||
IMAGE_UNKNOWN
|
IMAGE_UNKNOWN
|
||||||
} source_image_t;
|
} source_image_t;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile.am,v 1.18 2004/02/29 15:04:27 rocky Exp $
|
# $Id: Makefile.am,v 1.19 2004/05/04 02:06:48 rocky Exp $
|
||||||
#
|
#
|
||||||
# Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
# Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
|
||||||
#
|
#
|
||||||
@@ -41,8 +41,8 @@ check_PROGRAMS = $(hack)
|
|||||||
|
|
||||||
check_DATA = vcd_demo.right \
|
check_DATA = vcd_demo.right \
|
||||||
videocd.right videocd.nrg \
|
videocd.right videocd.nrg \
|
||||||
cdda.right cdda.cue cdda.bin \
|
cdda.right cdda.toc cdda.cue cdda.bin \
|
||||||
isofs-m1.right isofs-m1.cue isofs-m1.bin \
|
isofs-m1.right isfs-m1.toc isofs-m1.cue isofs-m1.bin \
|
||||||
check_opts0.right check_opts1.right check_opts2.right \
|
check_opts0.right check_opts1.right check_opts2.right \
|
||||||
check_opts3.right check_opts4.right check_opts5.right \
|
check_opts3.right check_opts4.right check_opts5.right \
|
||||||
check_opts6.right check_opts7.right \
|
check_opts6.right check_opts7.right \
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#$Id: check_cue.sh.in,v 1.15 2003/10/06 04:04:05 rocky Exp $
|
#$Id: check_cue.sh.in,v 1.16 2004/05/04 02:06:49 rocky Exp $
|
||||||
# Tests to see that BIN/CUE file iamge reading is correct (via cd-info).
|
# Tests to see that BIN/CUE and BIN/TOC file iamge reading is correct
|
||||||
|
# (via cd-info).
|
||||||
|
|
||||||
if test -n "@VCDINFO_LIBS@" ; then
|
if test -n "@VCDINFO_LIBS@" ; then
|
||||||
vcd_opt='--no-vcd'
|
vcd_opt='--no-vcd'
|
||||||
fi
|
fi
|
||||||
@@ -29,15 +31,30 @@ test_cdinfo "--quiet --bin-file ${srcdir}/${fname}.bin --no-cddb" \
|
|||||||
RC=$?
|
RC=$?
|
||||||
check_result $RC "cd-info BIN test $testnum"
|
check_result $RC "cd-info BIN test $testnum"
|
||||||
|
|
||||||
|
test_cdinfo "--quiet --toc-file ${srcdir}/${fname}.toc --no-cddb" \
|
||||||
|
${fname}.dump ${srcdir}/${fname}.right
|
||||||
|
RC=$?
|
||||||
|
check_result $RC "cd-info TOC test $testnum"
|
||||||
|
|
||||||
fname=isofs-m1
|
fname=isofs-m1
|
||||||
testnum='ISO 9660 mode1'
|
testnum='ISO 9660 mode1 CUE'
|
||||||
if test -f ${srcdir}/${fname}.bin ; then
|
if test -f ${srcdir}/${fname}.bin ; then
|
||||||
test_cdinfo "-q --cue-file ${srcdir}/${fname}.cue --iso9660" \
|
test_cdinfo "-q --cue-file ${srcdir}/${fname}.cue --iso9660" \
|
||||||
${fname}.dump ${srcdir}/${fname}.right
|
${fname}.dump ${srcdir}/${fname}.right
|
||||||
RC=$?
|
RC=$?
|
||||||
check_result $RC "cd-info CUE test $testnum"
|
check_result $RC "cd-info CUE test $testnum"
|
||||||
else
|
else
|
||||||
echo "Don't see CUE file ${srcdir}/${fname}.bin. Test $testum skipped."
|
echo "Don't see CUE file ${srcdir}/${fname}.bin. Test $testnum skipped."
|
||||||
|
fi
|
||||||
|
|
||||||
|
testnum='ISO 9660 mode1 TOC'
|
||||||
|
if test -f ${srcdir}/${fname}.bin ; then
|
||||||
|
test_cdinfo "-q --toc-file ${srcdir}/${fname}.toc --iso9660" \
|
||||||
|
${fname}.dump ${srcdir}/${fname}.right
|
||||||
|
RC=$?
|
||||||
|
check_result $RC "cd-info TOC test $testnum"
|
||||||
|
else
|
||||||
|
echo "Don't see TOC file ${srcdir}/${fname}.bin. Test $testnum skipped."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fname=vcd_demo
|
fname=vcd_demo
|
||||||
@@ -53,7 +70,16 @@ if test -f ${srcdir}/${fname}.cue ; then
|
|||||||
RC=$?
|
RC=$?
|
||||||
check_result $RC "cd-info CUE test $testnum"
|
check_result $RC "cd-info CUE test $testnum"
|
||||||
else
|
else
|
||||||
echo "Don't see CUE file ${srcdir}/${fname}.cue. Test $testum skipped."
|
echo "Don't see CUE file ${srcdir}/${fname}.cue. Test $testnum skipped."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -f ${srcdir}/${fname}.toc ; then
|
||||||
|
test_cdinfo "-q -t ${srcdir}/vcd_demo.toc --iso9660" \
|
||||||
|
${fname}.dump $right
|
||||||
|
RC=$?
|
||||||
|
check_result $RC "cd-info TOC test $testnum"
|
||||||
|
else
|
||||||
|
echo "Don't see TOC file ${srcdir}/${fname}.toc. Test $testnum skipped."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fname=svcd_ogt_test_ntsc
|
fname=svcd_ogt_test_ntsc
|
||||||
|
|||||||
5
test/isofs-m1.toc
Normal file
5
test/isofs-m1.toc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
CATALOG "0000010271955"
|
||||||
|
CD_DA
|
||||||
|
|
||||||
|
TRACK MODE1_RAW
|
||||||
|
FILE "isofs-m1.bin" 00:00:00 00:00:00
|
||||||
15
test/vcd_demo.toc
Normal file
15
test/vcd_demo.toc
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
CD_DA
|
||||||
|
|
||||||
|
TRACK MODE2_RAW
|
||||||
|
COPY
|
||||||
|
FILE "vcd_demo.bin" 00:00:00 00:13:57
|
||||||
|
|
||||||
|
TRACK MODE2_RAW
|
||||||
|
COPY
|
||||||
|
FILE "vcd_demo.bin" 00:13:57 00:07:14
|
||||||
|
START 00:02:00
|
||||||
|
|
||||||
|
TRACK MODE2_RAW
|
||||||
|
COPY
|
||||||
|
FILE "vcd_demo.bin" 00:20:71 00:00:00
|
||||||
|
START 00:02:00
|
||||||
Reference in New Issue
Block a user