diff --git a/src/audio.c b/src/audio.c index 70f8f88d..1c9af89d 100644 --- a/src/audio.c +++ b/src/audio.c @@ -117,11 +117,9 @@ long brate(struct ratepair *table, long arate, int count, int *last) void audio_capabilities(out123_handle *ao, mpg123_handle *mh) { int force_fmt = 0; - int fmts; size_t ri; /* Pitching introduces a difference between decoder rate and playback rate. */ - long rate, decode_rate; - int channels; + long decode_rate; const long *rates; long *outrates; struct ratepair *unpitch; diff --git a/src/control_generic.c b/src/control_generic.c index c60575ae..bd6740b0 100644 --- a/src/control_generic.c +++ b/src/control_generic.c @@ -7,6 +7,14 @@ reworked by Thomas Orgis - it was the entry point for eventually becoming maintainer... */ +#include "config.h" +/* _BSD_SOURCE needed for setlinebuf, erm, but that's deprecated + so trying _DEFAULT_SOURCE */ +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE +#endif +#include "compat.h" + #include "mpg123app.h" #include "out123.h" #include diff --git a/src/getlopt.c b/src/getlopt.c index 8ff12264..6372381a 100644 --- a/src/getlopt.c +++ b/src/getlopt.c @@ -97,7 +97,7 @@ static int performoption (int argc, char *argv[], topt *opt) } if (opt->func) opt->func(loptarg); - debug4("result: %i (%p, %i, %i)", result, opt->var, opt->value, opt->sname); + debug4("result: %i (%p, %li, %i)", result, opt->var, opt->value, opt->sname); return (result); } diff --git a/src/libout123/buffer.c b/src/libout123/buffer.c index 4a7ff9a0..71d66e27 100644 --- a/src/libout123/buffer.c +++ b/src/libout123/buffer.c @@ -274,6 +274,7 @@ int buffer_formats( out123_handle *ao, const long *rates, int ratecount , struct mpg123_fmt **fmtlist ) { int writerfd = ao->buffermem->fd[XF_WRITER]; + size_t ratesize; if(xfermem_putcmd(writerfd, BUF_CMD_AUDIOFMT) != 1) { @@ -281,7 +282,7 @@ int buffer_formats( out123_handle *ao, const long *rates, int ratecount return -1; } - size_t ratesize = ratecount*sizeof(rates); + ratesize = ratecount*sizeof(rates); if( !GOOD_WRITEVAL(writerfd, maxchannels) @@ -753,9 +754,7 @@ int buffer_loop(out123_handle *ao) int minchannels; int maxchannels; struct mpg123_fmt *fmtlist; - int success; int fmtcount = -1; - int recread = 0; if( !GOOD_READVAL_BUF(my_fd, maxchannels) diff --git a/src/libout123/buffer.h b/src/libout123/buffer.h index 01082dfa..e4192a5b 100644 --- a/src/libout123/buffer.h +++ b/src/libout123/buffer.h @@ -27,6 +27,9 @@ void buffer_exit(out123_handle *ao); int buffer_sync_param(out123_handle *ao); int buffer_open(out123_handle *ao, const char* driver, const char* device); int buffer_encodings(out123_handle *ao); +int buffer_formats( out123_handle *ao, const long *rates, int ratecount + , int minchannels, int maxchannels + , struct mpg123_fmt **fmtlist ); int buffer_start(out123_handle *ao); void buffer_ndrain(out123_handle *ao, size_t bytes); diff --git a/src/libout123/libout123.c b/src/libout123/libout123.c index 3c2539dc..0a039e0c 100644 --- a/src/libout123/libout123.c +++ b/src/libout123/libout123.c @@ -430,7 +430,7 @@ void attribute_align_arg out123_close(out123_handle *ao) int attribute_align_arg out123_start(out123_handle *ao, long rate, int channels, int encoding) { - debug4( "out123_start(%p, %li, %i, %li)" + debug4( "out123_start(%p, %li, %i, %i)" , (void*)ao, rate, channels, encoding ); if(!ao) return OUT123_ERR; @@ -890,7 +890,7 @@ int out123_formats( out123_handle *ao, const long *rates, int ratecount { debug6( "out123_formats(%p, %p, %i, %i, %i, %p)" , (void*)ao, (void*)rates, ratecount, minchannels, maxchannels - , (void)fmtlist ); + , (void*)fmtlist ); if(!ao) return OUT123_ERR; ao->errcode = OUT123_OK; diff --git a/src/libout123/wav.c b/src/libout123/wav.c index 277ffc2c..6908c002 100644 --- a/src/libout123/wav.c +++ b/src/libout123/wav.c @@ -165,7 +165,7 @@ static int testEndian(void) /* return: 0 is good, -1 is bad */ static int open_file(struct wavdata *wdat, char *filename) { - debug2("open_file(%p, %s)", wdat, filename ? filename : ""); + debug2("open_file(%p, %s)", (void*)wdat, filename ? filename : ""); if(!wdat) return -1; #if defined(HAVE_SETUID) && defined(HAVE_GETUID) diff --git a/src/out123.c b/src/out123.c index d0148af3..2012106a 100644 --- a/src/out123.c +++ b/src/out123.c @@ -146,11 +146,6 @@ static void safe_exit(int code) exit(code); } -static void check_fatal(int code) -{ - if(code) safe_exit(code); -} - static void check_fatal_output(int code) { if(code) @@ -636,7 +631,7 @@ static char* output_enclist(void) int i; char *list = NULL; char *pos; - size_t len; + size_t len = 0; int enc_count = 0; int *enc_codes = NULL; diff --git a/src/term.c b/src/term.c index 982738d8..bf3ed12e 100644 --- a/src/term.c +++ b/src/term.c @@ -211,11 +211,11 @@ static void seekmode(mpg123_handle *mh, out123_handle *ao) { if(param.usebuffer && !stopped) { - stopped = TRUE; int channels; int encoding; off_t back_samples; + stopped = TRUE; out123_pause(ao); mpg123_getformat(mh, NULL, &channels, &encoding); back_samples = out123_buffered(ao)/(mpg123_samplesize(encoding)*channels);