libcdio-paranoia
10.2+0.94+2git
|
#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 |
#define MIN_SEEK_MS 6 |
Referenced by paranoia_seek().
#define OVERLAP_ADJ (MIN_WORDS_OVERLAP/2-1) |
#define rc | ( | r | ) | (r->vector) |
typedef struct sync_result sync_result_t |
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 |
void cdio_paranoia_overlapset | ( | cdrom_paranoia_t * | p, |
long int | overlap | ||
) |
References CD_FRAMEWORDS, cdrom_paranoia_s::dynoverlap, offsets::offpoints, and cdrom_paranoia_s::stage1.
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.
p | paranoia object. |
callback | callback routine which gets called with the status on each read. |
max_retries | number of times to try re-reading a block before failing. |
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 | ) |
void paranoia_free | ( | cdrom_paranoia_t * | p | ) |
References cdrom_paranoia_s::cache, cdrom_paranoia_s::fragments, free_list(), paranoia_resetall(), sort_free(), and cdrom_paranoia_s::sortcache.
Referenced by analyze_cache(), and main().
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
p | paranoia type |
mode_flags | paranoia 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 | ||
) |
reposition reading offset.
p | paranoia type |
seek | byte offset to seek to |
whence | like corresponding parameter in libc's lseek, e.g. SEEK_SET or SEEK_END. |
References linked_list_t::active, cdrom_paranoia_s::cache, cb, CD_FRAMEWORDS, cdrom_paranoia_s::cdcache_begin, cdrom_paranoia_s::cdcache_end, cdrom_paranoia_s::cdcache_size, cdda_disc_firstsector(), cdda_disc_lastsector(), cdda_read, cdda_read_timed, cdda_sector_gettrack(), ce, cdrom_paranoia_s::current_firstsector, cdrom_paranoia_s::current_lastsector, cdrom_paranoia_s::cursor, cdrom_paranoia_s::d, cdrom_paranoia_s::dyndrift, cdrom_paranoia_s::dynoverlap, cdrom_paranoia_s::enable, sync_result::end, ENOMEDIUM, FLAGS_EDGE, FLAGS_UNREAD, free_c_block(), i_cblock_destructor(), i_paranoia_firstlast(), JIGGLE_MODULO, cdrom_paranoia_s::jitter, root_block::lastsector, MIN_SEEK_MS, MIN_WORDS_OVERLAP, new_c_block(), cdrom_drive_s::nsectors, NULL, cdrom_drive_s::p_cdio, PARANOIA_CB_CACHEERR, PARANOIA_CB_READ, PARANOIA_CB_READERR, PARANOIA_MODE_OVERLAP, PARANOIA_MODE_VERIFY, paranoia_resetall(), recover_cache(), root_block::returnedlimit, cdrom_paranoia_s::root, and root_block::vector.
Referenced by main().
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[] |
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.