LMMS
Loading...
Searching...
No Matches
vorbisfile.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <math.h>
#include "../../codec.h"
#include "../../vorbisfile.h"
#include "os.h"
#include "misc.h"

Macros

#define CHUNKSIZE   65536 /* greater-than-page-size granularity seeking */
#define READSIZE   2048 /* a smaller read size is needed for low-rate streaming. */

Functions

static long _get_data (OggVorbis_File *vf)
static int _seek_helper (OggVorbis_File *vf, ogg_int64_t offset)
static ogg_int64_t _get_next_page (OggVorbis_File *vf, ogg_page *og, ogg_int64_t boundary)
static ogg_int64_t _get_prev_page (OggVorbis_File *vf, ogg_int64_t begin, ogg_page *og)
static void _add_serialno (ogg_page *og, long **serialno_list, int *n)
static int _lookup_serialno (long s, long *serialno_list, int n)
static int _lookup_page_serialno (ogg_page *og, long *serialno_list, int n)
static ogg_int64_t _get_prev_page_serial (OggVorbis_File *vf, ogg_int64_t begin, long *serial_list, int serial_n, int *serialno, ogg_int64_t *granpos)
static int _fetch_headers (OggVorbis_File *vf, vorbis_info *vi, vorbis_comment *vc, long **serialno_list, int *serialno_n, ogg_page *og_ptr)
static ogg_int64_t _initial_pcmoffset (OggVorbis_File *vf, vorbis_info *vi)
static int _bisect_forward_serialno (OggVorbis_File *vf, ogg_int64_t begin, ogg_int64_t searched, ogg_int64_t end, ogg_int64_t endgran, int endserial, long *currentno_list, int currentnos, long m)
static int _make_decode_ready (OggVorbis_File *vf)
static int _open_seekable2 (OggVorbis_File *vf)
static void _decode_clear (OggVorbis_File *vf)
static int _fetch_and_process_packet (OggVorbis_File *vf, ogg_packet *op_in, int readp, int spanp)
static int _fseek64_wrap (FILE *f, ogg_int64_t off, int whence)
static int _ov_open1 (void *f, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks)
static int _ov_open2 (OggVorbis_File *vf)
int ov_clear (OggVorbis_File *vf)
int ov_open_callbacks (void *f, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks)
int ov_open (FILE *f, OggVorbis_File *vf, const char *initial, long ibytes)
int ov_fopen (const char *path, OggVorbis_File *vf)
int ov_halfrate (OggVorbis_File *vf, int flag)
int ov_halfrate_p (OggVorbis_File *vf)
int ov_test_callbacks (void *f, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks)
int ov_test (FILE *f, OggVorbis_File *vf, const char *initial, long ibytes)
int ov_test_open (OggVorbis_File *vf)
long ov_streams (OggVorbis_File *vf)
long ov_seekable (OggVorbis_File *vf)
long ov_bitrate (OggVorbis_File *vf, int i)
long ov_bitrate_instant (OggVorbis_File *vf)
long ov_serialnumber (OggVorbis_File *vf, int i)
ogg_int64_t ov_raw_total (OggVorbis_File *vf, int i)
ogg_int64_t ov_pcm_total (OggVorbis_File *vf, int i)
double ov_time_total (OggVorbis_File *vf, int i)
int ov_raw_seek (OggVorbis_File *vf, ogg_int64_t pos)
int ov_pcm_seek_page (OggVorbis_File *vf, ogg_int64_t pos)
int ov_pcm_seek (OggVorbis_File *vf, ogg_int64_t pos)
int ov_time_seek (OggVorbis_File *vf, double seconds)
int ov_time_seek_page (OggVorbis_File *vf, double seconds)
ogg_int64_t ov_raw_tell (OggVorbis_File *vf)
ogg_int64_t ov_pcm_tell (OggVorbis_File *vf)
double ov_time_tell (OggVorbis_File *vf)
vorbis_infoov_info (OggVorbis_File *vf, int link)
vorbis_commentov_comment (OggVorbis_File *vf, int link)
static int host_is_big_endian ()
long ov_read_filter (OggVorbis_File *vf, char *buffer, int length, int bigendianp, int word, int sgned, int *bitstream, void(*filter)(float **pcm, long channels, long samples, void *filter_param), void *filter_param)
long ov_read (OggVorbis_File *vf, char *buffer, int length, int bigendianp, int word, int sgned, int *bitstream)
long ov_read_float (OggVorbis_File *vf, float ***pcm_channels, int length, int *bitstream)
const float * vorbis_window (vorbis_dsp_state *v, int W)
static void _ov_splice (float **pcm, float **lappcm, int n1, int n2, int ch1, int ch2, const float *w1, const float *w2)
static int _ov_initset (OggVorbis_File *vf)
static int _ov_initprime (OggVorbis_File *vf)
static void _ov_getlap (OggVorbis_File *vf, vorbis_info *vi, vorbis_dsp_state *vd, float **lappcm, int lapsize)
int ov_crosslap (OggVorbis_File *vf1, OggVorbis_File *vf2)
static int _ov_64_seek_lap (OggVorbis_File *vf, ogg_int64_t pos, int(*localseek)(OggVorbis_File *, ogg_int64_t))
int ov_raw_seek_lap (OggVorbis_File *vf, ogg_int64_t pos)
int ov_pcm_seek_lap (OggVorbis_File *vf, ogg_int64_t pos)
int ov_pcm_seek_page_lap (OggVorbis_File *vf, ogg_int64_t pos)
static int _ov_d_seek_lap (OggVorbis_File *vf, double pos, int(*localseek)(OggVorbis_File *, double))
int ov_time_seek_lap (OggVorbis_File *vf, double pos)
int ov_time_seek_page_lap (OggVorbis_File *vf, double pos)

