提交 84e012c0 authored 作者: Anthony Minessale's avatar Anthony Minessale

stick a fork in it.... needs testing and tweaks but can now read and write to…

stick a fork in it.... needs testing and tweaks but can now read and write to icecast via shout:// and or .mp3 files the traditional way

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4597 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 504798a6
......@@ -13,7 +13,7 @@ void InitMP3Constants(void)
}
BOOL InitMP3(struct mpstr *mp, long outscale)
BOOL InitMP3(struct mpstr *mp, long outscale, int samplerate)
{
/* quiet 4096 med 8192 */
......@@ -26,7 +26,7 @@ BOOL InitMP3(struct mpstr *mp, long outscale)
mp->fr.single = 3; /* force mono */
mp->bsnum = 0;
mp->synth_bo = 1;
mp->outsamplerate = 8000;
mp->outsamplerate = samplerate;
make_decode_tables_scale(mp, outscale);
......@@ -190,7 +190,7 @@ int decodeMP3(struct mpstr *mp,char *in,int isize,char *out,
if(osize < 4608) {
debug_printf("%d To less out space\n", __LINE__);
return MP3_ERR;
return MP3_TOOSMALL;
}
if(in) {
......
#ifndef DEBUG_MP3
#ifdef DEBUG_MP3
#define debug_printf(fmt,...) printf(fmt, ##__VA_ARGS__);
#else
#define debug_printf;
#define debug_printf(fmt,...)
#endif
struct buf {
......@@ -47,10 +47,10 @@ struct mpstr {
#define MP3_ERR -1
#define MP3_OK 0
#define MP3_NEED_MORE 1
#define MP3_TOOSMALL 2
void InitMP3Constants(void);
BOOL InitMP3(struct mpstr *mp, long outscale);
BOOL InitMP3(struct mpstr *mp, long outscale, int samplerate);
int decodeMP3(struct mpstr *mp,char *inmemory,int inmemsize,
char *outmemory,int outmemsize,int *done);
void ExitMP3(struct mpstr *mp);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论