2004-08-23 00:15:46 +00:00
|
|
|
#include "quakedef.h"
|
|
|
|
|
|
|
|
#ifdef AVAIL_OGGVORBIS
|
|
|
|
|
2006-07-08 22:45:07 +00:00
|
|
|
#ifdef __MORPHOS__
|
2007-06-20 00:02:54 +00:00
|
|
|
#include <exec/exec.h>
|
|
|
|
#include <libraries/vorbisfile.h>
|
2006-07-08 22:45:07 +00:00
|
|
|
|
2007-06-20 00:02:54 +00:00
|
|
|
#include <proto/exec.h>
|
|
|
|
#include <proto/vorbisfile.h>
|
2007-10-20 15:53:39 +00:00
|
|
|
#else
|
2007-06-20 00:02:54 +00:00
|
|
|
#include <vorbis/vorbisfile.h>
|
2006-07-08 22:45:07 +00:00
|
|
|
#endif
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2006-07-08 22:45:07 +00:00
|
|
|
#if defined(__MORPHOS__)
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2007-06-20 00:02:54 +00:00
|
|
|
#define oggvorbislibrary VorbisFileBase
|
|
|
|
struct Library *VorbisFileBase;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2006-07-08 22:45:07 +00:00
|
|
|
#elif defined(_WIN32)
|
2007-06-20 00:02:54 +00:00
|
|
|
#define WINDOWSDYNAMICLINK
|
2006-04-02 03:47:06 +00:00
|
|
|
|
2007-06-20 00:02:54 +00:00
|
|
|
#ifndef WIN32_LEAN_AND_MEAN
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#endif
|
|
|
|
#include <windows.h>
|
2006-04-02 03:47:06 +00:00
|
|
|
|
2007-06-20 00:02:54 +00:00
|
|
|
HINSTANCE oggvorbislibrary;
|
2005-04-18 03:21:16 +00:00
|
|
|
#else
|
2007-06-20 00:02:54 +00:00
|
|
|
#include <dlfcn.h>
|
|
|
|
void *oggvorbislibrary;
|
2004-08-23 00:15:46 +00:00
|
|
|
#endif
|
|
|
|
|
2006-07-08 22:45:07 +00:00
|
|
|
#ifdef __MORPHOS__
|
2007-06-20 00:02:54 +00:00
|
|
|
#define p_ov_open_callbacks(a, b, c, d, e) ov_open_callbacks(a, b, c, d, &e)
|
|
|
|
#define p_ov_clear ov_clear
|
|
|
|
#define p_ov_info ov_info
|
|
|
|
#define p_ov_comment ov_comment
|
|
|
|
#define p_ov_pcm_total ov_pcm_total
|
|
|
|
#define p_ov_read ov_read
|
2006-07-08 22:45:07 +00:00
|
|
|
#else
|
2007-06-20 00:02:54 +00:00
|
|
|
int (VARGS *p_ov_open_callbacks) (void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks);
|
|
|
|
int (VARGS *p_ov_clear)(OggVorbis_File *vf);
|
|
|
|
vorbis_info *(VARGS *p_ov_info)(OggVorbis_File *vf,int link);
|
|
|
|
vorbis_comment *(VARGS *p_ov_comment) (OggVorbis_File *vf,int link);
|
|
|
|
ogg_int64_t (VARGS *p_ov_pcm_total)(OggVorbis_File *vf,int i);
|
|
|
|
long (VARGS *p_ov_read)(OggVorbis_File *vf,char *buffer,int length,
|
|
|
|
int bigendianp,int word,int sgned,int *bitstream);
|
2006-07-08 22:45:07 +00:00
|
|
|
#endif
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
unsigned char *start; //file positions
|
|
|
|
unsigned long length;
|
|
|
|
unsigned long pos;
|
2005-03-29 15:01:57 +00:00
|
|
|
int srcspeed;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
qboolean failed;
|
|
|
|
|
|
|
|
sfxcache_t mediasc;
|
|
|
|
char *mediaaswavdata;
|
|
|
|
int mediaaswavpos;
|
|
|
|
int mediaaswavbuflen;
|
2008-05-11 14:38:19 +00:00
|
|
|
char *mediatemprecode;
|
|
|
|
int mediatemprecodelen;
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
OggVorbis_File vf;
|
|
|
|
|
|
|
|
sfx_t *s;
|
|
|
|
} ovdecoderbuffer_t;
|
|
|
|
|
|
|
|
int OV_DecodeSome(sfx_t *s, int minlength);
|
|
|
|
void OV_CancelDecoder(sfx_t *s);
|
2005-04-18 03:21:16 +00:00
|
|
|
qboolean OV_StartDecode(unsigned char *start, unsigned long length, ovdecoderbuffer_t *buffer);
|
2004-08-23 00:15:46 +00:00
|
|
|
|
|
|
|
qbyte *COM_LoadFile (char *path, int usehunk);
|
|
|
|
|
2005-11-30 01:20:53 +00:00
|
|
|
sfxcache_t *S_LoadOVSound (sfx_t *s, qbyte *data, int datalen, int sndspeed)
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
2006-01-27 08:12:14 +00:00
|
|
|
//char namebuffer[MAX_OSPATH]; //unreferenced
|
2004-08-23 00:15:46 +00:00
|
|
|
char *name;
|
|
|
|
ovdecoderbuffer_t *buffer;
|
2006-01-27 08:12:14 +00:00
|
|
|
//FILE *f; //unreferenced
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2006-01-27 08:12:14 +00:00
|
|
|
//qboolean telluser; //unreferenced
|
|
|
|
//int len; //unreferenced
|
2004-08-23 00:15:46 +00:00
|
|
|
|
2007-06-20 00:02:54 +00:00
|
|
|
if (datalen < 4 || strncmp(data, "OggS", 4))
|
|
|
|
return NULL;
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
name = s->name;
|
|
|
|
|
|
|
|
if (!s->decoder)
|
|
|
|
s->decoder = Z_Malloc(sizeof(ovdecoderbuffer_t) + sizeof(sfxdecode_t));
|
|
|
|
buffer = (ovdecoderbuffer_t*)(s->decoder+1);
|
|
|
|
|
|
|
|
buffer->mediaaswavpos=0;
|
|
|
|
buffer->mediasc.length=0;
|
|
|
|
buffer->s = s;
|
|
|
|
s->decoder->buf = buffer;
|
|
|
|
s->decoder->decodemore = OV_DecodeSome;
|
|
|
|
s->decoder->abort = OV_CancelDecoder;
|
|
|
|
|
2005-11-30 01:20:53 +00:00
|
|
|
if (!OV_StartDecode(data, datalen, buffer))
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
|
|
|
if (buffer->mediaaswavdata)
|
|
|
|
{
|
2005-03-29 15:01:57 +00:00
|
|
|
BZ_Free(buffer->mediaaswavdata);
|
2008-05-11 14:38:19 +00:00
|
|
|
buffer->mediaaswavdata = NULL;
|
|
|
|
}
|
|
|
|
if (buffer->mediatemprecode)
|
|
|
|
{
|
|
|
|
BZ_Free(buffer->mediatemprecode);
|
|
|
|
buffer->mediatemprecode = NULL;
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
Z_Free(s->decoder);
|
|
|
|
s->decoder=NULL;
|
2007-06-20 00:02:54 +00:00
|
|
|
s->failedload = true;
|
2004-08-23 00:15:46 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2004-11-17 18:10:46 +00:00
|
|
|
buffer->mediaaswavpos = sizeof(sfxcache_t);
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
s->decoder->decodemore(s, 100);
|
|
|
|
|
|
|
|
s->cache.fake=true;
|
|
|
|
return buffer->s->cache.data;
|
|
|
|
}
|
|
|
|
|
|
|
|
int OV_DecodeSome(sfx_t *s, int minlength)
|
|
|
|
{
|
2005-03-29 15:01:57 +00:00
|
|
|
extern int snd_speed;
|
2008-05-11 14:38:19 +00:00
|
|
|
extern cvar_t snd_linearresample_stream;
|
2006-07-08 22:45:07 +00:00
|
|
|
int bigendianp = bigendian;
|
2005-03-29 15:01:57 +00:00
|
|
|
int current_section = 0;
|
2004-11-17 18:10:46 +00:00
|
|
|
sfxcache_t *sc;
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
ovdecoderbuffer_t *dec = s->decoder->buf;
|
|
|
|
int bytesread;
|
2004-11-17 18:10:46 +00:00
|
|
|
|
2005-11-30 01:20:53 +00:00
|
|
|
// Con_Printf("Minlength = %03i ", minlength);
|
2005-05-26 12:55:34 +00:00
|
|
|
|
2007-06-20 00:02:54 +00:00
|
|
|
for (;;)
|
2004-11-17 18:10:46 +00:00
|
|
|
{
|
2007-06-20 00:02:54 +00:00
|
|
|
if (dec->mediaaswavbuflen < dec->mediaaswavpos+minlength+11050) //expand if needed.
|
|
|
|
{
|
|
|
|
// Con_Printf("Expand buffer\n");
|
|
|
|
dec->mediaaswavbuflen += minlength+22100;
|
|
|
|
dec->mediaaswavdata = BZ_Realloc(dec->mediaaswavdata, dec->mediaaswavbuflen);
|
|
|
|
s->cache.data = dec->mediaaswavdata;
|
|
|
|
s->cache.fake = true;
|
|
|
|
|
|
|
|
sc = s->cache.data;
|
|
|
|
sc->numchannels = dec->mediasc.numchannels;
|
|
|
|
sc->loopstart = -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
sc = s->cache.data;
|
2005-03-29 15:01:57 +00:00
|
|
|
|
2007-06-20 00:02:54 +00:00
|
|
|
if (minlength < sc->length)
|
|
|
|
{
|
|
|
|
// Con_Printf("No need for decode\n");
|
|
|
|
//done enough for now, don't whizz through the lot
|
|
|
|
return 0;
|
|
|
|
}
|
2004-11-17 18:10:46 +00:00
|
|
|
|
2008-05-11 14:38:19 +00:00
|
|
|
if (snd_speed == dec->srcspeed)
|
2005-05-26 12:55:34 +00:00
|
|
|
{
|
2008-05-11 14:38:19 +00:00
|
|
|
bytesread = p_ov_read(&dec->vf, dec->mediaaswavdata+dec->mediaaswavpos, dec->mediaaswavbuflen-dec->mediaaswavpos, bigendianp, 2, 1, ¤t_section);
|
|
|
|
if (bytesread <= 0)
|
2007-06-20 00:02:54 +00:00
|
|
|
{
|
2008-05-11 14:38:19 +00:00
|
|
|
if (bytesread != 0) //0==eof
|
|
|
|
{
|
|
|
|
Con_Printf("ogg decoding failed\n");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
2007-06-20 00:02:54 +00:00
|
|
|
}
|
2005-05-26 12:55:34 +00:00
|
|
|
}
|
2008-05-11 14:38:19 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
double scale = dec->srcspeed / (double)snd_speed;
|
|
|
|
int decodesize = ceil((dec->mediaaswavbuflen-dec->mediaaswavpos) * scale);
|
|
|
|
if (decodesize > dec->mediatemprecodelen)
|
2005-03-29 15:01:57 +00:00
|
|
|
{
|
2008-05-11 14:38:19 +00:00
|
|
|
dec->mediatemprecode = BZ_Realloc(dec->mediatemprecode, decodesize);
|
|
|
|
dec->mediatemprecodelen = decodesize;
|
2005-03-29 15:01:57 +00:00
|
|
|
}
|
2008-05-11 14:38:19 +00:00
|
|
|
|
|
|
|
bytesread = p_ov_read(&dec->vf, dec->mediatemprecode, decodesize, bigendianp, 2, 1, ¤t_section);
|
|
|
|
|
2008-11-09 22:29:28 +00:00
|
|
|
if (bytesread <= 0)
|
|
|
|
{
|
|
|
|
if (bytesread != 0) //0==eof
|
|
|
|
{
|
|
|
|
Con_Printf("ogg decoding failed\n");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-05-11 14:38:19 +00:00
|
|
|
SND_ResampleStream(dec->mediatemprecode,
|
|
|
|
dec->srcspeed,
|
|
|
|
2,
|
|
|
|
dec->mediasc.numchannels,
|
|
|
|
bytesread / (2 * dec->mediasc.numchannels),
|
|
|
|
dec->mediaaswavdata+dec->mediaaswavpos,
|
|
|
|
snd_speed,
|
|
|
|
2,
|
|
|
|
dec->mediasc.numchannels,
|
|
|
|
(int)snd_linearresample_stream.value);
|
|
|
|
|
|
|
|
bytesread = (int)floor(bytesread / scale) & ~0x1;
|
2005-03-29 15:01:57 +00:00
|
|
|
}
|
|
|
|
|
2004-11-17 18:10:46 +00:00
|
|
|
dec->mediaaswavpos += bytesread;
|
2008-05-11 14:38:19 +00:00
|
|
|
|
2006-01-28 06:41:20 +00:00
|
|
|
sc->length = (dec->mediaaswavpos-sizeof(sfxcache_t))/(2*(dec->mediasc.numchannels));
|
2005-03-29 15:01:57 +00:00
|
|
|
dec->mediasc.length = sc->length;
|
2004-11-17 18:10:46 +00:00
|
|
|
|
2005-03-29 15:01:57 +00:00
|
|
|
if (minlength<=sc->length)
|
2005-05-26 12:55:34 +00:00
|
|
|
{
|
2005-11-30 01:20:53 +00:00
|
|
|
// Con_Printf("Reached length\n");
|
2004-11-17 18:10:46 +00:00
|
|
|
return 1;
|
2005-05-26 12:55:34 +00:00
|
|
|
}
|
2004-11-17 18:10:46 +00:00
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
void OV_CancelDecoder(sfx_t *s)
|
|
|
|
{
|
2005-03-29 15:01:57 +00:00
|
|
|
sfxcache_t *src, *dest;
|
|
|
|
ovdecoderbuffer_t *dec;
|
|
|
|
|
|
|
|
dec = s->decoder->buf;
|
|
|
|
p_ov_clear (&dec->vf); //close the decoder
|
|
|
|
|
|
|
|
//copy to new buffer
|
|
|
|
|
|
|
|
src = s->cache.data;
|
|
|
|
s->cache.fake = false;
|
|
|
|
s->cache.data = NULL;
|
|
|
|
dest = Cache_Alloc(&s->cache, dec->mediaaswavpos, s->name);
|
|
|
|
memcpy(dest, src, dec->mediaaswavpos);
|
|
|
|
BZ_Free(src);
|
|
|
|
|
2008-05-11 14:38:19 +00:00
|
|
|
if (dec->mediatemprecode)
|
|
|
|
{
|
|
|
|
BZ_Free(dec->mediatemprecode);
|
|
|
|
dec->mediatemprecode = NULL;
|
|
|
|
}
|
|
|
|
|
2005-03-29 15:01:57 +00:00
|
|
|
Z_Free(s->decoder);
|
|
|
|
s->decoder = NULL;
|
|
|
|
|
|
|
|
//and it's now indistinguisable from a wav
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static size_t read_func (void *ptr, size_t size, size_t nmemb, void *datasource)
|
|
|
|
{
|
|
|
|
ovdecoderbuffer_t *buffer = datasource;
|
|
|
|
int spare = buffer->length - buffer->pos;
|
|
|
|
|
|
|
|
if (size*nmemb > spare)
|
|
|
|
nmemb = spare / size;
|
|
|
|
memcpy(ptr, &buffer->start[buffer->pos], size*nmemb);
|
|
|
|
buffer->pos += size*nmemb;
|
|
|
|
return nmemb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int seek_func (void *datasource, ogg_int64_t offset, int whence)
|
|
|
|
{
|
|
|
|
ovdecoderbuffer_t *buffer = datasource;
|
|
|
|
switch(whence)
|
|
|
|
{
|
|
|
|
case SEEK_SET:
|
|
|
|
buffer->pos = offset;
|
|
|
|
break;
|
|
|
|
case SEEK_END:
|
|
|
|
buffer->pos = buffer->length+offset;
|
|
|
|
break;
|
|
|
|
case SEEK_CUR:
|
|
|
|
buffer->pos+=offset;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int close_func (void *datasource)
|
|
|
|
{
|
|
|
|
ovdecoderbuffer_t *buffer = datasource;
|
2005-03-29 15:01:57 +00:00
|
|
|
BZ_Free(buffer->start);
|
2004-08-23 00:15:46 +00:00
|
|
|
buffer->start=0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static long tell_func (void *datasource)
|
|
|
|
{
|
|
|
|
ovdecoderbuffer_t *buffer = datasource;
|
|
|
|
return buffer->pos;
|
|
|
|
}
|
|
|
|
static ov_callbacks callbacks = {
|
|
|
|
read_func,
|
|
|
|
seek_func,
|
|
|
|
close_func,
|
|
|
|
tell_func,
|
|
|
|
};
|
|
|
|
qboolean OV_StartDecode(unsigned char *start, unsigned long length, ovdecoderbuffer_t *buffer)
|
|
|
|
{
|
2005-04-16 16:21:27 +00:00
|
|
|
static qboolean tried;
|
|
|
|
if (!oggvorbislibrary && !tried)
|
2006-07-08 22:45:07 +00:00
|
|
|
#if defined(__MORPHOS__)
|
|
|
|
{
|
|
|
|
VorbisFileBase = OpenLibrary("vorbisfile.library", 2);
|
|
|
|
if (!VorbisFileBase)
|
|
|
|
{
|
|
|
|
Con_Printf("Unable to open vorbisfile.library version 2\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#elif defined(WINDOWSDYNAMICLINK)
|
2004-08-23 00:15:46 +00:00
|
|
|
{
|
|
|
|
oggvorbislibrary = LoadLibrary("vorbisfile.dll");
|
2007-06-20 00:02:54 +00:00
|
|
|
if (!oggvorbislibrary)
|
|
|
|
oggvorbislibrary = LoadLibrary("libvorbisfile.dll");
|
2004-08-23 00:15:46 +00:00
|
|
|
if (!oggvorbislibrary)
|
|
|
|
{
|
|
|
|
Con_Printf("Couldn't load DLL: \"vorbisfile.dll\".\n");
|
|
|
|
}
|
2006-07-08 22:45:07 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
p_ov_open_callbacks = (void *)GetProcAddress(oggvorbislibrary, "ov_open_callbacks");
|
|
|
|
p_ov_comment = (void *)GetProcAddress(oggvorbislibrary, "ov_comment");
|
|
|
|
p_ov_pcm_total = (void *)GetProcAddress(oggvorbislibrary, "ov_pcm_total");
|
|
|
|
p_ov_clear = (void *)GetProcAddress(oggvorbislibrary, "ov_clear");
|
|
|
|
p_ov_info = (void *)GetProcAddress(oggvorbislibrary, "ov_info");
|
|
|
|
p_ov_read = (void *)GetProcAddress(oggvorbislibrary, "ov_read");
|
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
#else
|
2005-04-18 03:21:16 +00:00
|
|
|
{
|
|
|
|
oggvorbislibrary = dlopen("libvorbisfile.so", RTLD_LOCAL | RTLD_LAZY);
|
|
|
|
if (!oggvorbislibrary)
|
|
|
|
{
|
2006-07-08 22:45:07 +00:00
|
|
|
Con_Printf("Couldn't load SO: \"libvorbisfile.so\".\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
p_ov_open_callbacks = (void *)dlsym(oggvorbislibrary, "ov_open_callbacks");
|
|
|
|
p_ov_comment = (void *)dlsym(oggvorbislibrary, "ov_comment");
|
|
|
|
p_ov_pcm_total = (void *)dlsym(oggvorbislibrary, "ov_pcm_total");
|
|
|
|
p_ov_clear = (void *)dlsym(oggvorbislibrary, "ov_clear");
|
|
|
|
p_ov_info = (void *)dlsym(oggvorbislibrary, "ov_info");
|
|
|
|
p_ov_read = (void *)dlsym(oggvorbislibrary, "ov_read");
|
2005-04-18 03:21:16 +00:00
|
|
|
}
|
|
|
|
}
|
2004-08-23 00:15:46 +00:00
|
|
|
#endif
|
|
|
|
|
2006-07-08 22:45:07 +00:00
|
|
|
tried = true;
|
|
|
|
|
2006-03-12 05:23:18 +00:00
|
|
|
if (!oggvorbislibrary)
|
2007-06-20 00:02:54 +00:00
|
|
|
{
|
|
|
|
Con_Printf("ogg vorbis library is not loaded.\n");
|
2006-03-12 05:23:18 +00:00
|
|
|
return false;
|
2007-06-20 00:02:54 +00:00
|
|
|
}
|
2006-03-12 05:23:18 +00:00
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
buffer->start = start;
|
|
|
|
buffer->length = length;
|
|
|
|
buffer->pos = 0;
|
|
|
|
if (p_ov_open_callbacks(buffer, &buffer->vf, NULL, 0, callbacks))
|
|
|
|
{
|
2007-06-20 00:02:54 +00:00
|
|
|
Con_Printf("Input does not appear to be an Ogg bitstream.\n");
|
2004-08-23 00:15:46 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2005-03-29 15:01:57 +00:00
|
|
|
/* Print the comments plus a few lines about the bitstream we're
|
2004-08-23 00:15:46 +00:00
|
|
|
decoding */
|
|
|
|
{
|
2005-04-16 16:21:27 +00:00
|
|
|
// char **ptr=p_ov_comment(&buffer->vf,-1)->user_comments;
|
2004-08-23 00:15:46 +00:00
|
|
|
vorbis_info *vi=p_ov_info(&buffer->vf,-1);
|
2005-03-29 15:01:57 +00:00
|
|
|
|
|
|
|
if (vi->channels < 1 || vi->channels > 2)
|
|
|
|
{
|
|
|
|
p_ov_clear (&buffer->vf);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2006-01-28 06:41:20 +00:00
|
|
|
buffer->mediasc.numchannels = vi->channels;
|
2005-03-29 15:01:57 +00:00
|
|
|
buffer->mediasc.loopstart = -1;
|
|
|
|
buffer->srcspeed = vi->rate;
|
2005-04-16 16:21:27 +00:00
|
|
|
/*
|
2004-08-23 00:15:46 +00:00
|
|
|
while(*ptr){
|
|
|
|
Con_Printf("%s\n",*ptr);
|
2005-04-16 16:21:27 +00:00
|
|
|
ptr++;
|
2004-08-23 00:15:46 +00:00
|
|
|
}
|
|
|
|
Con_Printf("\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
|
|
|
|
Con_Printf("\nDecoded length: %ld samples\n",
|
|
|
|
(long)p_ov_pcm_total(&buffer->vf,-1));
|
|
|
|
Con_Printf("Encoded by: %s\n\n",p_ov_comment(&buffer->vf,-1)->vendor);
|
2005-04-16 16:21:27 +00:00
|
|
|
*/ }
|
2008-05-11 14:38:19 +00:00
|
|
|
buffer->mediatemprecode = NULL;
|
|
|
|
buffer->mediatemprecodelen = 0;
|
2005-11-30 01:20:53 +00:00
|
|
|
|
|
|
|
buffer->start = BZ_Malloc(length);
|
|
|
|
memcpy(buffer->start, start, length);
|
|
|
|
|
2004-08-23 00:15:46 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|