Macro Definition Documentation

◆ CHUNKSIZE

#define CHUNKSIZE   65536 /* greater-than-page-size granularity seeking */

◆ READSIZE

#define READSIZE   2048 /* a smaller read size is needed for low-rate streaming. */

Function Documentation

◆ _add_serialno()

void _add_serialno ( ogg_page * og,
long ** serialno_list,
int * n )
static

◆ _bisect_forward_serialno()

int _bisect_forward_serialno ( OggVorbis_File * vf,
ogg_int64_t begin,
ogg_int64_t searched,
ogg_int64_t end,
ogg_int64_t endgran,
int endserial,
long * currentno_list,
int currentnos,
long m )
static

◆ _decode_clear()

void _decode_clear ( OggVorbis_File * vf)
static

◆ _fetch_and_process_packet()

int _fetch_and_process_packet ( OggVorbis_File * vf,
ogg_packet * op_in,
int readp,
int spanp )
static

◆ _fetch_headers()

int _fetch_headers ( OggVorbis_File * vf,
vorbis_info * vi,
vorbis_comment * vc,
long ** serialno_list,
int * serialno_n,
ogg_page * og_ptr )
static

◆ _fseek64_wrap()

int _fseek64_wrap ( FILE * f,
ogg_int64_t off,
int whence )
static

◆ _get_data()

long _get_data ( OggVorbis_File * vf)
static

◆ _get_next_page()

ogg_int64_t _get_next_page ( OggVorbis_File * vf,
ogg_page * og,
ogg_int64_t boundary )
static

◆ _get_prev_page()

ogg_int64_t _get_prev_page ( OggVorbis_File * vf,
ogg_int64_t begin,
ogg_page * og )
static

◆ _get_prev_page_serial()

ogg_int64_t _get_prev_page_serial ( OggVorbis_File * vf,
ogg_int64_t begin,
long * serial_list,
int serial_n,
int * serialno,
ogg_int64_t * granpos )
static

◆ _initial_pcmoffset()

ogg_int64_t _initial_pcmoffset ( OggVorbis_File * vf,
vorbis_info * vi )
static

◆ _lookup_page_serialno()

int _lookup_page_serialno ( ogg_page * og,
long * serialno_list,
int n )
static

◆ _lookup_serialno()

int _lookup_serialno ( long s,
long * serialno_list,
int n )
static

◆ _make_decode_ready()

int _make_decode_ready ( OggVorbis_File * vf)
static

◆ _open_seekable2()

int _open_seekable2 ( OggVorbis_File * vf)
static

◆ _ov_64_seek_lap()

int _ov_64_seek_lap ( OggVorbis_File * vf,
ogg_int64_t pos,
int(* localseek )(OggVorbis_File *, ogg_int64_t) )
static

◆ _ov_d_seek_lap()

int _ov_d_seek_lap ( OggVorbis_File * vf,
double pos,
int(* localseek )(OggVorbis_File *, double) )
static

◆ _ov_getlap()

void _ov_getlap ( OggVorbis_File * vf,
vorbis_info * vi,
vorbis_dsp_state * vd,
float ** lappcm,
int lapsize )
static

◆ _ov_initprime()

int _ov_initprime ( OggVorbis_File * vf)
static

◆ _ov_initset()

int _ov_initset ( OggVorbis_File * vf)
static

◆ _ov_open1()

int _ov_open1 ( void * f,
OggVorbis_File * vf,
const char * initial,
long ibytes,
ov_callbacks callbacks )
static

◆ _ov_open2()

int _ov_open2 ( OggVorbis_File * vf)
static

◆ _ov_splice()

void _ov_splice ( float ** pcm,
float ** lappcm,
int n1,
int n2,
int ch1,
int ch2,
const float * w1,
const float * w2 )
static

