Commit Graph

4137 Commits

Author SHA1 Message Date
Max Kellermann
65cc280e1a vorbis_encoder: fill the ogg_page in the read() method
Add the "flush" flag, and defer the ogg_stream_flush() call.  Call
ogg_stream_pageout() or ogg_stream_flush() (depending on the "flush"
flag) in vorbis_encoder_read().  This prevents the ogg_page from
getting overwritten by consecutive ogg_stream_pageout() calls.
2009-03-15 02:23:36 +01:00
Max Kellermann
c8c3920500 socket_util: added socket_bind_listen()
Moved code from listen_add_address() (listen.c) to socket_util.c.
2009-03-14 18:29:38 +01:00
Max Kellermann
dccb973cfe client: use the new fifo_buffer library 2009-03-14 17:46:01 +01:00
Max Kellermann
c76d35969b fifo_buffer: added buffering library
It is a library which I have written years ago for other projects.
This library is licensed under BSD 2-clause, because it is very
generic.
2009-03-14 17:30:00 +01:00
Max Kellermann
24bc277b69 doc: added "audio outputs" section to the user's manual 2009-03-14 16:01:56 +01:00
Max Kellermann
e12140cfce pcm_resample: choose the fallback resampler at runtime
Even if libsamplerate support is enabled, compile the fallback
resampler.  When the user specifies the option
"samplerate_converter=internal", it is chosen in favor of
libsamplerate.  This may help users with a weak FPU who don't want to
compile a custom MPD from source, because the fallback resampler does
not use floating point operations.
2009-03-14 15:26:36 +01:00
Max Kellermann
456201fa22 pcm_resample: renamed implementation functions
Added diversion functions to pcm_resample.c.  These check which
resampler is enabled at compile time (libsamplerate or fallback).
This prepares the following patch.
2009-03-14 15:26:28 +01:00
Max Kellermann
f1eed721d2 output_all: added missing "unused" attribute
In NDEBUG, clear_tail_chunk() does not use its "chunk" parameter.
2009-03-14 15:26:27 +01:00
Max Kellermann
975ca2dae5 output_all: include chunk.h
The source output_all.c accesses music_chunk struct members, but did
not include chunk.h directly.
2009-03-14 15:26:27 +01:00
Max Kellermann
d56aa88660 pcm_volume: use #ifdef instead of #if __i386__ 2009-03-14 14:39:48 +01:00
Max Kellermann
35a04ccf07 tag_pool: make "slots" static
The variable is private.
2009-03-14 14:38:48 +01:00
Max Kellermann
f711198ab3 pcm_resample: return NULL on failure
Changed "0" to "NULL".
2009-03-14 14:37:31 +01:00
Max Kellermann
8df0a29cbc pcm_convert: return NULL on failure
Changed "0" to "NULL".
2009-03-14 14:36:44 +01:00
Max Kellermann
e5767d6da8 command: return COMMAND_RETURN_OK in handle_addid()
At the last line of handle_addid(), the playlist_result value has
already been evaluated.  Don't return this variable, it's the wrong
type.
2009-03-14 14:36:07 +01:00
Max Kellermann
7b53504a41 command: handle the addToPlaylist() result properly
addToPlaylist() has a "enum playlist_result" return value.  Convert
that to "enum command_return" properly.
2009-03-14 14:33:19 +01:00
Max Kellermann
0007d84d95 faad: faad_decoder_decode() returns NULL, not false
On failure, the function should return NULL, not a boolean.
2009-03-14 14:31:38 +01:00
Max Kellermann
bd833f64e2 Makefile.am: don't let sparse scan C++ sources
sparse cannot deal with C++.
2009-03-14 14:30:02 +01:00
Max Kellermann
0a1db6cbc9 Makefile.am: added limit definitions to SPARSE_CPPFLAGS
sparse complains that a lot of limit.h macros are missing.  Define
them to keep sparse quiet.
2009-03-14 14:30:01 +01:00
Max Kellermann
d70591b652 sticker: sticker_load_value() returns NULL on error, not false
Turn the "return false" error handlers into "return NULL".
2009-03-14 14:29:54 +01:00
Max Kellermann
77eaab55a3 sticker: initialize hash table in sticker_new()
Moved the hash table initialization from sticker_list_values() to the
new function sticker_new().  This fixes a memory leak in
sticker_list_values().
2009-03-14 14:21:11 +01:00
Max Kellermann
be38ad5b93 sticker: don't export sticker_list_values()
sticker_list_values() is only used internally in sticker.c.  Remove
sticker_song_list_values() completely, it is superseded by
sticker_song_get().
2009-03-14 14:20:08 +01:00
Max Kellermann
24da9410fa command: use sticker_song_get() instead of sticker_song_list_values() 2009-03-14 14:20:04 +01:00
Max Kellermann
dd67992a0c sticker: added "struct sticker"
The sticker struct can be used for enumerating values.  This will
replace the sticker_list_values() function.
2009-03-14 14:20:01 +01:00
Max Kellermann
5b687795c4 mixer_all: removed debug message
Don't dump the volume of all mixers.
2009-03-14 11:54:39 +01:00
Max Kellermann
7deade8577 mixer: protect the mixer struct with a mutex
In some rare cases, there was a race condition between the output
thread and the main thread: when you disable/enable an output device
in the main thread, this caused a crash in the output thread.  Protect
the whole mixer struct with a GMutex to prevent that.
2009-03-14 11:53:28 +01:00
Max Kellermann
82963ee023 mixer_api: moved mixer_init() to mixer_api.c 2009-03-14 11:47:54 +01:00
Max Kellermann
b488355df8 mixer_api: moved mixer_plugin imports to mixer_list.h
This patch allows the output plugins to import only mixer_list.h,
instead of the full mixer_api.h (which would expose internal
structures).
2009-03-14 11:36:59 +01:00
Max Kellermann
a5017a2d7c mixer_api: moved functions to mixer_control.c
mixer_control.h should provide the functions needed to manipulate a
mixer, without exposing the internal mixer API (which is provided by
mixer_api.h).
2009-03-14 11:36:50 +01:00
Max Kellermann
8d01110c84 mixer_control: moved functions to mixer_all.c 2009-03-14 11:35:54 +01:00
Max Kellermann
88af35c0ab volume: moved code to mixer_all.c 2009-03-14 11:35:40 +01:00
Max Kellermann
e7c3f469c3 mixer_api: moved struct mixer_plugin to mixer_plugin.h 2009-03-14 11:33:51 +01:00
Max Kellermann
f15d879e37 volume: use bool instead of int
Return true/false on success/failure, instead of 0/-1.  Pass
true/false instead of 1/0 for the "rel" boolean parameter.
2009-03-14 11:10:21 +01:00
Jochen Keil
f31c371fbd Removed superfluous if statement in update.c:453
Check for NULL not necessary here
2009-03-14 09:33:55 +01:00
Avuton Olrich
0aee49bdf8 all: Update copyright header.
This updates the copyright header to all be the same, which is
pretty much an update of where to mail request for a copy of the GPL
and the years of the MPD project. This also puts all committers under
'The Music Player Project' umbrella. These entries should go
individually in the AUTHORS file, for consistancy.
2009-03-13 11:51:55 -07:00
Jeffrey Middleton
6e72755204 crossfade: added missing '&' 2009-03-12 20:23:46 +01:00
Max Kellermann
6352e75910 crossfade: copy chunk.audio_format in !NDEBUG
When the destination chunk was empty in cross_fade_apply(), it had no
audio_format attached (an attribute which is only used for assertion
in the debug build).  cross_fade_apply() should assign it the
audio_format of the second chunk (if available), otherwise MPD will
crash.
2009-03-12 19:49:15 +01:00
Max Kellermann
e3b9b57ecd output_all: fix off-by-one error in audio_output_all_check()
When there are chunks which are not yet finished,
audio_output_all_check() returned the size of its music pipe minus
one.  I can't remember exactly why I subtracted 1 from the return
value, it must have had something to do with a former meaning of this
function.  Now it induces assertion failures.
2009-03-12 19:49:10 +01:00
Max Kellermann
d8218cae6b Makefile.am: link test/software_volume with GLib
That linker flag got lost when AM_LDFLAGS was removed.
2009-03-12 19:41:11 +01:00
Max Kellermann
0bc7f584f4 mixer_control: don't touch mixers of disabled outputs
When an audio output device is disabled, also disable its mixer.
2009-03-12 18:40:03 +01:00
Max Kellermann
c37567a14f audio: converted device number check to assertion
No caller must ever pass an invalid device number to
mixer_control_setvol() or mixer_control_getvol().
2009-03-12 18:34:38 +01:00
Max Kellermann
e9cbb6be3f audio: moved mixer functions to mixer_control.c 2009-03-12 18:34:37 +01:00
Max Kellermann
9feaedd799 volume: removed unused variable "default_mixer" 2009-03-12 18:24:13 +01:00
Max Kellermann
869f440f87 doc: added installation manual to the User's Manual
Very small start..
2009-03-12 17:12:53 +01:00
Max Kellermann
0cb8e7f2cb doc: added skeleton for the user manual 2009-03-12 17:06:48 +01:00
Eric Wollesen
e2dc3c948f Move from the opaque GPtrArray to GHashTable for sticker lists. 2009-03-11 17:03:01 -06:00
Diego Elio 'Flameeyes' Pettenò
ce6ef89f26 Pass glib libs properly to libtool.
Passing libraries through LDFLAGS is a mistake that causes link to fail
when using --as-needed. Since the ld arguments are positional, so are
libtool's. Use the proper variable, thus, to pass the libraries.
2009-03-11 12:45:46 +01:00
Max Kellermann
bc3702a4fd player_thread: added comments 2009-03-11 09:35:16 +01:00
Max Kellermann
13cd6b2834 player_thread: removed player_stop_decoder()
Replaced both player_stop_decoder() invocations with player_dc_stop(),
which also cleans up the pipe.
2009-03-11 09:20:34 +01:00
Max Kellermann
903a07b80e player_thread: don't call dc_stop() twice
In the "CANCEL" command handler, the decoder is stopped twice: first
by player_dc_stop(), then by dc_stop().  Remove the latter.
2009-03-11 09:20:33 +01:00
Max Kellermann
a7318a6476 configure.ac: add -pg to MPD_LIBS with --enable-gprof 2009-03-11 09:20:29 +01:00