********************************************************************
function: stdio-based convenience library for opening/seeking/decoding
- last mod: $Id$
********************************************************************/
long (*tell_func) (void *datasource);
} ov_callbacks;
+#ifndef OV_EXCLUDE_STATIC_CALLBACKS
+
/* a few sets of convenient callbacks, especially for use under
* Windows where ov_open_callbacks() should always be used instead of
- * ov_open() to avoid problems with incompatable crt.o version linking
+ * ov_open() to avoid problems with incompatible crt.o version linking
* issues. */
static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){
if(f==NULL)return(-1);
+
+#ifdef __MINGW32__
+ return fseeko64(f,off,whence);
+#elif defined (_WIN32)
+ return _fseeki64(f,off,whence);
+#else
return fseek(f,off,whence);
+#endif
}
-/* These structs below (OV_CALLBACKS_DEFAULT etc)are defined here as static
- * data. That means that every file which includes this header will get its
- * own copy of these structs whether it uses them or not.
- *
- * It would be *much* better to move these the vorbisfile.c, make them
- * publicly available and then define them here as externs so that
- * only one copy of them (the one in the library's vorbisfile.c) is ever
- * created.
- *
- * Unfortunately this cannot be done at the moment because doing so would
- * break the libvorbisfile ABI. A good time to do that would be at some
- * other time when the ABI is being broken for some other reason. */
+/* These structs below (OV_CALLBACKS_DEFAULT etc) are defined here as
+ * static data. That means that every file which includes this header
+ * will get its own copy of these structs whether it uses them or
+ * not unless it #defines OV_EXCLUDE_STATIC_CALLBACKS.
+ * These static symbols are essential on platforms such as Windows on
+ * which several different versions of stdio support may be linked to
+ * by different DLLs, and we need to be certain we know which one
+ * we're using (the same one as the main application).
+ */
static ov_callbacks OV_CALLBACKS_DEFAULT = {
(size_t (*)(void *, size_t, size_t, void *)) fread,
(long (*)(void *)) NULL
};
+#endif
+
#define NOTOPEN 0
#define PARTOPEN 1
#define OPENED 2
ogg_int64_t *dataoffsets;
long *serialnos;
ogg_int64_t *pcmlengths; /* overloaded to maintain binary
- compatability; x2 size, stores both
- beginning and end values */
+ compatibility; x2 size, stores both
+ beginning and end values */
vorbis_info *vi;
vorbis_comment *vc;
extern int ov_clear(OggVorbis_File *vf);
-extern int ov_fopen(char *path,OggVorbis_File *vf);
-extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
+extern int ov_fopen(const char *path,OggVorbis_File *vf);
+extern int ov_open(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
- char *initial, long ibytes, ov_callbacks callbacks);
+ const char *initial, long ibytes, ov_callbacks callbacks);
-extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
+extern int ov_test(FILE *f,OggVorbis_File *vf,const char *initial,long ibytes);
extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
- char *initial, long ibytes, ov_callbacks callbacks);
+ const char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test_open(OggVorbis_File *vf);
extern long ov_bitrate(OggVorbis_File *vf,int i);
extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples,
- int *bitstream);
+ int *bitstream);
+extern 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);
extern long ov_read(OggVorbis_File *vf,char *buffer,int length,
- int bigendianp,int word,int sgned,int *bitstream);
+ int bigendianp,int word,int sgned,int *bitstream);
extern int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);
extern int ov_halfrate(OggVorbis_File *vf,int flag);
#endif
-