From 44b4b509499f7d5068a313f3ce9391bc6092f791 Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Sun, 9 Jan 2011 18:00:12 -0800 Subject: Modify version string to post-release version 0.16.2~git --- NEWS | 3 +++ configure.ac | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 96ada59ae..814a9d70d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +ver 0.16.2 (2010/??/??) + + ver 0.16.1 (2010/01/09) * audio_check: fix parameter in prototype * add void casts to suppress "result unused" warnings (clang) diff --git a/configure.ac b/configure.ac index c8a568ab4..a1e310575 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.16.1, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.16.2~git, musicpd-dev-team@lists.sourceforge.net) AC_CONFIG_SRCDIR([src/main.c]) AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2 subdir-objects]) AM_CONFIG_HEADER(config.h) -- cgit v1.2.3 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(-) 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 5735c9efc1e9980a61c9ab779f138ea0409801e4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 28 Jan 2011 12:21:03 +0100 Subject: configure.ac: fix tremor configure test When the configure options were moved around for 0.16, the order was changed, and the Tremor check broke. --- NEWS | 2 ++ configure.ac | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 814a9d70d..55fbfc099 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.16.2 (2010/??/??) +* decoder: + - tremor: fix configure test ver 0.16.1 (2010/01/09) diff --git a/configure.ac b/configure.ac index a1e310575..4fafb1899 100644 --- a/configure.ac +++ b/configure.ac @@ -934,13 +934,19 @@ if test x$enable_tremor = xyes; then ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $TREMOR_CFLAGS" LIBS="$LIBS $TREMOR_LIBS" - AC_CHECK_LIB(vorbisidec,ov_read,enable_vorbis=yes,enable_vorbis=no; + AC_CHECK_LIB(vorbisidec,ov_read,,enable_tremor=no; AC_MSG_WARN([vorbisidec lib needed for ogg support with tremor -- disabling ogg support])) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" +fi +if test x$enable_tremor = xyes; then AC_DEFINE(HAVE_TREMOR,1, [Define to use tremor (libvorbisidec) for ogg support]) + AC_DEFINE(ENABLE_VORBIS_DECODER, 1, [Define for Ogg Vorbis support]), +else + TREMOR_CFLAGS= + TREMOR_LIBS= fi AC_SUBST(TREMOR_CFLAGS) @@ -980,7 +986,7 @@ if test x$enable_vorbis = xyes; then fi fi -AM_CONDITIONAL(ENABLE_VORBIS_DECODER, test x$enable_vorbis = xyes) +AM_CONDITIONAL(ENABLE_VORBIS_DECODER, test x$enable_vorbis = xyes || test x$enable_tremor = xyes) dnl --------------------------------- sidplay --------------------------------- found_sidplay=$HAVE_CXX -- cgit v1.2.3 From 8f99c954ad89ad3eef5b4e013264c5cb8c6c97e6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 28 Jan 2011 21:12:17 +0100 Subject: NEWS: fix 0.16.1 release year --- NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 55fbfc099..fb394edfe 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,9 @@ -ver 0.16.2 (2010/??/??) +ver 0.16.2 (2011/??/??) * decoder: - tremor: fix configure test -ver 0.16.1 (2010/01/09) +ver 0.16.1 (2011/01/09) * audio_check: fix parameter in prototype * add void casts to suppress "result unused" warnings (clang) * input: -- 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 --- NEWS | 1 + src/update.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 1a90124b5..313a5c621 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.15.16 (2010/??/??) * encoders: - lame: explicitly configure the output sample rate +* update: log all file permission problems ver 0.15.15 (2010/11/08) 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. --- NEWS | 1 + src/decoder/gme_decoder_plugin.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS b/NEWS index fb394edfe..994bdf407 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.16.2 (2011/??/??) * decoder: - tremor: fix configure test + - gme: detect end of song ver 0.16.1 (2011/01/09) 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) --- NEWS | 2 ++ src/output/httpd_output_plugin.c | 1 + 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 994bdf407..5316279f5 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ ver 0.16.2 (2011/??/??) * decoder: - tremor: fix configure test - gme: detect end of song +* output: + - httpd: fix uninitialized variable ver 0.16.1 (2011/01/09) 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(-) 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 906efdd320a3cae4def4f95af2b7c09518085fba Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 13 Feb 2011 22:02:07 +0100 Subject: Makefile.am: compile test/run_encoder with ENCODER_CFLAGS --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.am b/Makefile.am index cf79d0903..547f57680 100644 --- a/Makefile.am +++ b/Makefile.am @@ -975,6 +975,8 @@ test_run_encoder_SOURCES = test/run_encoder.c \ src/audio_format.c \ src/audio_parser.c \ $(ENCODER_SRC) +test_run_encoder_CPPFLAGS = $(AM_CPPFLAGS) \ + $(ENCODER_CFLAGS) test_run_encoder_LDADD = $(MPD_LIBS) \ $(ENCODER_LIBS) \ $(GLIB_LIBS) -- 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. --- NEWS | 2 ++ src/output/ao_plugin.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 313a5c621..76571d0f0 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.15.16 (2010/??/??) +* output: + - ao: initialize the ao_sample_format struct * encoders: - lame: explicitly configure the output sample rate * update: log all file permission problems 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 e2574848709266dc9b74d588542342062fe562f6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 18 Feb 2011 08:19:37 +0100 Subject: Makefile.am: distribute test/stdbin.h --- Makefile.am | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.am b/Makefile.am index 547f57680..88eebe60f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -859,6 +859,7 @@ test_run_input_LDADD = $(MPD_LIBS) \ $(INPUT_LIBS) \ $(GLIB_LIBS) test_run_input_SOURCES = test/run_input.c \ + test/stdbin.h \ src/conf.c src/tokenizer.c src/utils.c \ src/tag.c src/tag_pool.c src/tag_save.c \ src/fd_util.c \ @@ -906,6 +907,7 @@ test_run_decoder_LDADD = $(MPD_LIBS) \ $(INPUT_LIBS) $(DECODER_LIBS) \ $(GLIB_LIBS) test_run_decoder_SOURCES = test/run_decoder.c \ + test/stdbin.h \ src/conf.c src/tokenizer.c src/utils.c src/log.c \ src/tag.c src/tag_pool.c \ src/replay_gain_info.c \ @@ -946,6 +948,7 @@ test_run_filter_LDADD = $(MPD_LIBS) \ $(SAMPLERATE_LIBS) \ $(GLIB_LIBS) test_run_filter_SOURCES = test/run_filter.c \ + test/stdbin.h \ src/filter_plugin.c \ src/filter_registry.c \ src/conf.c src/tokenizer.c src/utils.c \ @@ -968,6 +971,7 @@ endif if ENABLE_ENCODER noinst_PROGRAMS += test/run_encoder test_run_encoder_SOURCES = test/run_encoder.c \ + test/stdbin.h \ src/conf.c src/tokenizer.c \ src/utils.c \ src/tag.c src/tag_pool.c \ @@ -983,6 +987,7 @@ test_run_encoder_LDADD = $(MPD_LIBS) \ endif test_software_volume_SOURCES = test/software_volume.c \ + test/stdbin.h \ src/audio_check.c \ src/audio_parser.c \ src/pcm_volume.c @@ -990,6 +995,7 @@ test_software_volume_LDADD = \ $(GLIB_LIBS) test_run_normalize_SOURCES = test/run_normalize.c \ + test/stdbin.h \ src/audio_check.c \ src/audio_parser.c \ src/AudioCompress/compress.c @@ -1027,6 +1033,7 @@ test_run_output_LDADD = $(MPD_LIBS) \ $(OUTPUT_LIBS) \ $(GLIB_LIBS) test_run_output_SOURCES = test/run_output.c \ + test/stdbin.h \ src/conf.c src/tokenizer.c src/utils.c src/log.c \ src/audio_check.c \ src/audio_format.c \ -- 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(-) 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. --- NEWS | 1 + src/output/jack_plugin.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 76571d0f0..381417f87 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.15.16 (2010/??/??) * output: - ao: initialize the ao_sample_format struct + - jack: fix crash with mono playback * encoders: - lame: explicitly configure the output sample rate * update: log all file permission problems 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. --- NEWS | 1 + src/output/oss_plugin.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/NEWS b/NEWS index 5316279f5..64353a7c0 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ ver 0.16.2 (2011/??/??) - gme: detect end of song * output: - httpd: fix uninitialized variable + - oss: AFMT_S24_PACKED is little-endian ver 0.16.1 (2011/01/09) 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. --- NEWS | 1 + src/output/oss_plugin.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/NEWS b/NEWS index 64353a7c0..38fcd4155 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ ver 0.16.2 (2011/??/??) * output: - httpd: fix uninitialized variable - oss: AFMT_S24_PACKED is little-endian + - oss: disable 24 bit playback on FreeBSD ver 0.16.1 (2011/01/09) 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 5779146a7feed41f107b3865226134579a66135a 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: configure.ac: fix bashism in tremor test This makes FreeBSD detect libogg correctly. The '==' operator is an undocumented GNU extension to test(1) and cannot be relied upon to exist and do the right thing. POSIX mandates string comparisons to be done using "test foo = bar". --- NEWS | 2 ++ configure.ac | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 38fcd4155..8bff5aefe 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.16.2 (2011/??/??) +* configure.ac: + - fix bashism in tremor test * decoder: - tremor: fix configure test - gme: detect end of song diff --git a/configure.ac b/configure.ac index 4fafb1899..52740b0f7 100644 --- a/configure.ac +++ b/configure.ac @@ -635,7 +635,7 @@ fi AM_CONDITIONAL(ENABLE_LASTFM, test x$enable_lastfm = xyes) dnl ---------------------------------- libogg --------------------------------- -if test x$with_tremor == xno || test -z $with_tremor; then +if test x$with_tremor = xno || test -z $with_tremor; then PKG_CHECK_MODULES(OGG, [ogg], enable_ogg=yes, enable_ogg=no) fi -- 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 --- NEWS | 1 + src/output/httpd_output_plugin.c | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 8bff5aefe..f51f6122a 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ ver 0.16.2 (2011/??/??) - gme: detect end of song * output: - httpd: fix uninitialized variable + - httpd: include sys/socket.h - oss: AFMT_S24_PACKED is little-endian - oss: disable 24 bit playback on FreeBSD 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 4d4b7e3de076ed8cf4a4d1e780a43d777221a125 Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Sun, 13 Mar 2011 20:27:33 -0700 Subject: mpd version 0.15.16 --- NEWS | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 381417f87..38fc5a230 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.15.16 (2010/??/??) +ver 0.15.16 (2011/03/13) * output: - ao: initialize the ao_sample_format struct - jack: fix crash with mono playback diff --git a/configure.ac b/configure.ac index 8844a1dbe..9f212b583 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.15.16~git, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.15.16, musicpd-dev-team@lists.sourceforge.net) AC_CONFIG_SRCDIR([src/main.c]) AM_INIT_AUTOMAKE([foreign 1.9 dist-bzip2]) AM_CONFIG_HEADER(config.h) -- 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. --- NEWS | 2 ++ src/encoder/vorbis_encoder.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 5f7ef436c..1dfd71107 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ ver 0.16.2 (2011/??/??) * decoder: - tremor: fix configure test - gme: detect end of song +* encoder: + - vorbis: reset the Ogg stream after flush * output: - httpd: fix uninitialized variable - httpd: include sys/socket.h 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(+) 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(+) 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(-) 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(-) 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 From fe588a255ba713875a21bb98d3b7daf60af2844e Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Fri, 18 Mar 2011 17:43:11 -0700 Subject: mpd version 0.16.2 --- NEWS | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 1dfd71107..7bbb0fc8e 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -ver 0.16.2 (2011/??/??) +ver 0.16.2 (2011/03/18) * configure.ac: - fix bashism in tremor test * decoder: diff --git a/configure.ac b/configure.ac index 52740b0f7..6d0239f4a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(mpd, 0.16.2~git, musicpd-dev-team@lists.sourceforge.net) +AC_INIT(mpd, 0.16.2, musicpd-dev-team@lists.sourceforge.net) AC_CONFIG_SRCDIR([src/main.c]) AM_INIT_AUTOMAKE([foreign 1.10 dist-bzip2 subdir-objects]) AM_CONFIG_HEADER(config.h) -- cgit v1.2.3