libcdio-paranoia 10.2+2.0.2
Functions
common_interface.c File Reference
#include "common_interface.h"
#include <math.h>
#include "utils.h"
#include "smallft.h"

Functions

int data_bigendianp (cdrom_drive_t *d)
 
int FixupTOC (cdrom_drive_t *d, track_t i_tracks)
 

Function Documentation

◆ data_bigendianp()

int data_bigendianp ( cdrom_drive_t d)

Determine Endian-ness of the CD-drive based on reading data from it. Some drives return audio data Big Endian while some (most) return data Little Endian. Drives known to return data bigendian are SCSI drives from Kodak, Ricoh, HP, Philips, Plasmon, Grundig CDR100IPW, and Mitsumi CD-R. ATAPI and MMC drives are little endian.

rocky: As someone who didn't write the code, I have to say this is nothing less than brilliant. An FFT is done both ways and the the transform is looked at to see which has data in the FFT (or audible) portion. (Or so that's how I understand it.)

Returns
1 if big-endian, 0 if little-endian, -1 if we couldn't figure things out or some error.

◆ FixupTOC()

int FixupTOC ( cdrom_drive_t d,
track_t  i_tracks 
)

Here we fix up a couple of things that will never happen. yeah, right.

The multisession stuff is from Hannu code; it assumes it knows the leadout/leadin size. [I think Hannu refers to Hannu Savolainen from GNU/Linux Kernel code.]

Returns
-1 if we can't get multisession info, 0 if there is one session only or the last session LBA is the same as the first audio track and 1 if the multi-session lba is higher than first audio track