Commit 05f29765 authored by Monty's avatar Monty
Browse files

Incremental commit after rearranging build a bit and moving files into
slightly more logical places (preparing for a minor interface change
that moves mode settings and static codebooks outside libvorbis).

Monty

svn path=/trunk/vorbis/; revision=217
parent f637dd7b
# vorbis makefile configured for use with gcc on any platform
# $Id: Makefile.in,v 1.2 1999/07/13 07:48:11 mwhitson Exp $
# $Id: Makefile.in,v 1.3 1999/12/30 03:46:16 xiphmont Exp $
###############################################################################
# #
......@@ -17,7 +17,7 @@
@SET_MAKE@
SUBDIRS = lib cmdline
SUBDIRS = lib examples #cmdline
all debug profile selftest target clean:
@for dir in $(SUBDIRS); do (cd $$dir && $(MAKE) $(MFLAGS) $@) || exit 1; done
......@@ -933,10 +933,10 @@ else
# glibc 2.0/2.1
case $host in
i?86-*-linux*)
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char"
PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char";;
*-*-linux*)
DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
OPT="-O20 -ffast-math -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
PROFILE="-pg -g -O20 -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char";;
sparc-sun-*)
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
......@@ -1929,7 +1929,7 @@ done
ac_given_srcdir=$srcdir
trap 'rm -fr `echo "Makefile lib/Makefile cmdline/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
trap 'rm -fr `echo "Makefile lib/Makefile examples/Makefile vq/Makefile cmdline/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
......@@ -2018,7 +2018,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile lib/Makefile cmdline/Makefile"}
CONFIG_FILES=\${CONFIG_FILES-"Makefile lib/Makefile examples/Makefile vq/Makefile cmdline/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
......
# $Id: configure.in,v 1.6 1999/12/17 07:04:11 xiphmont Exp $
# $Id: configure.in,v 1.7 1999/12/30 03:46:18 xiphmont Exp $
AC_INIT(lib/mdct.c)
#AC_CONFIG_HEADER(config.h)
......@@ -47,10 +47,10 @@ else
# glibc 2.0/2.1
case $host in
i?86-*-linux*)
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char"
PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char";;
*-*-linux*)
DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
OPT="-O20 -ffast-math -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
PROFILE="-pg -g -O20 -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char";;
sparc-sun-*)
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
OPT="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8"
......@@ -184,4 +184,4 @@ AC_SUBST(RANLIB)
#AC_SUBST(LIBGTKDIR)
AC_SUBST(pthread_lib)
AC_OUTPUT(Makefile lib/Makefile cmdline/Makefile vq/Makefile)
AC_OUTPUT(Makefile lib/Makefile examples/Makefile vq/Makefile cmdline/Makefile)
......@@ -14,7 +14,7 @@
function: codec headers
author: Monty <xiphmont@mit.edu>
modifications by: Monty
last modification date: Nov 04 1999
last modification date: Dec 29 1999
********************************************************************/
......@@ -23,15 +23,15 @@
#include <sys/types.h> /* get BSD style 16/32/64 bit types */
/* If we have defines from the configure script, use those */
#ifndef size64
# define size64 int64_t
/* if no BSD width types, get them from the configure script */
#ifndef int64_t
# define int64_t size64
#endif
#ifndef size32
# define size32 int32_t
#ifndef int32_t
# define int32_t size32
#endif
#ifndef size16
# define size16 int16_t
#ifndef int16_t
# define int16_t size16
#endif
/* lookup structures for various simple transforms *****************/
......@@ -191,8 +191,8 @@ typedef struct {
long body_returned; /* elements of fill returned */
int *lacing_vals; /* The values that will go to the segment table */
size64 *pcm_vals; /* pcm_pos values for headers. Not compact
int *lacing_vals; /* The values that will go to the segment table */
int64_t *pcm_vals; /* pcm_pos values for headers. Not compact
this way, but it is simple coupled to the
lacing fifo */
long lacing_storage;
......@@ -214,7 +214,7 @@ typedef struct {
but we need coupling so that the codec
(which is in a seperate abstraction
layer) also knows about the gap */
size64 pcmpos;
int64_t pcmpos;
} ogg_stream_state;
......@@ -227,7 +227,7 @@ typedef struct {
long b_o_s;
long e_o_s;
size64 frameno;
int64_t frameno;
long packetno; /* sequence number for decode; the framing
knows where there's a hole in the data,
but we need coupling so that the codec
......@@ -282,10 +282,10 @@ typedef struct vorbis_dsp_state{
long frameno;
long sequence;
size64 gluebits;
size64 time_envelope_bits;
size64 spectral_envelope_bits;
size64 spectral_residue_bits;
int64_t gluebits;
int64_t time_envelope_bits;
int64_t spectral_envelope_bits;
int64_t spectral_residue_bits;
} vorbis_dsp_state;
......@@ -301,10 +301,10 @@ typedef struct vorbis_block{
double *amp;
oggpack_buffer opb;
int pcm_channels; /* allocated, not used */
int pcm_storage; /* allocated, not used */
int floor_channels;
int floor_storage;
int pcm_channels; /* allocated, not used */
int pcm_storage; /* allocated, not used */
int floor_channels;
int floor_storage;
long lW;
long W;
......@@ -337,36 +337,36 @@ typedef struct vorbis_block{
/* OggSquish BITSREAM PRIMITIVES: encoding **************************/
extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
/* OggSquish BITSREAM PRIMITIVES: decoding **************************/
extern int ogg_sync_init(ogg_sync_state *oy);
extern int ogg_sync_clear(ogg_sync_state *oy);
extern int ogg_sync_destroy(ogg_sync_state *oy);
extern int ogg_sync_reset(ogg_sync_state *oy);
extern int ogg_sync_init(ogg_sync_state *oy);
extern int ogg_sync_clear(ogg_sync_state *oy);
extern int ogg_sync_destroy(ogg_sync_state *oy);
extern int ogg_sync_reset(ogg_sync_state *oy);
extern char *ogg_sync_buffer(ogg_sync_state *oy, long size);
extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
extern char *ogg_sync_buffer(ogg_sync_state *oy, long size);
extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
/* OggSquish BITSREAM PRIMITIVES: general ***************************/
extern int ogg_stream_init(ogg_stream_state *os,int serialno);
extern int ogg_stream_clear(ogg_stream_state *os);
extern int ogg_stream_reset(ogg_stream_state *os,long expected_pageno);
extern int ogg_stream_destroy(ogg_stream_state *os);
extern int ogg_stream_eof(ogg_stream_state *os);
extern int ogg_stream_init(ogg_stream_state *os,int serialno);
extern int ogg_stream_clear(ogg_stream_state *os);
extern int ogg_stream_reset(ogg_stream_state *os,long expected_pageno);
extern int ogg_stream_destroy(ogg_stream_state *os);
extern int ogg_stream_eof(ogg_stream_state *os);
extern int ogg_page_version(ogg_page *og);
extern int ogg_page_continued(ogg_page *og);
extern int ogg_page_bos(ogg_page *og);
extern int ogg_page_eos(ogg_page *og);
extern size64 ogg_page_frameno(ogg_page *og);
extern int64_t ogg_page_frameno(ogg_page *og);
extern int ogg_page_serialno(ogg_page *og);
extern int ogg_page_pageno(ogg_page *og);
......@@ -396,7 +396,7 @@ extern int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb);
extern int vorbis_analysis(vorbis_block *vb,ogg_packet *op);
/* Vorbis PRIMITIVES: synthesis layer *******************************/
extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op);
extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb);
......
......@@ -37,11 +37,11 @@ typedef struct {
long *offsets;
long *dataoffsets;
long *serialnos;
size64 *pcmlengths;
int64_t *pcmlengths;
vorbis_info *vi;
/* Decoding working state local storage */
size64 pcm_offset;
int64_t pcm_offset;
int decode_ready;
long current_serialno;
int current_link;
......@@ -62,15 +62,15 @@ extern long ov_seekable(OggVorbis_File *vf);
extern long ov_serialnumber(OggVorbis_File *vf,int i);
extern long ov_raw_total(OggVorbis_File *vf,int i);
extern size64 ov_pcm_total(OggVorbis_File *vf,int i);
extern int64_t ov_pcm_total(OggVorbis_File *vf,int i);
extern double ov_time_total(OggVorbis_File *vf,int i);
extern int ov_raw_seek(OggVorbis_File *vf,long pos);
extern int ov_pcm_seek(OggVorbis_File *vf,size64 pos);
extern int ov_pcm_seek(OggVorbis_File *vf,int64_t pos);
extern int ov_time_seek(OggVorbis_File *vf,double pos);
extern long ov_raw_tell(OggVorbis_File *vf);
extern size64 ov_pcm_tell(OggVorbis_File *vf);
extern int64_t ov_pcm_tell(OggVorbis_File *vf);
extern double ov_time_tell(OggVorbis_File *vf);
extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
......
# vorbis makefile configured for use with gcc on any platform
# $Id: Makefile.in,v 1.15 1999/11/17 03:52:56 xiphmont Exp $
# $Id: Makefile.in,v 1.16 1999/12/30 03:46:19 xiphmont Exp $
###############################################################################
# #
......@@ -16,7 +16,7 @@
# (unless, of course, you know what you are doing :) ##########################
@SET_MAKE@
FLAGS=-I. @TYPESIZES@ @CFLAGS@
FLAGS=-I. -I../include @TYPESIZES@ @CFLAGS@
OPT=@OPT@ $(FLAGS)
DEBUG=@DEBUG@ $(FLAGS)
PROFILE=@PROFILE@ $(FLAGS)
......@@ -27,14 +27,12 @@ AR=@AR@
RANLIB=@RANLIB@
LIBS=@LIBS@ -lm
HFILES = mdct.h codec.h bitwise.h envelope.h lpc.h lsp.h \
psy.h smallft.h window.h xlogmap.h os.h
HFILES = ../include/codec.h ../include/vorbisfile.h \
bitwise.h envelope.h lpc.h lsp.h \
psy.h smallft.h window.h xlogmap.h os.h mdct.h
LFILES = framing.o mdct.o smallft.o block.o envelope.o window.o\
lsp.o lpc.o analysis.o synthesis.o psy.o info.o bitwise.o\
spectrum.o
FFILES = vorbisfile.o
EFILES = encoder_example.o decoder_example.o chaining_example.o
BINFILES = encoder_example decoder_example chaining_example
spectrum.o vorbisfile.o
all:
$(MAKE) target CFLAGS="$(OPT)"
......@@ -48,7 +46,7 @@ analysis:
profile:
$(MAKE) target CFLAGS="$(PROFILE)"
target: libvorbis.a vorbisfile.a $(BINFILES)
target: libvorbis.a vorbisfile.a
selftest:
$(MAKE) clean
......@@ -59,38 +57,22 @@ selftest:
@./test_framing
@./test_bitwise
encoder_example: $(EFILES) libvorbis.a
$(CC) $(CFLAGS) $(LDFLAGS) encoder_example.o libvorbis.a -o \
encoder_example -lm
decoder_example: $(EFILES) libvorbis.a
$(CC) $(CFLAGS) $(LDFLAGS) decoder_example.o libvorbis.a -o \
decoder_example -lm
chaining_example: $(EFILES) libvorbis.a vorbisfile.a
$(CC) $(CFLAGS) $(LDFLAGS) chaining_example.o \
vorbisfile.a libvorbis.a -o chaining_example -lm
libvorbis.a: $(LFILES)
$(AR) -r libvorbis.a $^
$(RANLIB) libvorbis.a
vorbisfile.a: $(FFILES)
vorbisfile.a: $(LFILES)
$(AR) -r vorbisfile.a $^
$(RANLIB) vorbisfile.a
$(LFILES): $(HFILES)
$(FFILES): $(HFILES) vorbisfile.h
$(EFILES): $(HFILES) vorbisfile.h
info.o: modes.h
.c.o:
$(CC) $(CFLAGS) -c $<
clean:
-rm -f *.o *.a test* *~ *.out ogg config.* $(BINFILES) tone
-rm -f *.o *.a test* *~ *.out ogg config.* tone
distclean: clean
-rf -f Makefile
......
......@@ -45,9 +45,9 @@ int ogg_page_eos(ogg_page *og){
return((int)(og->header[5]&0x04));
}
size64 ogg_page_frameno(ogg_page *og){
int64_t ogg_page_frameno(ogg_page *og){
unsigned char *page=og->header;
size64 pcmpos=page[13]&(0xff);
int64_t pcmpos=page[13]&(0xff);
pcmpos= (pcmpos<<8)|(page[12]&0xff);
pcmpos= (pcmpos<<8)|(page[11]&0xff);
pcmpos= (pcmpos<<8)|(page[10]&0xff);
......@@ -74,10 +74,10 @@ int ogg_page_pageno(ogg_page *og){
/* helper to initialize lookup for direct-table CRC */
static unsigned size32 crc_lookup[256];
static unsigned int32_t crc_lookup[256];
static int crc_ready=0;
static unsigned size32 _ogg_crc_entry(unsigned long index){
static unsigned int32_t _ogg_crc_entry(unsigned long index){
int i;
unsigned long r;
......@@ -116,7 +116,7 @@ int ogg_stream_init(ogg_stream_state *os,int serialno){
os->lacing_storage=1024;
os->lacing_vals=malloc(os->lacing_storage*sizeof(int));
os->pcm_vals=malloc(os->lacing_storage*sizeof(size64));
os->pcm_vals=malloc(os->lacing_storage*sizeof(int64_t));
/* initialize the crc_lookup table if not done */
_ogg_crc_init();
......@@ -162,7 +162,7 @@ static void _os_lacing_expand(ogg_stream_state *os,int needed){
if(os->lacing_storage<=os->lacing_fill+needed){
os->lacing_storage+=(needed+32);
os->lacing_vals=realloc(os->lacing_vals,os->lacing_storage*sizeof(int));
os->pcm_vals=realloc(os->pcm_vals,os->lacing_storage*sizeof(size64));
os->pcm_vals=realloc(os->pcm_vals,os->lacing_storage*sizeof(int64_t));
}
}
......@@ -171,7 +171,7 @@ static void _os_lacing_expand(ogg_stream_state *os,int needed){
perform the checksum silmultaneously with other copies */
static void _os_checksum(ogg_page *og){
unsigned size32 crc_reg=0;
unsigned int32_t crc_reg=0;
int i;
for(i=0;i<og->header_len;i++)
......@@ -249,7 +249,7 @@ int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og){
int vals=0,bytes=0;
int maxvals=(os->lacing_fill>255?255:os->lacing_fill);
long acc=0;
size64 pcm_pos=os->pcm_vals[0];
int64_t pcm_pos=os->pcm_vals[0];
/* construct a page */
/* decide how many segments to include */
......@@ -327,7 +327,7 @@ int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og){
os->lacing_fill-=vals;
memmove(os->lacing_vals,os->lacing_vals+vals,os->lacing_fill*sizeof(int));
memmove(os->pcm_vals,os->pcm_vals+vals,os->lacing_fill*sizeof(size64));
memmove(os->pcm_vals,os->pcm_vals+vals,os->lacing_fill*sizeof(int64_t));
os->body_returned=bytes;
/* set pointers in the ogg_page struct */
......@@ -564,7 +564,7 @@ int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){
int continued=ogg_page_continued(og);
int bos=ogg_page_bos(og);
int eos=ogg_page_eos(og);
size64 pcmpos=ogg_page_frameno(og);
int64_t pcmpos=ogg_page_frameno(og);
int serialno=ogg_page_serialno(og);
int pageno=ogg_page_pageno(og);
int segments=header[26];
......@@ -588,7 +588,7 @@ int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){
memmove(os->lacing_vals,os->lacing_vals+lr,
(os->lacing_fill-lr)*sizeof(int));
memmove(os->pcm_vals,os->pcm_vals+lr,
(os->lacing_fill-lr)*sizeof(size64));
(os->lacing_fill-lr)*sizeof(int64_t));
}
os->lacing_fill-=lr;
os->lacing_packet-=lr;
......
/********************************************************************
* *
* THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
* THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
* PLEASE READ THESE TERMS DISTRIBUTING. *
* *
* THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 *
* by 1999 Monty <monty@xiph.org> and The XIPHOPHORUS Company *
* http://www.xiph.org/ *
* *
********************************************************************
function: predefined encoding modes
author: Monty <xiphmont@mit.edu>
modifications by: Monty
last modification date: Oct 22 1999
********************************************************************/
#ifndef _V_MODES_H_
#define _V_MODES_H_
#include <stdio.h>
#include "codec.h"
double threshhold_points[THRESH_POINTS]=
/* 0Hz 24kHz
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 */
{0.,.01,.02,.03,.04,.06,.08,.1,.15,.2,.25,.3,.34,.4,.45,.5,.6,.7,.8,1.};
vorbis_info predef_modes[]={
/* CD quality stereo, no channel coupling */
/* channels, sample rate, upperkbps, nominalkbps, lowerkbps */
{ 2, 44100, 0,0,0,
/* dummy, dummy, dummy, dummy */
0, NULL, 0, NULL,
/* smallblock, largeblock, LPC order (small, large) */
{256, 2048}, {16,16},
/* spectral octaves (small, large), spectral channels */
{5,5}, 2,
/* thresh sample period, preecho clamp trigger threshhold, range, dummy */
64, 4, 2, NULL,
/* noise masking curve dB attenuation levels [20] */
{-12,-12,-18,-18,-18,-18,-18,-18,-18,-12,
-8,-4,0,0,1,2,3,3,4,5},
/*{-100,-100,-100,-100,-100,-100,-100,-24,-24,-24,
-24,-24,-24,-24,-24,-24,-24,-24,-24,-24}*/
/* noise masking scale biases */
.95,1.01,.01,
/* tone masking curve dB attenuation levels [20] */
{-20,-20,-20,-20,-20,-20,-20,-20,-20,-20,
-20,-20,-20,-20,-20,-20,-20,-20,-20,-20},
/* tone masking rolloff settings (dB per octave), octave bias */
90,60,.001,
NULL,NULL,NULL},
};
#define predef_mode_max 0
#endif
......@@ -46,6 +46,18 @@ int _vs_spectrum_encode(vorbis_block *vb,double amp,double *lsp){
int bits=rint(log(n)/log(2));
int i;
#if 0
if(amp>0){
{
FILE *out=fopen("lspdiff.vqd","a");
for(i=0;i<m;i++)
fprintf(out,"%lf ",lsp[i]);
fprintf(out,"\n");
fclose(out);
}
}
#endif
_oggpack_write(&vb->opb,amp*327680,18);
......
......@@ -260,7 +260,7 @@ static void _prefetch_all_headers(OggVorbis_File *vf,vorbis_info *first,
vf->vi=calloc(vf->links,sizeof(vorbis_info));
vf->dataoffsets=malloc(vf->links*sizeof(long));
vf->pcmlengths=malloc(vf->links*sizeof(size64));
vf->pcmlengths=malloc(vf->links*sizeof(int64_t));
vf->serialnos=malloc(vf->links*sizeof(long));
for(i=0;i<vf->links;i++){
......@@ -400,7 +400,7 @@ static int _process_packet(OggVorbis_File *vf,int readp){
if(vf->decode_ready){
ogg_packet op;
int result=ogg_stream_packetout(&vf->os,&op);
size64 frameno;
int64_t frameno;
if(result==-1)return(-1); /* hole in the data. alert the toplevel */
if(result>0){
......@@ -590,7 +590,7 @@ long ov_bitrate(OggVorbis_File *vf,int i){
if(i>=vf->links)return(-1);
if(!vf->seekable && i!=0)return(ov_bitrate(vf,0));
if(i<0){
size64 bits;
int64_t bits;
int i;
for(i=0;i<vf->links;i++)
bits+=(vf->offsets[i+1]-vf->dataoffsets[i])*8;
......@@ -649,10 +649,10 @@ long ov_raw_total(OggVorbis_File *vf,int i){
PCM length (samples) of that logical bitstream for i==0 to n
-1 if the stream is not seekable (we can't know the length)
*/
size64 ov_pcm_total(OggVorbis_File *vf,int i){
int64_t ov_pcm_total(OggVorbis_File *vf,int i){
if(!vf->seekable || i>=vf->links)return(-1);
if(i<0){
size64 acc=0;
int64_t acc=0;
int i;
for(i=0;i<vf->links;i++)
acc+=ov_pcm_total(vf,i);
......@@ -744,9 +744,9 @@ int ov_raw_seek(OggVorbis_File *vf,long pos){
returns zero on success, nonzero on failure */
int ov_pcm_seek(OggVorbis_File *vf,size64 pos){
int ov_pcm_seek(OggVorbis_File *vf,int64_t pos){
int link=-1;
size64 total=ov_pcm_total(vf,-1);
int64_t total=ov_pcm_total(vf,-1);
if(!vf->seekable)return(-1); /* don't dump machine if we can't seek */
if(pos<0 || pos>total)goto seek_error;
......@@ -763,7 +763,7 @@ int ov_pcm_seek(OggVorbis_File *vf,size64 pos){
bitstream could make our task impossible. Account for that (it
would be an error condition) */
{
size64 target=pos-total;
int64_t target=pos-total;
long end=vf->offsets[link+1];
long begin=vf->offsets[link];
long best=begin;
......@@ -785,7 +785,7 @@ int ov_pcm_seek(OggVorbis_File *vf,size64 pos){
if(ret==-1){
end=bisect;
}else{
size64 frameno=ogg_page_frameno(&og);
int64_t frameno=ogg_page_frameno(&og);
if(frameno<target){
best=ret; /* raw offset of packet with frameno */
begin=vf->offset; /* raw offset of next packet */
......@@ -833,7 +833,7 @@ int ov_time_seek(OggVorbis_File *vf,double seconds){
/* translate time to PCM position and call ov_pcm_seek */
int link=-1;
size64 pcm_total=ov_pcm_total(vf,-1);
int64_t pcm_total=ov_pcm_total(vf,-1);
double time_total=ov_time_total(vf,-1);
if(!vf->seekable)return(-1); /* don't dump machine if we can't seek */
......@@ -848,7 +848,7 @@ int ov_time_seek(OggVorbis_File *vf,double seconds){
/* enough information to convert time offset to pcm offset */
{
size64 target=pcm_total+(seconds-time_total)*vf->vi[link].rate;
int64_t target=pcm_total+(seconds-time_total)*vf->vi[link].rate;
return(ov_pcm_seek(vf,target));
}
......@@ -865,7 +865,7 @@ long ov_raw_tell(OggVorbis_File *vf){
}
/* return PCM offset (sample) of next PCM sample to be read */
size64 ov_pcm_tell(OggVorbis_File *vf){
int64_t ov_pcm_tell(OggVorbis_File *vf){
return(vf->pcm_offset);
}
......@@ -874,7 +874,7 @@ double ov_time_tell(OggVorbis_File *vf){
/* translate time to PCM position and call ov_pcm_seek */
int link=-1;
size64 pcm_total=0;
int64_t pcm_total=0;
double time_total=0.;
if(vf->seekable){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment