Commit 6f013cd9 authored by Eric Wong's avatar Eric Wong

inputPlugins/*_plugin.c: static-fication

Nothing here is ever exported for linkage besides the InputPlugin structure, so mark them static to save a few bytes. git-svn-id: https://svn.musicpd.org/mpd/trunk@4382 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 5f508702
...@@ -44,7 +44,7 @@ typedef struct { ...@@ -44,7 +44,7 @@ typedef struct {
int atEof; int atEof;
} AacBuffer; } AacBuffer;
void fillAacBuffer(AacBuffer *b) { static void fillAacBuffer(AacBuffer *b) {
if(b->bytesConsumed > 0) { if(b->bytesConsumed > 0) {
int bread; int bread;
...@@ -79,7 +79,7 @@ void fillAacBuffer(AacBuffer *b) { ...@@ -79,7 +79,7 @@ void fillAacBuffer(AacBuffer *b) {
} }
} }
void advanceAacBuffer(AacBuffer * b, int bytes) { static void advanceAacBuffer(AacBuffer * b, int bytes) {
b->fileOffset+=bytes; b->fileOffset+=bytes;
b->bytesConsumed = bytes; b->bytesConsumed = bytes;
b->bytesIntoBuffer-=bytes; b->bytesIntoBuffer-=bytes;
...@@ -88,7 +88,7 @@ void advanceAacBuffer(AacBuffer * b, int bytes) { ...@@ -88,7 +88,7 @@ void advanceAacBuffer(AacBuffer * b, int bytes) {
static int adtsSampleRates[] = {96000,88200,64000,48000,44100,32000,24000,22050, static int adtsSampleRates[] = {96000,88200,64000,48000,44100,32000,24000,22050,
16000,12000,11025,8000,7350,0,0,0}; 16000,12000,11025,8000,7350,0,0,0};
int adtsParse(AacBuffer * b, float * length) { static int adtsParse(AacBuffer * b, float * length) {
int frames, frameLength; int frames, frameLength;
int tFrameLength = 0; int tFrameLength = 0;
int sampleRate = 0; int sampleRate = 0;
...@@ -134,7 +134,7 @@ int adtsParse(AacBuffer * b, float * length) { ...@@ -134,7 +134,7 @@ int adtsParse(AacBuffer * b, float * length) {
return 1; return 1;
} }
void initAacBuffer(InputStream * inStream, AacBuffer * b, float * length, static void initAacBuffer(InputStream * inStream, AacBuffer * b, float * length,
size_t * retFileread, size_t * retTagsize) size_t * retFileread, size_t * retTagsize)
{ {
size_t fileread; size_t fileread;
...@@ -200,7 +200,7 @@ void initAacBuffer(InputStream * inStream, AacBuffer * b, float * length, ...@@ -200,7 +200,7 @@ void initAacBuffer(InputStream * inStream, AacBuffer * b, float * length,
} }
} }
float getAacFloatTotalTime(char * file) { static float getAacFloatTotalTime(char * file) {
AacBuffer b; AacBuffer b;
float length; float length;
size_t fileread, tagsize; size_t fileread, tagsize;
...@@ -240,7 +240,7 @@ float getAacFloatTotalTime(char * file) { ...@@ -240,7 +240,7 @@ float getAacFloatTotalTime(char * file) {
return length; return length;
} }
int getAacTotalTime(char * file) { static int getAacTotalTime(char * file) {
int time = -1; int time = -1;
float length; float length;
...@@ -250,7 +250,7 @@ int getAacTotalTime(char * file) { ...@@ -250,7 +250,7 @@ int getAacTotalTime(char * file) {
} }
int aac_decode(OutputBuffer * cb, DecoderControl * dc, char * path) { static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
float time; float time;
float totalTime; float totalTime;
faacDecHandle decoder; faacDecHandle decoder;
...@@ -395,7 +395,7 @@ int aac_decode(OutputBuffer * cb, DecoderControl * dc, char * path) { ...@@ -395,7 +395,7 @@ int aac_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
return 0; return 0;
} }
MpdTag * aacTagDup(char * file) { static MpdTag * aacTagDup(char * file) {
MpdTag * ret = NULL; MpdTag * ret = NULL;
int time; int time;
...@@ -412,7 +412,7 @@ MpdTag * aacTagDup(char * file) { ...@@ -412,7 +412,7 @@ MpdTag * aacTagDup(char * file) {
return ret; return ret;
} }
char * aacSuffixes[] = {"aac", NULL}; static char * aacSuffixes[] = {"aac", NULL};
InputPlugin aacPlugin = InputPlugin aacPlugin =
{ {
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <unistd.h> #include <unistd.h>
#include <audiofile.h> #include <audiofile.h>
int getAudiofileTotalTime(char * file) static int getAudiofileTotalTime(char * file)
{ {
int time; int time;
AFfilehandle af_fp = afOpenFile(file, "r", NULL); AFfilehandle af_fp = afOpenFile(file, "r", NULL);
...@@ -51,7 +51,7 @@ int getAudiofileTotalTime(char * file) ...@@ -51,7 +51,7 @@ int getAudiofileTotalTime(char * file)
return time; return time;
} }
int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char * path) { static int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
int fs, frame_count; int fs, frame_count;
AFfilehandle af_fp; AFfilehandle af_fp;
int bits; int bits;
...@@ -140,7 +140,7 @@ int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char * path) { ...@@ -140,7 +140,7 @@ int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
return 0; return 0;
} }
MpdTag * audiofileTagDup(char * file) { static MpdTag * audiofileTagDup(char * file) {
MpdTag * ret = NULL; MpdTag * ret = NULL;
int time = getAudiofileTotalTime(file); int time = getAudiofileTotalTime(file);
...@@ -155,7 +155,7 @@ MpdTag * audiofileTagDup(char * file) { ...@@ -155,7 +155,7 @@ MpdTag * audiofileTagDup(char * file) {
return ret; return ret;
} }
char * audiofileSuffixes[] = {"wav", "au", "aiff", "aif", NULL}; static char * audiofileSuffixes[] = {"wav", "au", "aiff", "aif", NULL};
InputPlugin audiofilePlugin = InputPlugin audiofilePlugin =
{ {
......
...@@ -38,25 +38,25 @@ ...@@ -38,25 +38,25 @@
/* this code is based on flac123, from flac-tools */ /* this code is based on flac123, from flac-tools */
void flacError(const FLAC__SeekableStreamDecoder *, static void flacError(const FLAC__SeekableStreamDecoder *,
FLAC__StreamDecoderErrorStatus, void *); FLAC__StreamDecoderErrorStatus, void *);
void flacPrintErroredState(FLAC__SeekableStreamDecoderState state); static void flacPrintErroredState(FLAC__SeekableStreamDecoderState state);
void flacMetadata(const FLAC__SeekableStreamDecoder *, static void flacMetadata(const FLAC__SeekableStreamDecoder *,
const FLAC__StreamMetadata *, void *); const FLAC__StreamMetadata *, void *);
FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__SeekableStreamDecoder *, static FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__SeekableStreamDecoder *,
const FLAC__Frame *, const FLAC__int32 * const buf[], void *); const FLAC__Frame *, const FLAC__int32 * const buf[], void *);
FLAC__SeekableStreamDecoderReadStatus flacRead( static FLAC__SeekableStreamDecoderReadStatus flacRead(
const FLAC__SeekableStreamDecoder *, FLAC__byte buf[], const FLAC__SeekableStreamDecoder *, FLAC__byte buf[],
unsigned *, void *); unsigned *, void *);
FLAC__SeekableStreamDecoderSeekStatus flacSeek( static FLAC__SeekableStreamDecoderSeekStatus flacSeek(
const FLAC__SeekableStreamDecoder *, FLAC__uint64, void *); const FLAC__SeekableStreamDecoder *, FLAC__uint64, void *);
FLAC__SeekableStreamDecoderTellStatus flacTell( static FLAC__SeekableStreamDecoderTellStatus flacTell(
const FLAC__SeekableStreamDecoder *, FLAC__uint64 *, void *); const FLAC__SeekableStreamDecoder *, FLAC__uint64 *, void *);
FLAC__SeekableStreamDecoderLengthStatus flacLength( static FLAC__SeekableStreamDecoderLengthStatus flacLength(
const FLAC__SeekableStreamDecoder *, FLAC__uint64 *, void *); const FLAC__SeekableStreamDecoder *, FLAC__uint64 *, void *);
FLAC__bool flacEOF(const FLAC__SeekableStreamDecoder *, void *); static FLAC__bool flacEOF(const FLAC__SeekableStreamDecoder *, void *);
int flac_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) static int flac_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream)
{ {
FLAC__SeekableStreamDecoder * flacDec = NULL; FLAC__SeekableStreamDecoder * flacDec = NULL;
FlacData data; FlacData data;
...@@ -170,7 +170,7 @@ fail: ...@@ -170,7 +170,7 @@ fail:
return ret; return ret;
} }
FLAC__SeekableStreamDecoderReadStatus flacRead( static FLAC__SeekableStreamDecoderReadStatus flacRead(
const FLAC__SeekableStreamDecoder * flacDec, FLAC__byte buf[], const FLAC__SeekableStreamDecoder * flacDec, FLAC__byte buf[],
unsigned * bytes, void * fdata) { unsigned * bytes, void * fdata) {
FlacData * data = (FlacData *) fdata; FlacData * data = (FlacData *) fdata;
...@@ -192,7 +192,7 @@ FLAC__SeekableStreamDecoderReadStatus flacRead( ...@@ -192,7 +192,7 @@ FLAC__SeekableStreamDecoderReadStatus flacRead(
return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK; return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
} }
FLAC__SeekableStreamDecoderSeekStatus flacSeek( static FLAC__SeekableStreamDecoderSeekStatus flacSeek(
const FLAC__SeekableStreamDecoder * flacDec, const FLAC__SeekableStreamDecoder * flacDec,
FLAC__uint64 offset, void * fdata) FLAC__uint64 offset, void * fdata)
{ {
...@@ -205,7 +205,7 @@ FLAC__SeekableStreamDecoderSeekStatus flacSeek( ...@@ -205,7 +205,7 @@ FLAC__SeekableStreamDecoderSeekStatus flacSeek(
return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK; return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
} }
FLAC__SeekableStreamDecoderTellStatus flacTell( static FLAC__SeekableStreamDecoderTellStatus flacTell(
const FLAC__SeekableStreamDecoder * flacDec, const FLAC__SeekableStreamDecoder * flacDec,
FLAC__uint64 * offset, void * fdata) FLAC__uint64 * offset, void * fdata)
{ {
...@@ -216,7 +216,7 @@ FLAC__SeekableStreamDecoderTellStatus flacTell( ...@@ -216,7 +216,7 @@ FLAC__SeekableStreamDecoderTellStatus flacTell(
return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK; return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
} }
FLAC__SeekableStreamDecoderLengthStatus flacLength( static FLAC__SeekableStreamDecoderLengthStatus flacLength(
const FLAC__SeekableStreamDecoder * flacDec, const FLAC__SeekableStreamDecoder * flacDec,
FLAC__uint64 * length, void * fdata) FLAC__uint64 * length, void * fdata)
{ {
...@@ -227,7 +227,7 @@ FLAC__SeekableStreamDecoderLengthStatus flacLength( ...@@ -227,7 +227,7 @@ FLAC__SeekableStreamDecoderLengthStatus flacLength(
return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK; return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
} }
FLAC__bool flacEOF(const FLAC__SeekableStreamDecoder * flacDec, void * fdata) { static FLAC__bool flacEOF(const FLAC__SeekableStreamDecoder * flacDec, void * fdata) {
FlacData * data = (FlacData *) fdata; FlacData * data = (FlacData *) fdata;
if (inputStreamAtEOF(data->inStream) == 1) if (inputStreamAtEOF(data->inStream) == 1)
...@@ -235,13 +235,13 @@ FLAC__bool flacEOF(const FLAC__SeekableStreamDecoder * flacDec, void * fdata) { ...@@ -235,13 +235,13 @@ FLAC__bool flacEOF(const FLAC__SeekableStreamDecoder * flacDec, void * fdata) {
return false; return false;
} }
void flacError(const FLAC__SeekableStreamDecoder *dec, static void flacError(const FLAC__SeekableStreamDecoder *dec,
FLAC__StreamDecoderErrorStatus status, void *fdata) FLAC__StreamDecoderErrorStatus status, void *fdata)
{ {
flac_error_common_cb("flac",status,(FlacData *) fdata); flac_error_common_cb("flac",status,(FlacData *) fdata);
} }
void flacPrintErroredState(FLAC__SeekableStreamDecoderState state) static void flacPrintErroredState(FLAC__SeekableStreamDecoderState state)
{ {
switch(state) { switch(state) {
case FLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR: case FLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR:
...@@ -272,13 +272,13 @@ void flacPrintErroredState(FLAC__SeekableStreamDecoderState state) ...@@ -272,13 +272,13 @@ void flacPrintErroredState(FLAC__SeekableStreamDecoderState state)
} }
} }
void flacMetadata(const FLAC__SeekableStreamDecoder *dec, static void flacMetadata(const FLAC__SeekableStreamDecoder *dec,
const FLAC__StreamMetadata *block, void *vdata) const FLAC__StreamMetadata *block, void *vdata)
{ {
flac_metadata_common_cb(block, (FlacData *)vdata); flac_metadata_common_cb(block, (FlacData *)vdata);
} }
FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__SeekableStreamDecoder *dec, static FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__SeekableStreamDecoder *dec,
const FLAC__Frame *frame, const FLAC__int32 * const buf[], const FLAC__Frame *frame, const FLAC__int32 * const buf[],
void * vdata) void * vdata)
{ {
...@@ -324,7 +324,7 @@ FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__SeekableStreamDecoder *dec, ...@@ -324,7 +324,7 @@ FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__SeekableStreamDecoder *dec,
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
} }
MpdTag * flacMetadataDup(char * file, int * vorbisCommentFound) { static MpdTag * flacMetadataDup(char * file, int * vorbisCommentFound) {
MpdTag * ret = NULL; MpdTag * ret = NULL;
FLAC__Metadata_SimpleIterator * it; FLAC__Metadata_SimpleIterator * it;
FLAC__StreamMetadata * block = NULL; FLAC__StreamMetadata * block = NULL;
...@@ -372,7 +372,7 @@ MpdTag * flacMetadataDup(char * file, int * vorbisCommentFound) { ...@@ -372,7 +372,7 @@ MpdTag * flacMetadataDup(char * file, int * vorbisCommentFound) {
return ret; return ret;
} }
MpdTag * flacTagDup(char * file) { static MpdTag * flacTagDup(char * file) {
MpdTag * ret = NULL; MpdTag * ret = NULL;
int foundVorbisComment = 0; int foundVorbisComment = 0;
...@@ -393,8 +393,8 @@ MpdTag * flacTagDup(char * file) { ...@@ -393,8 +393,8 @@ MpdTag * flacTagDup(char * file) {
return ret; return ret;
} }
char * flacSuffixes[] = {"flac", NULL}; static char * flacSuffixes[] = {"flac", NULL};
char * flac_mime_types[] = {"application/x-flac", NULL}; static char * flac_mime_types[] = {"application/x-flac", NULL};
InputPlugin flacPlugin = InputPlugin flacPlugin =
{ {
......
...@@ -54,7 +54,7 @@ static BOOL mod_mpd_IsThere(void) { ...@@ -54,7 +54,7 @@ static BOOL mod_mpd_IsThere(void) {
return 1; return 1;
} }
MDRIVER drv_mpd = static MDRIVER drv_mpd =
{ {
NULL, NULL,
"MPD", "MPD",
...@@ -120,7 +120,7 @@ static int mod_initMikMod(void) { ...@@ -120,7 +120,7 @@ static int mod_initMikMod(void) {
return 0; return 0;
} }
void mod_finishMikMod(void) { static void mod_finishMikMod(void) {
MikMod_Exit(); MikMod_Exit();
} }
...@@ -152,7 +152,7 @@ static void mod_close(mod_Data * data) { ...@@ -152,7 +152,7 @@ static void mod_close(mod_Data * data) {
free(data); free(data);
} }
int mod_decode(OutputBuffer * cb, DecoderControl * dc, char * path) { static int mod_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
mod_Data * data; mod_Data * data;
float time = 0.0; float time = 0.0;
int ret; int ret;
...@@ -207,7 +207,7 @@ int mod_decode(OutputBuffer * cb, DecoderControl * dc, char * path) { ...@@ -207,7 +207,7 @@ int mod_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
return 0; return 0;
} }
MpdTag * modTagDup(char * file) { static MpdTag * modTagDup(char * file) {
MpdTag * ret = NULL; MpdTag * ret = NULL;
MODULE * moduleHandle; MODULE * moduleHandle;
char * title; char * title;
...@@ -236,7 +236,7 @@ MpdTag * modTagDup(char * file) { ...@@ -236,7 +236,7 @@ MpdTag * modTagDup(char * file) {
return ret; return ret;
} }
char * modSuffixes[] = {"amf", static char * modSuffixes[] = {"amf",
"dsm", "dsm",
"far", "far",
"gdm", "gdm",
......
...@@ -58,11 +58,11 @@ struct audio_dither { ...@@ -58,11 +58,11 @@ struct audio_dither {
mad_fixed_t random; mad_fixed_t random;
}; };
unsigned long prng(unsigned long state) { static unsigned long prng(unsigned long state) {
return (state * 0x0019660dL + 0x3c6ef35fL) & 0xffffffffL; return (state * 0x0019660dL + 0x3c6ef35fL) & 0xffffffffL;
} }
signed long audio_linear_dither(unsigned int bits, mad_fixed_t sample, struct audio_dither *dither) { static signed long audio_linear_dither(unsigned int bits, mad_fixed_t sample, struct audio_dither *dither) {
unsigned int scalebits; unsigned int scalebits;
mad_fixed_t output, mask, random; mad_fixed_t output, mask, random;
...@@ -134,7 +134,7 @@ typedef struct _mp3DecodeData { ...@@ -134,7 +134,7 @@ typedef struct _mp3DecodeData {
struct audio_dither dither; struct audio_dither dither;
} mp3DecodeData; } mp3DecodeData;
void initMp3DecodeData(mp3DecodeData * data, InputStream * inStream) { static void initMp3DecodeData(mp3DecodeData * data, InputStream * inStream) {
data->outputPtr = data->outputBuffer; data->outputPtr = data->outputBuffer;
data->outputBufferEnd = data->outputBuffer+MP3_DATA_OUTPUT_BUFFER_SIZE; data->outputBufferEnd = data->outputBuffer+MP3_DATA_OUTPUT_BUFFER_SIZE;
data->muteFrame = 0; data->muteFrame = 0;
...@@ -154,7 +154,7 @@ void initMp3DecodeData(mp3DecodeData * data, InputStream * inStream) { ...@@ -154,7 +154,7 @@ void initMp3DecodeData(mp3DecodeData * data, InputStream * inStream) {
mad_timer_reset(&data->timer); mad_timer_reset(&data->timer);
} }
int seekMp3InputBuffer(mp3DecodeData * data, long offset) { static int seekMp3InputBuffer(mp3DecodeData * data, long offset) {
if(seekInputStream(data->inStream,offset,SEEK_SET) < 0) { if(seekInputStream(data->inStream,offset,SEEK_SET) < 0) {
return -1; return -1;
} }
...@@ -165,7 +165,7 @@ int seekMp3InputBuffer(mp3DecodeData * data, long offset) { ...@@ -165,7 +165,7 @@ int seekMp3InputBuffer(mp3DecodeData * data, long offset) {
return 0; return 0;
} }
int fillMp3InputBuffer(mp3DecodeData * data) { static int fillMp3InputBuffer(mp3DecodeData * data) {
size_t readSize; size_t readSize;
size_t remaining; size_t remaining;
size_t readed; size_t readed;
...@@ -314,7 +314,7 @@ fail: ...@@ -314,7 +314,7 @@ fail:
} }
#endif #endif
int decodeNextFrameHeader(mp3DecodeData * data, MpdTag ** tag, ReplayGainInfo ** replayGainInfo) { static int decodeNextFrameHeader(mp3DecodeData * data, MpdTag ** tag, ReplayGainInfo ** replayGainInfo) {
if((data->stream).buffer==NULL || (data->stream).error==MAD_ERROR_BUFLEN) { if((data->stream).buffer==NULL || (data->stream).error==MAD_ERROR_BUFLEN) {
if(fillMp3InputBuffer(data) < 0) { if(fillMp3InputBuffer(data) < 0) {
return DECODE_BREAK; return DECODE_BREAK;
...@@ -364,7 +364,7 @@ int decodeNextFrameHeader(mp3DecodeData * data, MpdTag ** tag, ReplayGainInfo ** ...@@ -364,7 +364,7 @@ int decodeNextFrameHeader(mp3DecodeData * data, MpdTag ** tag, ReplayGainInfo **
return DECODE_OK; return DECODE_OK;
} }
int decodeNextFrame(mp3DecodeData * data) { static int decodeNextFrame(mp3DecodeData * data) {
if((data->stream).buffer==NULL || (data->stream).error==MAD_ERROR_BUFLEN) { if((data->stream).buffer==NULL || (data->stream).error==MAD_ERROR_BUFLEN) {
if(fillMp3InputBuffer(data) < 0) { if(fillMp3InputBuffer(data) < 0) {
return DECODE_BREAK; return DECODE_BREAK;
...@@ -421,7 +421,7 @@ enum { ...@@ -421,7 +421,7 @@ enum {
XING_SCALE = 0x00000008L XING_SCALE = 0x00000008L
}; };
int parse_xing(struct xing *xing, struct mad_bitptr ptr, unsigned int bitlen) static int parse_xing(struct xing *xing, struct mad_bitptr ptr, unsigned int bitlen)
{ {
unsigned long bits; unsigned long bits;
...@@ -472,7 +472,7 @@ fail: ...@@ -472,7 +472,7 @@ fail:
return 0; return 0;
} }
int decodeFirstFrame(mp3DecodeData * data, DecoderControl * dc, static int decodeFirstFrame(mp3DecodeData * data, DecoderControl * dc,
MpdTag ** tag, ReplayGainInfo ** replayGainInfo) MpdTag ** tag, ReplayGainInfo ** replayGainInfo)
{ {
struct xing xing; struct xing xing;
...@@ -533,7 +533,7 @@ int decodeFirstFrame(mp3DecodeData * data, DecoderControl * dc, ...@@ -533,7 +533,7 @@ int decodeFirstFrame(mp3DecodeData * data, DecoderControl * dc,
return 0; return 0;
} }
void mp3DecodeDataFinalize(mp3DecodeData * data) { static void mp3DecodeDataFinalize(mp3DecodeData * data) {
mad_synth_finish(&data->synth); mad_synth_finish(&data->synth);
mad_frame_finish(&data->frame); mad_frame_finish(&data->frame);
mad_stream_finish(&data->stream); mad_stream_finish(&data->stream);
...@@ -543,7 +543,7 @@ void mp3DecodeDataFinalize(mp3DecodeData * data) { ...@@ -543,7 +543,7 @@ void mp3DecodeDataFinalize(mp3DecodeData * data) {
} }
/* this is primarily used for getting total time for tags */ /* this is primarily used for getting total time for tags */
int getMp3TotalTime(char * file) { static int getMp3TotalTime(char * file) {
InputStream inStream; InputStream inStream;
mp3DecodeData data; mp3DecodeData data;
int ret; int ret;
...@@ -558,7 +558,7 @@ int getMp3TotalTime(char * file) { ...@@ -558,7 +558,7 @@ int getMp3TotalTime(char * file) {
return ret; return ret;
} }
int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data, static int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data,
DecoderControl * dc, MpdTag ** tag, ReplayGainInfo ** replayGainInfo) DecoderControl * dc, MpdTag ** tag, ReplayGainInfo ** replayGainInfo)
{ {
initMp3DecodeData(data, inStream); initMp3DecodeData(data, inStream);
...@@ -572,7 +572,7 @@ int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data, ...@@ -572,7 +572,7 @@ int openMp3FromInputStream(InputStream * inStream, mp3DecodeData * data,
return 0; return 0;
} }
int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc, ReplayGainInfo ** replayGainInfo) { static int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc, ReplayGainInfo ** replayGainInfo) {
int i; int i;
int ret; int ret;
int skip; int skip;
...@@ -717,13 +717,13 @@ int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc, Replay ...@@ -717,13 +717,13 @@ int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc, Replay
return ret; return ret;
} }
void initAudioFormatFromMp3DecodeData(mp3DecodeData * data, AudioFormat * af) { static void initAudioFormatFromMp3DecodeData(mp3DecodeData * data, AudioFormat * af) {
af->bits = 16; af->bits = 16;
af->sampleRate = (data->frame).header.samplerate; af->sampleRate = (data->frame).header.samplerate;
af->channels = MAD_NCHANNELS(&(data->frame).header); af->channels = MAD_NCHANNELS(&(data->frame).header);
} }
int mp3_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) { static int mp3_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) {
mp3DecodeData data; mp3DecodeData data;
MpdTag * tag = NULL; MpdTag * tag = NULL;
ReplayGainInfo * replayGainInfo = NULL; ReplayGainInfo * replayGainInfo = NULL;
...@@ -812,7 +812,7 @@ int mp3_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) { ...@@ -812,7 +812,7 @@ int mp3_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) {
return 0; return 0;
} }
MpdTag * mp3_tagDup(char * file) { static MpdTag * mp3_tagDup(char * file) {
MpdTag * ret = NULL; MpdTag * ret = NULL;
int time; int time;
...@@ -831,8 +831,8 @@ MpdTag * mp3_tagDup(char * file) { ...@@ -831,8 +831,8 @@ MpdTag * mp3_tagDup(char * file) {
return ret; return ret;
} }
char * mp3_suffixes[] = {"mp3", NULL}; static char * mp3_suffixes[] = {"mp3", NULL};
char * mp3_mimeTypes[] = {"audio/mpeg", NULL}; static char * mp3_mimeTypes[] = {"audio/mpeg", NULL};
InputPlugin mp3Plugin = InputPlugin mp3Plugin =
{ {
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
/* all code here is either based on or copied from FAAD2's frontend code */ /* all code here is either based on or copied from FAAD2's frontend code */
int mp4_getAACTrack(mp4ff_t *infile) { static int mp4_getAACTrack(mp4ff_t *infile) {
/* find AAC track */ /* find AAC track */
int i, rc; int i, rc;
int numTracks = mp4ff_total_tracks(infile); int numTracks = mp4ff_total_tracks(infile);
...@@ -74,18 +74,18 @@ int mp4_getAACTrack(mp4ff_t *infile) { ...@@ -74,18 +74,18 @@ int mp4_getAACTrack(mp4ff_t *infile) {
return -1; return -1;
} }
uint32_t mp4_inputStreamReadCallback(void *inStream, void *buffer, static uint32_t mp4_inputStreamReadCallback(void *inStream, void *buffer,
uint32_t length) uint32_t length)
{ {
return readFromInputStream((InputStream*) inStream, buffer, 1, length); return readFromInputStream((InputStream*) inStream, buffer, 1, length);
} }
uint32_t mp4_inputStreamSeekCallback(void *inStream, uint64_t position) { static uint32_t mp4_inputStreamSeekCallback(void *inStream, uint64_t position) {
return seekInputStream((InputStream *) inStream, position, SEEK_SET); return seekInputStream((InputStream *) inStream, position, SEEK_SET);
} }
int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) { static int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
mp4ff_t * mp4fh; mp4ff_t * mp4fh;
mp4ff_callback_t * mp4cb; mp4ff_callback_t * mp4cb;
int32_t track; int32_t track;
...@@ -314,7 +314,7 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) { ...@@ -314,7 +314,7 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc, char * path) {
return 0; return 0;
} }
MpdTag * mp4DataDup(char * file, int * mp4MetadataFound) { static MpdTag * mp4DataDup(char * file, int * mp4MetadataFound) {
MpdTag * ret = NULL; MpdTag * ret = NULL;
InputStream inStream; InputStream inStream;
mp4ff_t * mp4fh; mp4ff_t * mp4fh;
...@@ -409,7 +409,7 @@ MpdTag * mp4DataDup(char * file, int * mp4MetadataFound) { ...@@ -409,7 +409,7 @@ MpdTag * mp4DataDup(char * file, int * mp4MetadataFound) {
return ret; return ret;
} }
MpdTag * mp4TagDup(char * file) { static MpdTag * mp4TagDup(char * file) {
MpdTag * ret = NULL; MpdTag * ret = NULL;
int mp4MetadataFound = 0; int mp4MetadataFound = 0;
...@@ -427,7 +427,7 @@ MpdTag * mp4TagDup(char * file) { ...@@ -427,7 +427,7 @@ MpdTag * mp4TagDup(char * file) {
return ret; return ret;
} }
char * mp4Suffixes[] = {"m4a", "mp4", NULL}; static char * mp4Suffixes[] = {"m4a", "mp4", NULL};
InputPlugin mp4Plugin = InputPlugin mp4Plugin =
{ {
......
...@@ -329,8 +329,8 @@ static MpdTag * mpcTagDup(char * file) { ...@@ -329,8 +329,8 @@ static MpdTag * mpcTagDup(char * file) {
return ret; return ret;
} }
char * mpcSuffixes[] = {"mpc", NULL}; static char * mpcSuffixes[] = {"mpc", NULL};
char * mpcMimeTypes[] = {NULL}; static char * mpcMimeTypes[] = {NULL};
InputPlugin mpcPlugin = InputPlugin mpcPlugin =
{ {
......
...@@ -65,7 +65,7 @@ typedef struct _OggCallbackData { ...@@ -65,7 +65,7 @@ typedef struct _OggCallbackData {
DecoderControl * dc; DecoderControl * dc;
} OggCallbackData; } OggCallbackData;
size_t ogg_read_cb(void * ptr, size_t size, size_t nmemb, void * vdata) static size_t ogg_read_cb(void * ptr, size_t size, size_t nmemb, void * vdata)
{ {
size_t ret = 0; size_t ret = 0;
OggCallbackData * data = (OggCallbackData *)vdata; OggCallbackData * data = (OggCallbackData *)vdata;
...@@ -85,19 +85,19 @@ size_t ogg_read_cb(void * ptr, size_t size, size_t nmemb, void * vdata) ...@@ -85,19 +85,19 @@ size_t ogg_read_cb(void * ptr, size_t size, size_t nmemb, void * vdata)
return ret; return ret;
} }
int ogg_seek_cb(void * vdata, ogg_int64_t offset, int whence) { static int ogg_seek_cb(void * vdata, ogg_int64_t offset, int whence) {
OggCallbackData * data = (OggCallbackData *)vdata; OggCallbackData * data = (OggCallbackData *)vdata;
return seekInputStream(data->inStream,offset,whence); return seekInputStream(data->inStream,offset,whence);
} }
int ogg_close_cb(void * vdata) { static int ogg_close_cb(void * vdata) {
OggCallbackData * data = (OggCallbackData *)vdata; OggCallbackData * data = (OggCallbackData *)vdata;
return closeInputStream(data->inStream); return closeInputStream(data->inStream);
} }
long ogg_tell_cb(void * vdata) { static long ogg_tell_cb(void * vdata) {
OggCallbackData * data = (OggCallbackData *)vdata; OggCallbackData * data = (OggCallbackData *)vdata;
return (long)(data->inStream->offset); return (long)(data->inStream->offset);
...@@ -113,7 +113,7 @@ static char * ogg_parseComment(char * comment, char * needle) { ...@@ -113,7 +113,7 @@ static char * ogg_parseComment(char * comment, char * needle) {
return NULL; return NULL;
} }
void ogg_getReplayGainInfo(char ** comments, ReplayGainInfo ** infoPtr) { static void ogg_getReplayGainInfo(char ** comments, ReplayGainInfo ** infoPtr) {
char * temp; char * temp;
int found = 0; int found = 0;
...@@ -157,7 +157,7 @@ void ogg_getReplayGainInfo(char ** comments, ReplayGainInfo ** infoPtr) { ...@@ -157,7 +157,7 @@ void ogg_getReplayGainInfo(char ** comments, ReplayGainInfo ** infoPtr) {
static const char * VORBIS_COMMENT_TRACK_KEY = "tracknumber"; static const char * VORBIS_COMMENT_TRACK_KEY = "tracknumber";
static const char * VORBIS_COMMENT_DISC_KEY = "discnumber"; static const char * VORBIS_COMMENT_DISC_KEY = "discnumber";
static inline unsigned int ogg_parseCommentAddToTag(char * comment, static unsigned int ogg_parseCommentAddToTag(char * comment,
unsigned int itemType, MpdTag ** tag) unsigned int itemType, MpdTag ** tag)
{ {
const char * needle; const char * needle;
...@@ -196,7 +196,7 @@ static MpdTag * oggCommentsParse(char ** comments) { ...@@ -196,7 +196,7 @@ static MpdTag * oggCommentsParse(char ** comments) {
return tag; return tag;
} }
void putOggCommentsIntoOutputBuffer(OutputBuffer * cb, char * streamName, static void putOggCommentsIntoOutputBuffer(OutputBuffer * cb, char * streamName,
char ** comments) char ** comments)
{ {
MpdTag * tag; MpdTag * tag;
...@@ -223,7 +223,7 @@ void putOggCommentsIntoOutputBuffer(OutputBuffer * cb, char * streamName, ...@@ -223,7 +223,7 @@ void putOggCommentsIntoOutputBuffer(OutputBuffer * cb, char * streamName,
} }
/* public */ /* public */
int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc, static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
InputStream * inStream) InputStream * inStream)
{ {
OggVorbis_File vf; OggVorbis_File vf;
...@@ -364,7 +364,7 @@ int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc, ...@@ -364,7 +364,7 @@ int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
return 0; return 0;
} }
MpdTag * oggvorbis_TagDup(char * file) { static MpdTag * oggvorbis_TagDup(char * file) {
MpdTag * ret = NULL; MpdTag * ret = NULL;
FILE * fp; FILE * fp;
OggVorbis_File vf; OggVorbis_File vf;
......
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