◆ _seek_helper()

int _seek_helper ( OggVorbis_File * vf,
ogg_int64_t offset )
static

◆ host_is_big_endian()

int host_is_big_endian ( )
static

◆ ov_bitrate()

long ov_bitrate ( OggVorbis_File * vf,
int i )

◆ ov_bitrate_instant()

long ov_bitrate_instant ( OggVorbis_File * vf)

◆ ov_clear()

int ov_clear ( OggVorbis_File * vf)

◆ ov_comment()

vorbis_comment * ov_comment ( OggVorbis_File * vf,
int link )

◆ ov_crosslap()

int ov_crosslap ( OggVorbis_File * vf1,
OggVorbis_File * vf2 )

◆ ov_fopen()

int ov_fopen ( const char * path,
OggVorbis_File * vf )

◆ ov_halfrate()

int ov_halfrate ( OggVorbis_File * vf,
int flag )

◆ ov_halfrate_p()

int ov_halfrate_p ( OggVorbis_File * vf)

◆ ov_info()

vorbis_info * ov_info ( OggVorbis_File * vf,
int link )

◆ ov_open()

int ov_open ( FILE * f,
OggVorbis_File * vf,
const char * initial,
long ibytes )

◆ ov_open_callbacks()

int ov_open_callbacks ( void * f,
OggVorbis_File * vf,
const char * initial,
long ibytes,
ov_callbacks callbacks )

◆ ov_pcm_seek()

int ov_pcm_seek ( OggVorbis_File * vf,
ogg_int64_t pos )

◆ ov_pcm_seek_lap()

int ov_pcm_seek_lap ( OggVorbis_File * vf,
ogg_int64_t pos )

◆ ov_pcm_seek_page()

int ov_pcm_seek_page ( OggVorbis_File * vf,
ogg_int64_t pos )

◆ ov_pcm_seek_page_lap()

int ov_pcm_seek_page_lap ( OggVorbis_File * vf,
ogg_int64_t pos )

◆ ov_pcm_tell()

ogg_int64_t ov_pcm_tell ( OggVorbis_File * vf)

◆ ov_pcm_total()

ogg_int64_t ov_pcm_total ( OggVorbis_File * vf,
int i )

◆ ov_raw_seek()

int ov_raw_seek ( OggVorbis_File * vf,
ogg_int64_t pos )

◆ ov_raw_seek_lap()

int ov_raw_seek_lap ( OggVorbis_File * vf,
ogg_int64_t pos )

◆ ov_raw_tell()

ogg_int64_t ov_raw_tell ( OggVorbis_File * vf)

◆ ov_raw_total()

ogg_int64_t ov_raw_total ( OggVorbis_File * vf,
int i )

◆ ov_read()

long ov_read ( OggVorbis_File * vf,
char * buffer,
int length,
int bigendianp,
int word,
int sgned,
int * bitstream )

◆ ov_read_filter()

long ov_read_filter ( OggVorbis_File * vf,
char * buffer,
int length,
int bigendianp,
int word,
int sgned,
int * bitstream,
void(* filter )(float **pcm, long channels, long samples, void *filter_param),
void * filter_param )

◆ ov_read_float()

long ov_read_float ( OggVorbis_File * vf,
float *** pcm_channels,
int length,
int * bitstream )

◆ ov_seekable()

long ov_seekable ( OggVorbis_File * vf)

◆ ov_serialnumber()

long ov_serialnumber ( OggVorbis_File * vf,
int i )

◆ ov_streams()

long ov_streams ( OggVorbis_File * vf)

◆ ov_test()

int ov_test ( FILE * f,
OggVorbis_File * vf,
const char * initial,
long ibytes )

◆ ov_test_callbacks()

int ov_test_callbacks ( void * f,
OggVorbis_File * vf,
const char * initial,
long ibytes,
ov_callbacks callbacks )

◆ ov_test_open()

int ov_test_open ( OggVorbis_File * vf)

◆ ov_time_seek()

int ov_time_seek ( OggVorbis_File * vf,
double seconds )

◆ ov_time_seek_lap()

int ov_time_seek_lap ( OggVorbis_File * vf,
double pos )

◆ ov_time_seek_page()

int ov_time_seek_page ( OggVorbis_File * vf,
double seconds )

◆ ov_time_seek_page_lap()

int ov_time_seek_page_lap ( OggVorbis_File * vf,
double pos )

◆ ov_time_tell()

double ov_time_tell ( OggVorbis_File * vf)

◆ ov_time_total()

double ov_time_total ( OggVorbis_File * vf,
int i )

◆ vorbis_window()

const float * vorbis_window ( vorbis_dsp_state * v,
int W )
extern