libcdio-paranoia  10.2+0.94+2git
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
paranoia.c File Reference
#include <unistd.h>
#include <stdio.h>
#include <limits.h>
#include <math.h>
#include <cdio/paranoia/cdda.h>
#include "../cdda_interface/smallft.h"
#include <cdio/paranoia/version.h>
#include "p_block.h"
#include <cdio/paranoia/paranoia.h>
#include "overlap.h"
#include "gap.h"
#include "isort.h"
#include <errno.h>

Data Structures

struct  sync_result
 

Macros

#define MIN_SEEK_MS   6
 
#define rc(r)   (r->vector)
 
#define OVERLAP_ADJ   (MIN_WORDS_OVERLAP/2-1)
 

Typedefs

typedef struct sync_result sync_result_t
 

Enumerations

enum  { FLAGS_EDGE =0x1, FLAGS_UNREAD =0x2, FLAGS_VERIFIED =0x4 }
 

Functions

void paranoia_free (cdrom_paranoia_t *p)
 
void paranoia_modeset (cdrom_paranoia_t *p, int mode_flags)
 
lsn_t paranoia_seek (cdrom_paranoia_t *p, int32_t seek, int whence)
 
int16_t * cdio_paranoia_read (cdrom_paranoia_t *p, void(*callback)(long, paranoia_cb_mode_t))
 
int16_t * cdio_paranoia_read_limited (cdrom_paranoia_t *p, void(*callback)(long int, paranoia_cb_mode_t), int max_retries)
 
void cdio_paranoia_overlapset (cdrom_paranoia_t *p, long int overlap)
 
const char * cdio_paranoia_version (void)
 

Variables

const char * paranoia_cb_mode2str []
 
paranoia_mode_t debug_paranoia_mode
 
paranoia_cb_mode_t debug_paranoia_cb_mode
 
enum { ... }  paranoia_read_flags
 

Macro Definition Documentation

#define MIN_SEEK_MS   6

Referenced by paranoia_seek().

#define OVERLAP_ADJ   (MIN_WORDS_OVERLAP/2-1)
#define rc (   r)    (r->vector)

Typedef Documentation

typedef struct sync_result sync_result_t

Enumeration Type Documentation

anonymous enum

Flags indicating the status of a read samples.

Imagine the below enumeration values are #defines to be used in a bitmask rather than distinct values of an enum.

The variable part of the declaration is trickery to force the enum symbol values to be recorded in debug symbol tables. They are used to allow one refer to the enumeration value names in a debugger and in debugger expressions.

Enumerator
FLAGS_EDGE 

first/last N words of frame

FLAGS_UNREAD 

unread, hence missing and unmatchable

FLAGS_VERIFIED 

block read and verified

Function Documentation

void cdio_paranoia_overlapset ( cdrom_paranoia_t p,
long int  overlap 
)
int16_t* cdio_paranoia_read ( cdrom_paranoia_t p,
void(*)(long, paranoia_cb_mode_t callback 
)

========================================================================== cdio_paranoia_read(), cdio_paranoia_read_limited()

These functions "read" the next sector of audio data and returns a pointer to a full sector of verified samples (2352 bytes).

The returned buffer is not to be freed by the caller. It will persist only until the next call to paranoia_read() for this p

References paranoia_read_limited.

int16_t* cdio_paranoia_read_limited ( cdrom_paranoia_t p,
void(*)(long int, paranoia_cb_mode_t callback,
int  max_retries 
)

The same as cdio_paranoia_read but the number of retries is set.

Parameters
pparanoia object.
callbackcallback routine which gets called with the status on each read.
max_retriesnumber of times to try re-reading a block before failing.
Returns
the block of CDIO_FRAMEIZE_RAW bytes (or CDIO_FRAMESIZE_RAW / 2 16-bit integers). Unless byte-swapping has been turned off the 16-bit integers Endian independent order.
See also
cdio_paranoia_read.

References cb, CD_FRAMEWORDS, ce, cs, cdrom_paranoia_s::cursor, cdrom_paranoia_s::d, cdrom_paranoia_s::dynoverlap, cdrom_paranoia_s::enable, sync_result::end, ENOMEDIUM, FLAGS_EDGE, free_elem(), i_cblock_destructor(), i_paranoia_trim(), root_block::lastsector, MAX_SECTOR_OVERLAP, new_v_fragment(), NULL, offsets::offpoints, cdrom_drive_s::opened, PARANOIA_CB_OVERLAP, PARANOIA_MODE_NEVERSKIP, PARANOIA_MODE_OVERLAP, PARANOIA_MODE_VERIFY, recover_cache(), root_block::returnedlimit, cdrom_paranoia_s::root, root_block::silencebegin, cdrom_paranoia_s::stage1, and root_block::vector.

const char* cdio_paranoia_version ( void  )

Get libcdio-paranoia version.

Returns
paranoia version string

References LIBCDIO_PARANOIA_VERSION.

void paranoia_free ( cdrom_paranoia_t p)
void paranoia_modeset ( cdrom_paranoia_t p,
int  mode_flags 
)

Set the kind of repair you want to on for reading. The modes are listed above

Parameters
pparanoia type
mode_flagsparanoia mode flags built from values in paranoia_mode_t, e.g. PARANOIA_MODE_FULL^PARANOIA_MODE_NEVERSKIP

References cdrom_paranoia_s::enable.

Referenced by main().

lsn_t paranoia_seek ( cdrom_paranoia_t p,
int32_t  seek,
int  whence 
)

Variable Documentation

paranoia_cb_mode_t debug_paranoia_cb_mode
paranoia_mode_t debug_paranoia_mode

The below variables are trickery to force the above enum symbol values to be recorded in debug symbol tables. They are used to allow one to refer to the enumeration value names in the typedefs above in a debugger and debugger expressions

const char* paranoia_cb_mode2str[]
Initial value:
= {
"read",
"verify",
"fixup edge",
"fixup atom",
"scratch",
"repair",
"skip",
"drift",
"backoff",
"overlap",
"fixup dropped",
"fixup duplicated",
"read error"
}
enum { ... } paranoia_read_flags

Flags indicating the status of a read samples.

Imagine the below enumeration values are #defines to be used in a bitmask rather than distinct values of an enum.

The variable part of the declaration is trickery to force the enum symbol values to be recorded in debug symbol tables. They are used to allow one refer to the enumeration value names in a debugger and in debugger expressions.