diff --git a/engine/common/soundlib/libmpg/format.c b/engine/common/soundlib/libmpg/format.c index 75e3c204..fb40aa7f 100644 --- a/engine/common/soundlib/libmpg/format.c +++ b/engine/common/soundlib/libmpg/format.c @@ -56,20 +56,20 @@ static int good_enc( const int enc ) return FALSE; } -void mpg123_rates( const long **list, size_t *number ) +static void mpg123_rates( const long **list, size_t *number ) { if( number != NULL ) *number = sizeof( my_rates ) / sizeof( long ); if( list != NULL ) *list = my_rates; } // now that's a bit tricky... One build of the library knows only a subset of the encodings. -void mpg123_encodings( const int **list, size_t *number ) +static void mpg123_encodings( const int **list, size_t *number ) { if( number != NULL ) *number = sizeof( good_encodings ) / sizeof( int ); if( list != NULL ) *list = good_encodings; } -int mpg123_encsize( int encoding ) +static int mpg123_encsize( int encoding ) { return sizeof( short ); } @@ -364,7 +364,7 @@ int mpg123_format( mpg123_handle_t *mh, long rate, int channels, int encodings ) return r; } -int mpg123_format_support( mpg123_handle_t *mh, long rate, int encoding ) +static int mpg123_format_support( mpg123_handle_t *mh, long rate, int encoding ) { if( mh == NULL ) return 0; diff --git a/engine/common/soundlib/libmpg/frame.c b/engine/common/soundlib/libmpg/frame.c index 6344b6d6..7a714993 100644 --- a/engine/common/soundlib/libmpg/frame.c +++ b/engine/common/soundlib/libmpg/frame.c @@ -393,7 +393,7 @@ void frame_exit( mpg123_handle_t *fr ) bc_cleanup( &fr->rdat.buffer ); } -int mpg123_framedata( mpg123_handle_t *mh, ulong *header, byte **bodydata, size_t *bodybytes ) +static int mpg123_framedata( mpg123_handle_t *mh, ulong *header, byte **bodydata, size_t *bodybytes ) { if( mh == NULL ) return MPG123_BAD_HANDLE; @@ -512,7 +512,7 @@ mpg_off_t frame_index_find( mpg123_handle_t *fr, mpg_off_t want_frame, mpg_off_t return gopos; } -mpg_off_t frame_ins2outs( mpg123_handle_t *fr, mpg_off_t ins ) +static mpg_off_t frame_ins2outs( mpg123_handle_t *fr, mpg_off_t ins ) { mpg_off_t outs = 0; diff --git a/engine/common/soundlib/libmpg/mpg123.c b/engine/common/soundlib/libmpg/mpg123.c index 03968d48..c5b48c6c 100644 --- a/engine/common/soundlib/libmpg/mpg123.c +++ b/engine/common/soundlib/libmpg/mpg123.c @@ -15,6 +15,7 @@ GNU General Public License for more details. #include "mpg123.h" #include "sample.h" +#include "libmpg.h" static int initialized = 0; @@ -83,7 +84,7 @@ mpg123_handle_t *mpg123_parnew( mpg123_parm_t *mp, int *error ) return fr; } -int mpg123_par( mpg123_parm_t *mp, enum mpg123_parms key, long val ) +static int mpg123_par( mpg123_parm_t *mp, enum mpg123_parms key, long val ) { int ret = MPG123_OK; @@ -189,7 +190,7 @@ int mpg123_param( mpg123_handle_t *mh, enum mpg123_parms key, long val ) } } -int mpg123_close( mpg123_handle_t *mh ) +static int mpg123_close( mpg123_handle_t *mh ) { if( mh == NULL ) return MPG123_BAD_HANDLE; @@ -263,7 +264,7 @@ int mpg123_replace_reader_handle( mpg123_handle_t *mh, mpg_ssize_t (*fread)( voi // a) a new choice of decoder // b) a changed native format of the MPEG stream // ... calls are only valid after parsing some MPEG frame! -int decode_update( mpg123_handle_t *mh ) +static int decode_update( mpg123_handle_t *mh ) { long native_rate; int b; @@ -320,13 +321,13 @@ int decode_update( mpg123_handle_t *mh ) return 0; } -size_t mpg123_safe_buffer( void ) +static size_t mpg123_safe_buffer( void ) { // real is the largest possible output return sizeof( float ) * 2 * 1152; } -size_t mpg123_outblock( mpg123_handle_t *mh ) +static size_t mpg123_outblock( mpg123_handle_t *mh ) { // try to be helpful and never return zero output block size. if( mh != NULL && mh->outblock > 0 ) @@ -697,7 +698,7 @@ int mpg123_getformat( mpg123_handle_t *mh, int *rate, int *channels, int *encodi return MPG123_OK; } -int mpg123_scan( mpg123_handle_t *mh ) +static int mpg123_scan( mpg123_handle_t *mh ) { mpg_off_t track_frames = 0; mpg_off_t track_samples = 0; @@ -963,8 +964,10 @@ const char *mpg123_plain_strerror( int errcode ) } } -const char *get_error( mpg123_handle_t *mh ) +const char *get_error( void *handle ) { + mpg123_handle_t *mh = handle; + if( !mh ) return mpg123_plain_strerror( MPG123_BAD_HANDLE ); return mpg123_plain_strerror( mh->err ); } diff --git a/engine/common/soundlib/libmpg/parse.c b/engine/common/soundlib/libmpg/parse.c index 8ef2db2d..b84d472b 100644 --- a/engine/common/soundlib/libmpg/parse.c +++ b/engine/common/soundlib/libmpg/parse.c @@ -68,7 +68,7 @@ void set_pointer( mpg123_handle_t *fr, long backstep ) fr->bitindex = 0; } -int frame_bitrate( mpg123_handle_t *fr ) +static int frame_bitrate( mpg123_handle_t *fr ) { return tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index]; } @@ -643,7 +643,7 @@ static int forget_head_shift( mpg123_handle_t *fr, ulong *newheadp, int forget ) // returns: 0: bad or just unparseable tag // 1: good, (possibly) new tag info // <0: reader error (may need more data feed, try again) -int parse_new_id3( mpg123_handle_t *fr, ulong first4bytes ) +static int parse_new_id3( mpg123_handle_t *fr, ulong first4bytes ) { byte buf[6]; ulong length=0; diff --git a/engine/common/soundlib/libmpg/synth.c b/engine/common/soundlib/libmpg/synth.c index bf1ca981..7e0960ec 100644 --- a/engine/common/soundlib/libmpg/synth.c +++ b/engine/common/soundlib/libmpg/synth.c @@ -25,7 +25,7 @@ GNU General Public License for more details. else { *(samples) = REAL_TO_SHORT( sum ); } // main synth function, uses the plain dct64 -int synth_1to1( float *bandPtr, int channel, mpg123_handle_t *fr, int final ) +static int synth_1to1( float *bandPtr, int channel, mpg123_handle_t *fr, int final ) { static const int step = 2; short *samples = (short *) (fr->buffer.data + fr->buffer.fill); @@ -147,7 +147,7 @@ static int synth_stereo( float *bandPtr_l, float *bandPtr_r, mpg123_handle_t *fr } // mono to stereo synth, wrapping over synth_1to1 -int synth_1to1_m2s(float *bandPtr, mpg123_handle_t *fr ) +static int synth_1to1_m2s(float *bandPtr, mpg123_handle_t *fr ) { byte *samples = fr->buffer.data; int i, ret; @@ -165,7 +165,7 @@ int synth_1to1_m2s(float *bandPtr, mpg123_handle_t *fr ) } // mono synth, wrapping over synth_1to1 -int synth_1to1_mono( float *bandPtr, mpg123_handle_t *fr ) +static int synth_1to1_mono( float *bandPtr, mpg123_handle_t *fr ) { short samples_tmp[BLOCK]; short *tmp1 = samples_tmp;