Skip to content

Commit

Permalink
Merge pull request #4 from jzmexec/master
Browse files Browse the repository at this point in the history
add patch 1.11
  • Loading branch information
orangesnn authored Jan 26, 2021
2 parents 42488c3 + cc10c55 commit 6403c26
Show file tree
Hide file tree
Showing 23 changed files with 222 additions and 198 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0015 OLD)
PROJECT (cdrkit C)
SUBDIRS(include genisoimage wodim libedc libhfs_iso libparanoia icedax libusal librols libunls readom netscsid 3rd-party/dirsplit)
SUBDIRS(include genisoimage wodim libedc libhfs_iso icedax libusal librols libunls readom netscsid 3rd-party/dirsplit)

4 changes: 2 additions & 2 deletions genisoimage/exclude.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ exclude(char *fn)
{
register int i;

for (i = 0; excl[i] && i < MAXEXCL; i++)
for (i = 0; i < MAXEXCL && excl[i]; i++)
;

if (i == MAXEXCL) {
Expand Down Expand Up @@ -69,7 +69,7 @@ is_excluded(char *fn)
/*
* very dumb search method ...
*/
for (i = 0; excl[i] && i < MAXEXCL; i++) {
for (i = 0; i < MAXEXCL && excl[i]; i++) {
if (strcmp(excl[i], fn) == 0) {
return (1); /* found -> excluded filenmae */
}
Expand Down
2 changes: 1 addition & 1 deletion genisoimage/jte.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ extern int list_file_in_jigdo(char *filename, off_t size, char **realname, unsig
if (!jtemplate_out)
return 0;

memset(md5, 0, sizeof(md5));
memset(md5, 0, 16);

/* Cheaper to check file size first */
if (size < jte_min_size)
Expand Down
2 changes: 1 addition & 1 deletion genisoimage/md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ mk_MD5Final (unsigned char digest[16], struct mk_MD5Context *ctx)
putu32(ctx->buf[1], digest + 4);
putu32(ctx->buf[2], digest + 8);
putu32(ctx->buf[3], digest + 12);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
}

/* The four core functions - F1 is optimized somewhat */
Expand Down
5 changes: 5 additions & 0 deletions genisoimage/rock.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
#include <device.h>
#include <schily.h>

/* "major" and "minor" macros will be moved to sysmacros.h
* silence the warning
* added by cdrkit-1.1.11-sysmacros.patch */
#include <sys/sysmacros.h>

#define SU_VERSION 1

#define SL_ROOT 8
Expand Down
16 changes: 13 additions & 3 deletions genisoimage/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
#include <fctldefs.h>
#include <device.h>
#include <schily.h>
#include <libgen.h>

/* "major" and "minor" macros will be moved to sysmacros.h
* silence the warning
* added by cdrkit-1.1.11-sysmacros.patch */
#include <sys/sysmacros.h>

extern int allow_limited_size;

Expand Down Expand Up @@ -1421,12 +1427,16 @@ insert_file_entry(struct directory *this_dir, char *whole_path,
return (0);
}
if (this_dir == root && strcmp(short_name, ".") == 0)
root_statbuf = statbuf; /* Save this for later on */
memcpy(&root_statbuf, &statbuf, sizeof(root_statbuf)); /* Save this for later on */

/* We do this to make sure that the root entries are consistent */
if (this_dir == root && strcmp(short_name, "..") == 0) {
statbuf = root_statbuf;
lstatbuf = root_statbuf;
/* for the case .. comes before . */
if (!root_statbuf.st_ctime) {
stat_filter(dirname(whole_path), &root_statbuf);
}
memcpy(&statbuf, &root_statbuf, sizeof(statbuf));
memcpy(&lstatbuf, &root_statbuf, sizeof(lstatbuf));
}
if (S_ISLNK(lstatbuf.st_mode)) {

Expand Down
15 changes: 12 additions & 3 deletions icedax/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
PROJECT (icedax C)
INCLUDE_DIRECTORIES(../include ../wodim ../libparanoia ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include)
INCLUDE_DIRECTORIES(../include ../wodim ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/include)
include(../include/AddScgBits.cmake)
include(../include/AddSchilyBits.cmake)
include(../include/AddNetworkBits.cmake)
INCLUDE (CheckLibraryExists)

FIND_FILE (HAVE_SYS_SOUNDCARD_H sys/soundcard.h)
IF(HAVE_SYS_SOUNDCARD_H)
Expand All @@ -18,12 +19,20 @@ IF(HAVE_LIBOSSAUDIO)
LIST(APPEND EXTRA_LIBS "ossaudio")
ENDIF(HAVE_LIBOSSAUDIO)

LIST(APPEND EXTRA_LIBS paranoia)
CHECK_INCLUDE_FILES(cdda/cdda_interface.h HAVE_CDDA_INTERFACE_H)
CHECK_LIBRARY_EXISTS (cdda_paranoia paranoia_init "" HAVE_LIBPARANOIA)
IF(HAVE_CDDA_INTERFACE_H AND HAVE_LIBPARANOIA)
LIST(APPEND EXTRA_LIBS cdda_paranoia cdda_interface)
ELSE(HAVE_CDDA_INTERFACE_H AND HAVE_LIBPARANOIA)
MESSAGE(FATAL_ERROR "You need cdparanoia library installed")
ENDIF(HAVE_CDDA_INTERFACE_H AND HAVE_LIBPARANOIA)

LIST(APPEND EXTRA_LIBS)
IF (WIN32)
LIST(APPEND EXTRA_LIBS winmm)
ENDIF (WIN32)

LINK_DIRECTORIES(../librols ../libusal ../libparanoia)
LINK_DIRECTORIES(../librols ../libusal)
ADD_EXECUTABLE (icedax aifc.c aiff.c base64.c icedax.c interface.c ioctl.c raw.c resample.c ringbuff.c scsi_cmds.c semshm.c setuid.c sha_func.c sndconfig.c sun.c toc.c wav.c)
TARGET_LINK_LIBRARIES(icedax wodimstuff ${EXTRA_LIBS})
SET_TARGET_PROPERTIES(icedax PROPERTIES SKIP_BUILD_RPATH TRUE)
Expand Down
11 changes: 6 additions & 5 deletions icedax/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#include "md5.h"
#endif
#ifdef USE_PARANOIA
#include "cdda_paranoia.h"
#include <cdda/cdda_interface.h>
#include <cdda/cdda_paranoia.h>
#endif

typedef struct index_list
Expand Down Expand Up @@ -102,10 +103,10 @@ typedef struct global

struct paranoia_parms_t
{
Ucbit disable_paranoia:1;
Ucbit disable_extra_paranoia:1;
Ucbit disable_scratch_detect:1;
Ucbit disable_scratch_repair:1;
char disable_paranoia:1;
char disable_extra_paranoia:1;
char disable_scratch_detect:1;
char disable_scratch_repair:1;
int retries;
int overlap;
int mindynoverlap;
Expand Down
47 changes: 29 additions & 18 deletions icedax/icedax.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
#ifdef USE_LAME
#include "mp3.h" /* mp3 file handling */
#endif
#ifdef USE_PARANOIA
#include <cdda/cdda_interface.h>
#include <cdda/cdda_paranoia.h>
#endif
#include "interface.h" /* low level cdrom interfacing */
#include "icedax.h"
#include "resample.h"
Expand All @@ -128,9 +132,6 @@
#include "ringbuff.h"
#include "global.h"
#include "exitcodes.h"
#ifdef USE_PARANOIA
#include "cdda_paranoia.h"
#endif
#include "defaults.h"

static void RestrictPlaybackRate(long newrate);
Expand Down Expand Up @@ -800,7 +801,7 @@ static void init_globals()
global.useroverlap = -1; /* amount of overlapping sectors user override */
global.need_hostorder = 0; /* processing needs samples in host endianess */
global.in_lendian = -1; /* input endianess from SetupSCSI() */
global.outputendianess = NONE; /* user specified output endianess */
global.outputendianess = NONE_EN; /* user specified output endianess */
global.findminmax = 0; /* flag find extrem amplitudes */
#ifdef HAVE_LIMITS_H
global.maxamp[0] = INT_MIN; /* maximum amplitude */
Expand Down Expand Up @@ -2418,7 +2419,7 @@ Rate Divider Rate Divider Rate Divider Rate Divider\n\
if (bulk == -1) bulk = 0;

global.need_big_endian = global.audio_out->need_big_endian;
if (global.outputendianess != NONE)
if (global.outputendianess != NONE_EN)
global.need_big_endian = global.outputendianess == BIG;

if (global.no_file) global.fname_base[0] = '\0';
Expand Down Expand Up @@ -2602,7 +2603,7 @@ Rate Divider Rate Divider Rate Divider Rate Divider\n\
fputs( ", soundcard", stderr );
#endif
#if defined USE_PARANOIA
fputs( ", libparanoia", stderr );
fputs( ", libcdda_paranoia", stderr );
#endif
fputs( " support\n", stderr );
}
Expand Down Expand Up @@ -2892,8 +2893,28 @@ Rate Divider Rate Divider Rate Divider Rate Divider\n\
#ifdef USE_PARANOIA
if (global.paranoia_selected) {
long paranoia_mode;
cdrom_drive *tmpdrive;
usal_close(get_scsi_p());

tmpdrive = cdda_identify(global.dev_name, 0, NULL);
if (!tmpdrive)
{
fputs("Can't identify disc\n", stderr);
return 1;
}

global.cdp = paranoia_init(get_scsi_p(), global.nsectors);
if(global.nsectors)
{
tmpdrive->nsectors = global.nsectors;
tmpdrive->bigbuff = global.nsectors * CD_FRAMESIZE_RAW;
}
if (cdda_open(tmpdrive) != 0)
{
fputs("Can't open disc\n", stderr);
cdda_close(tmpdrive);
return 1;
}
global.cdp = paranoia_init(tmpdrive);

if (global.paranoia_parms.overlap >= 0) {
int overlap = global.paranoia_parms.overlap;
Expand All @@ -2902,17 +2923,7 @@ Rate Divider Rate Divider Rate Divider Rate Divider\n\
overlap = global.nsectors - 1;
paranoia_overlapset(global.cdp, overlap);
}
/*
* Default to a minimum of dynamic overlapping == 0.5 sectors.
* If we don't do this, we get the default from libparanoia
* which is approx. 0.1.
*/
if (global.paranoia_parms.mindynoverlap < 0)
paranoia_dynoverlapset(global.cdp, CD_FRAMEWORDS/2, -1);
paranoia_dynoverlapset(global.cdp,
global.paranoia_parms.mindynoverlap * CD_FRAMEWORDS,
global.paranoia_parms.maxdynoverlap * CD_FRAMEWORDS);


paranoia_mode = PARANOIA_MODE_FULL ^ PARANOIA_MODE_NEVERSKIP;

if (global.paranoia_parms.disable_paranoia) {
Expand Down
2 changes: 1 addition & 1 deletion icedax/icedax.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

/* Endianess */
#define GUESS (-2)
#define NONE (-1)
#define NONE_EN (-1)
#define LITTLE 0
#define BIG 1

Expand Down
7 changes: 6 additions & 1 deletion icedax/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
#include <sys/ioctl.h>
#include <statdefs.h>

/* "major" and "minor" macros will be moved to sysmacros.h
* silence the warning
* added by cdrkit-1.1.11-sysmacros.patch */
#include <sys/sysmacros.h>


#include "mycdrom.h"
#include "lowlevel.h"
Expand Down Expand Up @@ -116,7 +121,7 @@ int (*Play_at)(SCSI *usalp, unsigned int from_sector, unsigned int sectors);
int (*StopPlay)(SCSI *usalp);
void (*trash_cache)(UINT4 *p, unsigned lSector, unsigned SectorBurstVal);

#if defined USE_PARANOIA
#if 0 //defined USE_PARANOIA
long cdda_read(void *d, void *buffer, long beginsector, long sectors);

long cdda_read(void *d, void *buffer, long beginsector, long sectors)
Expand Down
5 changes: 5 additions & 0 deletions icedax/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
#include <schily.h>
#include <device.h>

/* "major" and "minor" macros will be moved to sysmacros.h
* silence the warning
* added by cdrkit-1.1.11-sysmacros.patch */
#include <sys/sysmacros.h>

#include <usal/scsitransp.h>

#include "mycdrom.h"
Expand Down
Loading

0 comments on commit 6403c26

Please sign in to comment.