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
Max Kellermann
923ac213b5
output_control: removed audio_output_signal()
...
This function was part of a workaround which we don't need anymore.
2009-03-10 22:48:12 +01:00
Jochen Keil
756b0022da
Cleaned up update_regular_file() method in update.c
...
After adding the container_scan() method the update_regular_file() method was quite hard to read.
Now there's update_container_file() which deals with container files.
That way normal container files (i.e. without embedded tracks) are handled by the old code like a regular file.
This will fix some of the odd behaviour observed.
2009-03-10 22:09:51 +01:00
Max Kellermann
cff29f5e86
alsa: use snd_pcm_sframes_t instead of int
...
snd_pcm_writei() returns the type snd_pcm_sframes_t, not int. Use the
correct variable type.
2009-03-10 21:31:13 +01:00
Max Kellermann
855054fee1
alsa: don't close PCM handle in alsa_recover()
...
If the PCM handle gets disconnected, don't close and clear it in
alsa_recover(). The MPD core will call alsa_close() anyway. This
way, we can always assume that alsa_data.pcm is always valid.
2009-03-10 21:25:45 +01:00
Max Kellermann
538701e7c6
player_thread: fill buffer after seeking
...
After a seek, wait until enough new chunks are decoded before starting
playback. If this takes too long, send silence chunks to the audio
outputs meanwhile.
2009-03-10 21:19:51 +01:00
Max Kellermann
2b57863144
output_all: clear input_audio_format on close
...
When the audio outputs are closed, also clear the audio format. If we
don't do this, every call to audio_output_all_update() will open the
device, even if it's meant to be paused.
2009-03-10 21:04:47 +01:00