From e6c3acaa6fc6f2003b118a93306a8508e13f0fb1 Mon Sep 17 00:00:00 2001 From: Andreas Wiese Date: Fri, 14 Jan 2011 15:43:51 +0100 Subject: Fix NDEBUG test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit needs to be included unconditionally from definition of NDEBUG, since »bool« doesn't get defined otherwise. Signed-off-by: Andreas Wiese --- src/pipe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/pipe.h b/src/pipe.h index 2825b320a..b15cd76c1 100644 --- a/src/pipe.h +++ b/src/pipe.h @@ -20,9 +20,9 @@ #ifndef MPD_PIPE_H #define MPD_PIPE_H -#ifndef NDEBUG #include +#ifndef NDEBUG struct audio_format; #endif -- cgit v1.2.3 From 03018611f8b9d7ed6d55ee45ccf2b69958c05caf Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 31 Jan 2011 07:19:34 +0100 Subject: update: log all file permission problems --- src/update.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/update.c b/src/update.c index d5c9779c8..9a1e7d29b 100644 --- a/src/update.c +++ b/src/update.c @@ -254,6 +254,9 @@ stat_directory(const struct directory *directory, struct stat *st) if (path_fs == NULL) return -1; ret = stat(path_fs, st); + if (ret < 0) + g_warning("Failed to stat %s: %s", path_fs, g_strerror(errno)); + g_free(path_fs); return ret; } @@ -270,6 +273,9 @@ stat_directory_child(const struct directory *parent, const char *name, return -1; ret = stat(path_fs, st); + if (ret < 0) + g_warning("Failed to stat %s: %s", path_fs, g_strerror(errno)); + g_free(path_fs); return ret; } -- cgit v1.2.3 From 8b2f4fc823496c9e473616487e6dc572d77df346 Mon Sep 17 00:00:00 2001 From: Tony Miller Date: Thu, 3 Feb 2011 00:25:35 +0100 Subject: Set fadeout in gme_decoder_plugin. Due to the nature of the gme library, this needs to be done for the end of songs to be detected. --- src/decoder/gme_decoder_plugin.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/decoder/gme_decoder_plugin.c b/src/decoder/gme_decoder_plugin.c index 4a5220a3f..e14a52d32 100644 --- a/src/decoder/gme_decoder_plugin.c +++ b/src/decoder/gme_decoder_plugin.c @@ -153,6 +153,9 @@ gme_file_decode(struct decoder *decoder, const char *path_fs) if((gme_err = gme_start_track(emu, song_num)) != NULL) g_warning("%s", gme_err); + if(ti->length > 0) + gme_set_fade(emu, ti->length); + /* play */ do { gme_err = gme_play(emu, GME_BUFFER_SAMPLES, buf); -- cgit v1.2.3 From e776c605adeb984aae290cdff38c5f8dd0cd291e Mon Sep 17 00:00:00 2001 From: Thomas Jansen Date: Fri, 4 Feb 2011 10:22:00 +0100 Subject: output/httpd: initialize unflushed_input This fixes the following valgrind warning occuring on the first call of httpd_output_read_page: ==20124== Conditional jump or move depends on uninitialised value(s) ==20124== at 0x425E65: httpd_output_read_page (httpd_output_plugin.c:240) ==20124== by 0x426087: httpd_output_open (httpd_output_plugin.c:279) ==20124== by 0x41D862: ao_open (output_plugin.h:206) ==20124== by 0x41E133: audio_output_task (output_thread.c:590) --- src/output/httpd_output_plugin.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c index 72994018a..27103c3f8 100644 --- a/src/output/httpd_output_plugin.c +++ b/src/output/httpd_output_plugin.c @@ -123,6 +123,7 @@ httpd_output_init(G_GNUC_UNUSED const struct audio_format *audio_format, /* initialize metadata */ httpd->metadata = NULL; + httpd->unflushed_input = 0; /* initialize encoder */ -- cgit v1.2.3 From 948b8f35e6fc578c85a0cfc8e143e1325ce99043 Mon Sep 17 00:00:00 2001 From: Thomas Jansen Date: Fri, 4 Feb 2011 10:39:21 +0100 Subject: general: whitespace cleanup Remove trailing whitespace found by this command: find -name '*.[ch]' | xargs grep "[[:space:]]$" --- src/AudioCompress/compress.c | 28 ++++++++++++++-------------- src/decoder/audiofile_decoder_plugin.c | 2 +- src/encoder/flac_encoder.c | 6 +++--- src/encoder/wave_encoder.c | 4 ++-- src/mixer/winmm_mixer_plugin.c | 10 +++++----- src/output/httpd_internal.h | 2 +- src/output/mvp_plugin.c | 2 +- src/output/oss_plugin.c | 2 +- src/pcm_byteswap.c | 2 +- 9 files changed, 29 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/AudioCompress/compress.c b/src/AudioCompress/compress.c index d5c08372c..36cdfd8dd 100644 --- a/src/AudioCompress/compress.c +++ b/src/AudioCompress/compress.c @@ -16,16 +16,16 @@ struct Compressor { //! The compressor's preferences struct CompressorConfig prefs; - + //! History of the peak values int *peaks; - + //! History of the gain values int *gain; - + //! History of clip amounts int *clipped; - + unsigned int pos; unsigned int bufsz; }; @@ -41,9 +41,9 @@ struct Compressor *Compressor_new(unsigned int history) obj->peaks = obj->gain = obj->clipped = NULL; obj->bufsz = 0; obj->pos = 0; - + Compressor_setHistory(obj, history); - + return obj; } @@ -70,7 +70,7 @@ void Compressor_setHistory(struct Compressor *obj, unsigned int history) { if (!history) history = BUCKETS; - + obj->peaks = resizeArray(obj->peaks, history, obj->bufsz); obj->gain = resizeArray(obj->gain, history, obj->bufsz); obj->clipped = resizeArray(obj->clipped, history, obj->bufsz); @@ -82,7 +82,7 @@ struct CompressorConfig *Compressor_getConfig(struct Compressor *obj) return &obj->prefs; } -void Compressor_Process_int16(struct Compressor *obj, int16_t *audio, +void Compressor_Process_int16(struct Compressor *obj, int16_t *audio, unsigned int count) { struct CompressorConfig *prefs = Compressor_getConfig(obj); @@ -97,7 +97,7 @@ void Compressor_Process_int16(struct Compressor *obj, int16_t *audio, int *clipped = obj->clipped + slot; unsigned int ramp = count; int delta; - + ap = audio; for (i = 0; i < count; i++) { @@ -124,15 +124,15 @@ void Compressor_Process_int16(struct Compressor *obj, int16_t *audio, //! Determine target gain newGain = (1 << 10)*prefs->target/peakVal; - + //! Adjust the gain with inertia from the previous gain value - newGain = (curGain*((1 << prefs->smooth) - 1) + newGain) + newGain = (curGain*((1 << prefs->smooth) - 1) + newGain) >> prefs->smooth; - + //! Make sure it's no more than the maximum gain value if (newGain > (prefs->maxgain << 10)) newGain = prefs->maxgain << 10; - + //! Make sure it's no less than 1:1 if (newGain < (1 << 10)) newGain = 1 << 10; @@ -144,7 +144,7 @@ void Compressor_Process_int16(struct Compressor *obj, int16_t *audio, //! Truncate the ramp time ramp = peakPos; } - + //! Record the new gain obj->gain[slot] = newGain; diff --git a/src/decoder/audiofile_decoder_plugin.c b/src/decoder/audiofile_decoder_plugin.c index 3026f3cc7..b099cf706 100644 --- a/src/decoder/audiofile_decoder_plugin.c +++ b/src/decoder/audiofile_decoder_plugin.c @@ -244,7 +244,7 @@ static const char *const audiofile_suffixes[] = { static const char *const audiofile_mime_types[] = { "audio/x-wav", "audio/x-aiff", - NULL + NULL }; const struct decoder_plugin audiofile_decoder_plugin = { diff --git a/src/encoder/flac_encoder.c b/src/encoder/flac_encoder.c index 73328fe81..c34faad00 100644 --- a/src/encoder/flac_encoder.c +++ b/src/encoder/flac_encoder.c @@ -55,7 +55,7 @@ static bool flac_encoder_configure(struct flac_encoder *encoder, const struct config_param *param, G_GNUC_UNUSED GError **error) { - encoder->compression = config_get_block_unsigned(param, + encoder->compression = config_get_block_unsigned(param, "compression", 5); return true; @@ -218,7 +218,7 @@ flac_encoder_open(struct encoder *_encoder, struct audio_format *audio_format, if (init_status != FLAC__STREAM_ENCODER_OK) { g_set_error(error, flac_encoder_quark(), 0, - "failed to initialize encoder: %s\n", + "failed to initialize encoder: %s\n", FLAC__StreamEncoderStateString[init_status]); flac_encoder_close(_encoder); return false; @@ -234,7 +234,7 @@ flac_encoder_open(struct encoder *_encoder, struct audio_format *audio_format, if(init_status != FLAC__STREAM_ENCODER_INIT_STATUS_OK) { g_set_error(error, flac_encoder_quark(), 0, - "failed to initialize encoder: %s\n", + "failed to initialize encoder: %s\n", FLAC__StreamEncoderInitStatusString[init_status]); flac_encoder_close(_encoder); return false; diff --git a/src/encoder/wave_encoder.c b/src/encoder/wave_encoder.c index 7398b45c7..938be5e5e 100644 --- a/src/encoder/wave_encoder.c +++ b/src/encoder/wave_encoder.c @@ -58,7 +58,7 @@ wave_encoder_quark(void) } static void -fill_wave_header(struct wave_header *header, int channels, int bits, +fill_wave_header(struct wave_header *header, int channels, int bits, int freq, int block_size) { int data_size = 0x0FFFFFFF; @@ -142,7 +142,7 @@ wave_encoder_open(struct encoder *_encoder, buffer = pcm_buffer_get(&encoder->buffer, sizeof(struct wave_header) ); /* create PCM wave header in initial buffer */ - fill_wave_header((struct wave_header *) buffer, + fill_wave_header((struct wave_header *) buffer, audio_format->channels, encoder->bits, audio_format->sample_rate, diff --git a/src/mixer/winmm_mixer_plugin.c b/src/mixer/winmm_mixer_plugin.c index e1e8a7a45..5ab3e7525 100644 --- a/src/mixer/winmm_mixer_plugin.c +++ b/src/mixer/winmm_mixer_plugin.c @@ -58,11 +58,11 @@ winmm_mixer_init(void *ao, G_GNUC_UNUSED const struct config_param *param, G_GNUC_UNUSED GError **error_r) { assert(ao != NULL); - + struct winmm_mixer *wm = g_new(struct winmm_mixer, 1); mixer_init(&wm->base, &winmm_mixer_plugin); wm->output = (struct winmm_output *) ao; - + return &wm->base; } @@ -79,13 +79,13 @@ winmm_mixer_get_volume(struct mixer *mixer, GError **error_r) DWORD volume; HWAVEOUT handle = winmm_output_get_handle(wm->output); MMRESULT result = waveOutGetVolume(handle, &volume); - + if (result != MMSYSERR_NOERROR) { g_set_error(error_r, 0, winmm_mixer_quark(), "Failed to get winmm volume"); return -1; } - + return winmm_volume_decode(volume); } @@ -102,7 +102,7 @@ winmm_mixer_set_volume(struct mixer *mixer, unsigned volume, GError **error_r) "Failed to set winmm volume"); return false; } - + return true; } diff --git a/src/output/httpd_internal.h b/src/output/httpd_internal.h index fee72c07f..277e70f11 100644 --- a/src/output/httpd_internal.h +++ b/src/output/httpd_internal.h @@ -111,7 +111,7 @@ struct httpd_output { char buffer[32768]; /** - * The maximum and current number of clients connected + * The maximum and current number of clients connected * at the same time. */ guint clients_max, clients_cnt; diff --git a/src/output/mvp_plugin.c b/src/output/mvp_plugin.c index 20587f5c5..6cc8fa34e 100644 --- a/src/output/mvp_plugin.c +++ b/src/output/mvp_plugin.c @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -/* +/* * Media MVP audio output based on code from MVPMC project: * http://mvpmc.sourceforge.net/ */ diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c index bb4164990..f5ae80e8c 100644 --- a/src/output/oss_plugin.c +++ b/src/output/oss_plugin.c @@ -347,7 +347,7 @@ oss_setup_sample_rate(int fd, struct audio_format *audio_format, case SUCCESS: if (!audio_valid_sample_rate(sample_rate)) break; - + audio_format->sample_rate = sample_rate; return true; diff --git a/src/pcm_byteswap.c b/src/pcm_byteswap.c index 967c574cb..6577319d4 100644 --- a/src/pcm_byteswap.c +++ b/src/pcm_byteswap.c @@ -49,7 +49,7 @@ const int16_t *pcm_byteswap_16(struct pcm_buffer *buffer, static inline uint32_t swab32(uint32_t x) { - return (x << 24) | + return (x << 24) | ((x & 0xff00) << 8) | ((x & 0xff0000) >> 8) | (x >> 24); -- cgit v1.2.3 From 2a1f4539f6115f6d01f33b60adf0118122c7018a Mon Sep 17 00:00:00 2001 From: Christopher Brannon Date: Sun, 13 Feb 2011 01:37:28 +0000 Subject: Insure proper initialization of stack-allocated struct. Version 1.0.0 of the libao library added a new field to the ao_sample_format struct. It is a char * named matrix. When an ao_sample_format is allocated on the stack, this field contains garbage. The proper course is to insure that is initialized to NULL. NULL indicates that we do not want any mapping. The struct is now initialized using a static initializer, and this technique is compatible with all known versions of libao. --- src/output/ao_plugin.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/output/ao_plugin.c b/src/output/ao_plugin.c index 12d2b7552..63a43ddf0 100644 --- a/src/output/ao_plugin.c +++ b/src/output/ao_plugin.c @@ -25,6 +25,9 @@ #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "ao" +/* An ao_sample_format, with all fields set to zero: */ +static const ao_sample_format OUR_AO_FORMAT_INITIALIZER; + static unsigned ao_output_ref; struct ao_data { @@ -166,7 +169,7 @@ static bool ao_output_open(void *data, struct audio_format *audio_format, GError **error) { - ao_sample_format format; + ao_sample_format format = OUR_AO_FORMAT_INITIALIZER; struct ao_data *ad = (struct ao_data *)data; /* support for 24 bit samples in libao is currently dubious, -- cgit v1.2.3 From ce370bee60f685d9e7b109ac67ae656b46779f88 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 25 Feb 2011 10:46:44 +0100 Subject: output/jack: rename variable sample_size to jack_sample_size --- src/output/jack_plugin.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/output/jack_plugin.c b/src/output/jack_plugin.c index 5dc1eca24..4b71dc8c4 100644 --- a/src/output/jack_plugin.c +++ b/src/output/jack_plugin.c @@ -36,7 +36,7 @@ #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "jack" -static const size_t sample_size = sizeof(jack_default_audio_sample_t); +static const size_t jack_sample_size = sizeof(jack_default_audio_sample_t); static const char *const port_names[2] = { "left", "right", @@ -118,14 +118,15 @@ mpd_jack_process(jack_nframes_t nframes, void *arg) for (unsigned i = 0; i < G_N_ELEMENTS(jd->ringbuffer); ++i) { available = jack_ringbuffer_read_space(jd->ringbuffer[i]); - assert(available % sample_size == 0); - available /= sample_size; + assert(available % jack_sample_size == 0); + available /= jack_sample_size; if (available > nframes) available = nframes; out = jack_port_get_buffer(jd->ports[i], nframes); jack_ringbuffer_read(jd->ringbuffer[i], - (char *)out, available * sample_size); + (char *)out, + available * jack_sample_size); while (available < nframes) /* ringbuffer underrun, fill with silence */ @@ -430,7 +431,7 @@ mpd_jack_play(void *data, const void *chunk, size_t size, GError **error) g_usleep(1000); } - space /= sample_size; + space /= jack_sample_size; if (space < size) size = space; -- cgit v1.2.3 From 1674a4ec828ebd6822e1d1622d9fcdae5140a61d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 27 Feb 2011 23:26:50 +0100 Subject: output/jack: fix crash with mono playback With mono sound, jack_sample_size is smaller than frame_size (4 vs 2 bytes), and "space/jack_sample_size==0". That means mpd_jack_play() will return 0, although no error has occurred. --- src/output/jack_plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/output/jack_plugin.c b/src/output/jack_plugin.c index 4b71dc8c4..0a0b8377f 100644 --- a/src/output/jack_plugin.c +++ b/src/output/jack_plugin.c @@ -423,7 +423,7 @@ mpd_jack_play(void *data, const void *chunk, size_t size, GError **error) /* send data symmetrically */ space = space1; - if (space >= frame_size) + if (space >= jack_sample_size) break; /* XXX do something more intelligent to -- cgit v1.2.3 From ee9c60fad46c1da7c517b84e37a9c4bc41949efd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 28 Feb 2011 00:00:41 +0100 Subject: output/oss: AFMT_S24_PACKED is little-endian According to the Solaris dsp manpage, AFMT_S24_PACKED is little-endian: http://download.oracle.com/docs/cd/E19963-01/821-1475/6nmf5baot/index.html The Minix soundcard.h header says the same. --- src/output/oss_plugin.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c index f5ae80e8c..26d674e33 100644 --- a/src/output/oss_plugin.c +++ b/src/output/oss_plugin.c @@ -461,6 +461,12 @@ oss_setup_sample_format(int fd, struct audio_format *audio_format, break; audio_format->format = mpd_format; + +#ifdef AFMT_S24_PACKED + if (oss_format == AFMT_S24_PACKED) + audio_format->reverse_endian = + G_BYTE_ORDER != G_LITTLE_ENDIAN; +#endif return true; case ERROR: @@ -502,6 +508,12 @@ oss_setup_sample_format(int fd, struct audio_format *audio_format, break; audio_format->format = mpd_format; + +#ifdef AFMT_S24_PACKED + if (oss_format == AFMT_S24_PACKED) + audio_format->reverse_endian = + G_BYTE_ORDER != G_LITTLE_ENDIAN; +#endif return true; case ERROR: -- cgit v1.2.3 From a1d1c2beaa54f76bbf92b2a5fd83c4a582a0316b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 28 Feb 2011 00:09:45 +0100 Subject: output/oss: disable 24 bit playback on FreeBSD See code comment. --- src/output/oss_plugin.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c index 26d674e33..9261b423c 100644 --- a/src/output/oss_plugin.c +++ b/src/output/oss_plugin.c @@ -41,6 +41,15 @@ # include #endif /* !(defined(__OpenBSD__) || defined(__NetBSD__) */ +/* We got bug reports from FreeBSD users who said that the two 24 bit + formats generate white noise on FreeBSD, but 32 bit works. This is + a workaround until we know what exactly is expected by the kernel + audio drivers. */ +#ifndef __linux__ +#undef AFMT_S24_PACKED +#undef AFMT_S24_NE +#endif + struct oss_data { int fd; const char *device; -- cgit v1.2.3 From e2aea6bce581e09e20f7570fd67cb92896f60656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20Sp=C3=B6rlein?= Date: Tue, 8 Feb 2011 05:44:00 +0100 Subject: output/httpd: include sys/socket.h for AF_UNIX --- src/output/httpd_output_plugin.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c index 27103c3f8..fe9a44256 100644 --- a/src/output/httpd_output_plugin.c +++ b/src/output/httpd_output_plugin.c @@ -34,6 +34,7 @@ #include #include #include +#include /* needed for AF_UNIX */ #ifdef HAVE_LIBWRAP #include -- cgit v1.2.3 From b6303313f0145c4caf58195ba4a85d2f4fa2967c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 16 Mar 2011 19:13:46 +0100 Subject: encoder/vorbis: reset the Ogg stream after flush Without the ogg_stream_reset() call, the "e_o_s" flag never gets reset, and libogg writes EOS packets over and over. --- src/encoder/vorbis_encoder.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/encoder/vorbis_encoder.c b/src/encoder/vorbis_encoder.c index 9dac3564d..08147be1c 100644 --- a/src/encoder/vorbis_encoder.c +++ b/src/encoder/vorbis_encoder.c @@ -276,6 +276,8 @@ vorbis_encoder_flush(struct encoder *_encoder, G_GNUC_UNUSED GError **error) vorbis_analysis_init(&encoder->vd, &encoder->vi); vorbis_block_init(&encoder->vd, &encoder->vb); + ogg_stream_reset(&encoder->os); + encoder->flush = true; return true; } -- cgit v1.2.3 From 4f293ecd6f4c7a07d72fbf0b9d0d454244b12c2a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 16 Mar 2011 23:37:41 +0100 Subject: audio_format, output_thread: add more audio_format_valid() assertions --- src/audio_format.h | 6 ++++++ src/audio_parser.c | 1 + src/output_control.c | 1 + src/output_thread.c | 5 +++++ 4 files changed, 13 insertions(+) (limited to 'src') diff --git a/src/audio_format.h b/src/audio_format.h index dd32731c3..a4450ad71 100644 --- a/src/audio_format.h +++ b/src/audio_format.h @@ -22,6 +22,7 @@ #include #include +#include enum sample_format { SAMPLE_FORMAT_UNDEFINED = 0, @@ -219,6 +220,9 @@ static inline void audio_format_mask_apply(struct audio_format *af, const struct audio_format *mask) { + assert(audio_format_valid(af)); + assert(audio_format_mask_valid(mask)); + if (mask->sample_rate != 0) af->sample_rate = mask->sample_rate; @@ -227,6 +231,8 @@ audio_format_mask_apply(struct audio_format *af, if (mask->channels != 0) af->channels = mask->channels; + + assert(audio_format_valid(af)); } /** diff --git a/src/audio_parser.c b/src/audio_parser.c index 039ffa1ab..ca5182c4a 100644 --- a/src/audio_parser.c +++ b/src/audio_parser.c @@ -192,6 +192,7 @@ audio_format_parse(struct audio_format *dest, const char *src, } audio_format_init(dest, rate, sample_format, channels); + assert(audio_format_valid(dest)); return true; } diff --git a/src/output_control.c b/src/output_control.c index 161404f78..0823b667b 100644 --- a/src/output_control.c +++ b/src/output_control.c @@ -115,6 +115,7 @@ audio_output_open(struct audio_output *ao, { bool open; + assert(audio_format_valid(audio_format)); assert(mp != NULL); if (ao->fail_timer != NULL) { diff --git a/src/output_thread.c b/src/output_thread.c index a5244c693..4e0446791 100644 --- a/src/output_thread.c +++ b/src/output_thread.c @@ -95,6 +95,8 @@ ao_filter_open(struct audio_output *ao, struct audio_format *audio_format, GError **error_r) { + assert(audio_format_valid(audio_format)); + /* the replay_gain filter cannot fail here */ if (ao->replay_gain_filter != NULL) filter_open(ao->replay_gain_filter, audio_format, error_r); @@ -136,6 +138,7 @@ ao_open(struct audio_output *ao) assert(!ao->open); assert(ao->pipe != NULL); assert(ao->chunk == NULL); + assert(audio_format_valid(&ao->in_audio_format)); if (ao->fail_timer != NULL) { /* this can only happen when this @@ -164,6 +167,8 @@ ao_open(struct audio_output *ao) return; } + assert(audio_format_valid(filter_audio_format)); + ao->out_audio_format = *filter_audio_format; audio_format_mask_apply(&ao->out_audio_format, &ao->config_audio_format); -- cgit v1.2.3 From 0fdcd381bc73c34f277ff1b443de0d24e8d15a19 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 18 Mar 2011 19:43:26 +0100 Subject: update_walk: ignore parameter "mode" on WIN32 Fix compiler warning. --- src/update_walk.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/update_walk.c b/src/update_walk.c index a1796edcb..845f152eb 100644 --- a/src/update_walk.c +++ b/src/update_walk.c @@ -563,6 +563,7 @@ directory_child_access(const struct directory *directory, /* access() is useless on WIN32 */ (void)directory; (void)name; + (void)mode; return true; #else char *path = map_directory_child_fs(directory, name); -- cgit v1.2.3 From 8d83914f05cfa6d35c183ff40d5f2936a76667d4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 18 Mar 2011 19:44:12 +0100 Subject: output/httpd: include sys/socket.h only when building with libwrap Fixes build failure on WIN32. --- src/output/httpd_output_plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c index fe9a44256..6650d89e3 100644 --- a/src/output/httpd_output_plugin.c +++ b/src/output/httpd_output_plugin.c @@ -34,9 +34,9 @@ #include #include #include -#include /* needed for AF_UNIX */ #ifdef HAVE_LIBWRAP +#include /* needed for AF_UNIX */ #include #endif -- cgit v1.2.3 From 1fc571088bcd5023c9da7a635cff3aa534f73cf6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 18 Mar 2011 19:45:59 +0100 Subject: command: print playlist load error Call print_playlist_result() instead of casting the enum implicitly. --- src/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/command.c b/src/command.c index 781547b44..ce0aa97b7 100644 --- a/src/command.c +++ b/src/command.c @@ -749,7 +749,7 @@ handle_load(struct client *client, G_GNUC_UNUSED int argc, char *argv[]) result = playlist_open_into_queue(argv[1], &g_playlist); if (result != PLAYLIST_RESULT_NO_SUCH_LIST) - return result; + return print_playlist_result(client, result); result = playlist_load_spl(&g_playlist, argv[1]); return print_playlist_result(client, result); -- cgit v1.2.3