cd_types: sector 0 rarely needs to be read, and when it doesn't, it's not
an error if it can't be read cd-info: give more info by default - source location and driver. test/*: as a result of cd-info changes need now to pass option --quiet.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cd_types.c,v 1.5 2003/09/28 17:14:20 rocky Exp $
|
$Id: cd_types.c,v 1.6 2003/10/06 04:04:05 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
||||||
|
|
||||||
@@ -211,6 +211,7 @@ cdio_guess_cd_type(const CdIo *cdio, int start_session, track_t track_num,
|
|||||||
/*out*/ cdio_analysis_t *cdio_analysis)
|
/*out*/ cdio_analysis_t *cdio_analysis)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
bool sector0_read_ok;
|
||||||
|
|
||||||
if (TRACK_FORMAT_AUDIO == cdio_get_track_format(cdio, track_num))
|
if (TRACK_FORMAT_AUDIO == cdio_get_track_format(cdio, track_num))
|
||||||
return CDIO_FS_AUDIO;
|
return CDIO_FS_AUDIO;
|
||||||
@@ -226,8 +227,8 @@ cdio_guess_cd_type(const CdIo *cdio, int start_session, track_t track_num,
|
|||||||
} else {
|
} else {
|
||||||
/* read sector 0 ONLY, when NO greenbook CD-I !!!! */
|
/* read sector 0 ONLY, when NO greenbook CD-I !!!! */
|
||||||
|
|
||||||
if ( _cdio_read_block(cdio, 0, start_session, 1, track_num) < 0 )
|
sector0_read_ok =
|
||||||
return ret;
|
_cdio_read_block(cdio, 0, start_session, 1, track_num) == 0;
|
||||||
|
|
||||||
if (_cdio_is_it(INDEX_HS))
|
if (_cdio_is_it(INDEX_HS))
|
||||||
ret |= CDIO_FS_HIGH_SIERRA;
|
ret |= CDIO_FS_HIGH_SIERRA;
|
||||||
@@ -256,8 +257,8 @@ cdio_guess_cd_type(const CdIo *cdio, int start_session, track_t track_num,
|
|||||||
if (_cdio_is_it(INDEX_BOOTABLE))
|
if (_cdio_is_it(INDEX_BOOTABLE))
|
||||||
ret |= CDIO_FS_ANAL_BOOTABLE;
|
ret |= CDIO_FS_ANAL_BOOTABLE;
|
||||||
|
|
||||||
if (_cdio_is_it(INDEX_XA) && _cdio_is_it(INDEX_ISOFS)
|
if ( _cdio_is_it(INDEX_XA) && _cdio_is_it(INDEX_ISOFS)
|
||||||
&& !_cdio_is_it(INDEX_PHOTO_CD)) {
|
&& !(sector0_read_ok && _cdio_is_it(INDEX_PHOTO_CD)) ) {
|
||||||
|
|
||||||
if ( _cdio_read_block(cdio, VCD_INFO_SECTOR, start_session, 4,
|
if ( _cdio_read_block(cdio, VCD_INFO_SECTOR, start_session, 4,
|
||||||
track_num) < 0 )
|
track_num) < 0 )
|
||||||
@@ -271,14 +272,14 @@ cdio_guess_cd_type(const CdIo *cdio, int start_session, track_t track_num,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_cdio_is_hfs()) ret |= CDIO_FS_HFS;
|
else if (_cdio_is_hfs()) ret |= CDIO_FS_HFS;
|
||||||
else if (_cdio_is_it(INDEX_EXT2)) ret |= CDIO_FS_EXT2;
|
else if (sector0_read_ok && _cdio_is_it(INDEX_EXT2)) ret |= CDIO_FS_EXT2;
|
||||||
else if (_cdio_is_3do()) ret |= CDIO_FS_3DO;
|
else if (_cdio_is_3do()) ret |= CDIO_FS_3DO;
|
||||||
else {
|
else {
|
||||||
if ( _cdio_read_block(cdio, UFS_SUPERBLOCK_SECTOR, start_session, 2,
|
if ( _cdio_read_block(cdio, UFS_SUPERBLOCK_SECTOR, start_session, 2,
|
||||||
track_num) < 0 )
|
track_num) < 0 )
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (_cdio_is_it(INDEX_UFS))
|
if (sector0_read_ok && _cdio_is_it(INDEX_UFS))
|
||||||
ret |= CDIO_FS_UFS;
|
ret |= CDIO_FS_UFS;
|
||||||
else
|
else
|
||||||
ret |= CDIO_FS_UNKNOWN;
|
ret |= CDIO_FS_UNKNOWN;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cd-info.c,v 1.41 2003/09/28 17:14:21 rocky Exp $
|
$Id: cd-info.c,v 1.42 2003/10/06 04:04:05 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003 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>
|
||||||
@@ -90,8 +90,8 @@ struct arguments
|
|||||||
#endif
|
#endif
|
||||||
int no_vcd;
|
int no_vcd;
|
||||||
uint32_t debug_level;
|
uint32_t debug_level;
|
||||||
int silent;
|
|
||||||
int version_only;
|
int version_only;
|
||||||
|
int silent;
|
||||||
int no_header;
|
int no_header;
|
||||||
int print_iso9660;
|
int print_iso9660;
|
||||||
source_image_t source_image;
|
source_image_t source_image;
|
||||||
@@ -128,9 +128,6 @@ parse_options (int argc, const char *argv[])
|
|||||||
{"debug", 'd', POPT_ARG_INT, &opts.debug_level, 0,
|
{"debug", 'd', POPT_ARG_INT, &opts.debug_level, 0,
|
||||||
"Set debugging to LEVEL"},
|
"Set debugging to LEVEL"},
|
||||||
|
|
||||||
{"quiet", 'q', POPT_ARG_NONE, &opts.silent, 0,
|
|
||||||
"Don't produce warning output" },
|
|
||||||
|
|
||||||
{"no-tracks", 'T', POPT_ARG_NONE, &opts.no_tracks, 0,
|
{"no-tracks", 'T', POPT_ARG_NONE, &opts.no_tracks, 0,
|
||||||
"Don't show track information"},
|
"Don't show track information"},
|
||||||
|
|
||||||
@@ -141,7 +138,7 @@ parse_options (int argc, const char *argv[])
|
|||||||
{"no-cddb", 'a', POPT_ARG_NONE, &opts.no_cddb, 0,
|
{"no-cddb", 'a', POPT_ARG_NONE, &opts.no_cddb, 0,
|
||||||
"Don't look up audio CDDB information or print that"},
|
"Don't look up audio CDDB information or print that"},
|
||||||
|
|
||||||
{"cddb-port", 'P', POPT_ARG_INT, &opts.cddb_port, 0,
|
{"cddb-port", 'P', POPT_ARG_INT, &opts.cddb_port, 8880,
|
||||||
"CDDB port number to use (default 8880)"},
|
"CDDB port number to use (default 8880)"},
|
||||||
|
|
||||||
{"cddb-http", 'H', POPT_ARG_NONE, &opts.cddb_http, 0,
|
{"cddb-http", 'H', POPT_ARG_NONE, &opts.cddb_http, 0,
|
||||||
@@ -196,8 +193,8 @@ 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"},
|
||||||
|
|
||||||
{"quiet", 'q', POPT_ARG_NONE, &opts.silent, 0,
|
{"quiet", 'q', POPT_ARG_NONE, &opts.silent, 0,
|
||||||
"show only critical messages"},
|
"Don't produce warning output" },
|
||||||
|
|
||||||
{"version", 'V', POPT_ARG_NONE, &opts.version_only, 0,
|
{"version", 'V', POPT_ARG_NONE, &opts.version_only, 0,
|
||||||
"display version and copyright information and exit"},
|
"display version and copyright information and exit"},
|
||||||
@@ -795,10 +792,6 @@ main(int argc, const char *argv[])
|
|||||||
err_exit("%s: Error in opening device driver\n", program_name);
|
err_exit("%s: Error in opening device driver\n", program_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts.debug_level > 0) {
|
|
||||||
printf("CD driver name: %s\n", cdio_get_driver_name(cdio));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (source_name==NULL) {
|
if (source_name==NULL) {
|
||||||
source_name=strdup(cdio_get_arg(cdio, "source"));
|
source_name=strdup(cdio_get_arg(cdio, "source"));
|
||||||
if (NULL == source_name) {
|
if (NULL == source_name) {
|
||||||
@@ -806,6 +799,11 @@ main(int argc, const char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (opts.silent == 0) {
|
||||||
|
printf("CD location : %s\n", source_name);
|
||||||
|
printf("CD driver name: %s\n", cdio_get_driver_name(cdio));
|
||||||
|
}
|
||||||
|
|
||||||
if (opts.access_mode!=NULL) {
|
if (opts.access_mode!=NULL) {
|
||||||
cdio_set_arg(cdio, "access-mode", opts.access_mode);
|
cdio_set_arg(cdio, "access-mode", opts.access_mode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#$Id: check_cue.sh.in,v 1.14 2003/09/30 03:26:11 rocky Exp $
|
#$Id: check_cue.sh.in,v 1.15 2003/10/06 04:04:05 rocky Exp $
|
||||||
# Tests to see that BIN/CUE file iamge reading is correct (via cd-info).
|
# Tests to see that BIN/CUE 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'
|
||||||
@@ -19,12 +19,12 @@ BASE=`basename $0 .sh`
|
|||||||
|
|
||||||
fname=cdda
|
fname=cdda
|
||||||
testnum=CD-DA
|
testnum=CD-DA
|
||||||
test_cdinfo "--cue-file ${srcdir}/${fname}.cue --no-cddb" \
|
test_cdinfo "--quiet --cue-file ${srcdir}/${fname}.cue --no-cddb" \
|
||||||
${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"
|
||||||
|
|
||||||
test_cdinfo "--bin-file ${srcdir}/${fname}.bin --no-cddb" \
|
test_cdinfo "--quiet --bin-file ${srcdir}/${fname}.bin --no-cddb" \
|
||||||
${fname}.dump ${srcdir}/${fname}.right
|
${fname}.dump ${srcdir}/${fname}.right
|
||||||
RC=$?
|
RC=$?
|
||||||
check_result $RC "cd-info BIN test $testnum"
|
check_result $RC "cd-info BIN test $testnum"
|
||||||
@@ -32,7 +32,7 @@ check_result $RC "cd-info BIN test $testnum"
|
|||||||
fname=isofs-m1
|
fname=isofs-m1
|
||||||
testnum='ISO 9660 mode1'
|
testnum='ISO 9660 mode1'
|
||||||
if test -f ${srcdir}/${fname}.bin ; then
|
if test -f ${srcdir}/${fname}.bin ; then
|
||||||
test_cdinfo "--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"
|
||||||
@@ -48,7 +48,7 @@ else
|
|||||||
fi
|
fi
|
||||||
testnum='Video CD'
|
testnum='Video CD'
|
||||||
if test -f ${srcdir}/${fname}.cue ; then
|
if test -f ${srcdir}/${fname}.cue ; then
|
||||||
test_cdinfo "-c ${srcdir}/vcd_demo.cue --iso9660" \
|
test_cdinfo "-q -c ${srcdir}/vcd_demo.cue --iso9660" \
|
||||||
${fname}.dump $right
|
${fname}.dump $right
|
||||||
RC=$?
|
RC=$?
|
||||||
check_result $RC "cd-info CUE test $testnum"
|
check_result $RC "cd-info CUE test $testnum"
|
||||||
@@ -59,7 +59,7 @@ fi
|
|||||||
fname=svcd_ogt_test_ntsc
|
fname=svcd_ogt_test_ntsc
|
||||||
testnum='Super Video CD'
|
testnum='Super Video CD'
|
||||||
if test -f ${srcdir}/${fname}.bin ; then
|
if test -f ${srcdir}/${fname}.bin ; then
|
||||||
test_cdinfo "--cue-file ${srcdir}/${fname}.cue $vcd_opt --iso9660 " \
|
test_cdinfo "-q --cue-file ${srcdir}/${fname}.cue $vcd_opt --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"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#$Id: check_nrg.sh.in,v 1.8 2003/09/30 03:26:11 rocky Exp $
|
#$Id: check_nrg.sh.in,v 1.9 2003/10/06 04:04:05 rocky Exp $
|
||||||
|
|
||||||
if test -n "@VCDINFO_LIBS@" ; then
|
if test -n "@VCDINFO_LIBS@" ; then
|
||||||
vcd_opt='--no-vcd'
|
vcd_opt='--no-vcd'
|
||||||
@@ -18,7 +18,7 @@ fi
|
|||||||
BASE=`basename $0 .sh`
|
BASE=`basename $0 .sh`
|
||||||
fname=videocd
|
fname=videocd
|
||||||
|
|
||||||
test_cdinfo "--nrg-file ${srcdir}/${fname}.nrg $vcd_opt --iso9660 " \
|
test_cdinfo "--quiet --nrg-file ${srcdir}/${fname}.nrg $vcd_opt --iso9660 " \
|
||||||
${fname}.dump ${srcdir}/${fname}.right
|
${fname}.dump ${srcdir}/${fname}.right
|
||||||
RC=$?
|
RC=$?
|
||||||
check_result $RC 'cd-info NRG test 1'
|
check_result $RC 'cd-info NRG test 1'
|
||||||
@@ -27,7 +27,7 @@ BASE=`basename $0 .sh`
|
|||||||
nrg_file=${srcdir}/monvoisin.nrg
|
nrg_file=${srcdir}/monvoisin.nrg
|
||||||
|
|
||||||
if test -f $nrg_file ; then
|
if test -f $nrg_file ; then
|
||||||
test_cdinfo "--nrg-file $nrg_file $vcd_opt --iso9660 " \
|
test_cdinfo "-q --nrg-file $nrg_file $vcd_opt --iso9660 " \
|
||||||
monvoisin.dump ${srcdir}/monvoisin.right
|
monvoisin.dump ${srcdir}/monvoisin.right
|
||||||
RC=$?
|
RC=$?
|
||||||
check_result $RC 'cd-info NRG test 2'
|
check_result $RC 'cd-info NRG test 2'
|
||||||
@@ -38,7 +38,7 @@ fi
|
|||||||
|
|
||||||
nrg_file=${srcdir}/svcdgs.nrg
|
nrg_file=${srcdir}/svcdgs.nrg
|
||||||
if test -f $nrg_file ; then
|
if test -f $nrg_file ; then
|
||||||
test_cdinfo "--nrg-file $nrg_file $vcd_opt --iso9660" \
|
test_cdinfo "-q --nrg-file $nrg_file $vcd_opt --iso9660" \
|
||||||
svcdgs.dump ${srcdir}/svcdgs.right
|
svcdgs.dump ${srcdir}/svcdgs.right
|
||||||
RC=$?
|
RC=$?
|
||||||
check_result $RC 'cd-info NRG test 3'
|
check_result $RC 'cd-info NRG test 3'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#$Id: check_opts.sh,v 1.4 2003/09/20 00:28:32 rocky Exp $
|
#$Id: check_opts.sh,v 1.5 2003/10/06 04:04:05 rocky Exp $
|
||||||
# Check cd-info options
|
# Check cd-info options
|
||||||
if test -z "$srcdir" ; then
|
if test -z "$srcdir" ; then
|
||||||
srcdir=`pwd`
|
srcdir=`pwd`
|
||||||
@@ -15,10 +15,10 @@ BASE=`basename $0 .sh`
|
|||||||
|
|
||||||
fname=isofs-m1
|
fname=isofs-m1
|
||||||
i=0
|
i=0
|
||||||
for opt in '-T' '--no-tracks' '-A' '--no-analyze' '-I' '-no-ioctl' \
|
for opt in '-T' '--no-tracks' '-A' '--no-analyze' '-I' '--no-ioctl' \
|
||||||
'-q' '--quiet' ; do
|
'-q' '--quiet' ; do
|
||||||
testname=${BASE}$i
|
testname=${BASE}$i
|
||||||
test_cdinfo "--cue-file ${srcdir}/${fname}.cue $opt" \
|
test_cdinfo "--cue-file ${srcdir}/${fname}.cue $opt --quiet" \
|
||||||
${testname}.dump ${srcdir}/${testname}.right
|
${testname}.dump ${srcdir}/${testname}.right
|
||||||
RC=$?
|
RC=$?
|
||||||
check_result $RC "cd-info option test $opt"
|
check_result $RC "cd-info option test $opt"
|
||||||
|
|||||||
Reference in New Issue
Block a user