Commit Graph

2925 Commits

Author SHA1 Message Date
Max Kellermann 5c19776f2f input_stream: use "bool" instead of "int"
For boolean values and success flags, use bool instead of integer (1/0
for true/false, 0/-1 for success/failure).
2008-10-26 20:56:46 +01:00
Max Kellermann 464b611772 input_stream: input_stream_close() returns void
close() shouldn't fail with read-only streams.
2008-10-26 20:54:52 +01:00
Max Kellermann f08041f0eb input_stream: added struct input_plugin
Instead of managing a set of method pointers in each input_stream
struct, move these into the new input_plugin struct.  Each
input_stream has only a pointer to the plugin struct.  Pointers to all
implementations are kept in the array "input_plugins".
2008-10-26 20:38:44 +01:00
Max Kellermann dbc7e9ba2f input_stream: no CamelCase
Renamed all functions and variables.
2008-10-26 20:34:47 +01:00
Max Kellermann 97a9c7a8e0 input_file: removed global constructor
The global constructor is empty, and can be removed.
2008-10-26 20:34:33 +01:00
Max Kellermann 23552f89cc input_file: don't export internal methods
The methods are only used in inputStream_fileOpen(), and should not be
exported.
2008-10-26 20:34:03 +01:00
Max Kellermann 21b8590b53 input_stream: removed the InputStream typedef
Everybody should use struct input_stream.
2008-10-26 19:54:57 +01:00
Max Kellermann bbaedb17d5 input_stream: renamed sources, no CamelCase
Renamed inputStream.c and inputStream_file.c.
2008-10-26 19:38:50 +01:00
Max Kellermann 3609de8685 http: use libcurl
MPD's HTTP client code has always been broken, no matter how effort
was put into fixing it.  Replace it with libcurl, which is known to be
quite stable.  This adds a fat library dependency, but only for people
who need streaming.
2008-10-26 19:32:43 +01:00
Max Kellermann 6b09e4daef input_stream: added input_stream_global_finish()
The hook input_stream_global_finish() deinitializes global structures
of all input stream implementations.
2008-10-26 19:30:13 +01:00
Max Kellermann 4bc2def15c stored_playlist: fixed signed comparison warning
Cast playlist_max_length to off_t before comparing it to stat.st_size.
2008-10-26 16:26:44 +01:00
Max Kellermann 4fa36a15bf command: removed range check from check_bool()
check_bool() accepts only "0" or "1".  The range check is superfluous.
2008-10-26 16:19:33 +01:00
Max Kellermann ece8c1347c renamed src/audioOutputs/ to src/output/
Again, no CamelCase in the directory name.
2008-10-26 11:29:44 +01:00
Max Kellermann e11355f47d renamed src/inputPlugins/ to src/decoder/
These plugins are not input plugins, they are decoder plugins.  No
CamelCase in the directory name.
2008-10-26 11:29:25 +01:00
Max Kellermann cbc71191f0 configure.ac: reverted protocol version to 0.14.0
Several clients refuse to accept the protocol version "0.14~git",
because they think it is malformed.  This is clearly a client bug, but
we cannot wait for all clients to fix this bug right now.  For now,
change the version back to "0.14.0".
2008-10-26 10:32:20 +01:00
Max Kellermann 20ec1a4810 Makefile.am: install documentation 2008-10-25 21:32:10 +02:00
Max Kellermann c7d556f739 renamed ChangeLog to NEWS
The file name "NEWS" is standardized.
2008-10-25 21:31:13 +02:00
Max Kellermann f9d52dc968 configure.ac: changed version number to "0.14~git"
For testers, it should be clear that they're not using version 0.14.0
final, but an inofficial intermediate version from the git repository.
The protocol version is set to the same string, since the protocol is
subject to change during MPD development.
2008-10-25 21:23:54 +02:00
Max Kellermann befecb1d47 configure.ac: disable libtool
Since we're not building the local mp4ff library anymore, we can
remove AC_PROG_LIBTOOL.
2008-10-25 21:23:52 +02:00
Max Kellermann 1110a6d410 removed internal copy of libmp4ff
MPD shouldn't integrate sources of other libraries.  Since libmp4ff is
part of libfaad, we should remove the old copy from src/mp4ff and link
with the current version from libfaad instead.
2008-10-25 20:59:36 +02:00
Max Kellermann a02db57291 pulse: force 16 bit audio sample format
PA_SAMPLE_S16NE is the only sample format which is suported by both
MPD and pulseaudio.  Unfortunately, pulse does not accept 24 bit
samples.

Instead of bailing out with an error message, we should tell the MPD
core to convert all samples to 16 bit for pulse.
2008-10-25 20:41:28 +02:00
Eric Wong 0fd6fa9927 AUTHORS: Eric Wong is a former developer
Eric is too busy with other projects and will remain inactive
indefinitely.
2008-10-25 19:50:59 +02:00
Max Kellermann ee499cb42f player: don't clear command before do_play() returns
This bug caused the audio output devices to stay open, although MPD
wasn't playing: quitDecode() resetted player_control.command, assuming
that the command was STOP.  This way, player_task() didn't see the
CLOSE_AUDIO command, and the device was kept open.

Don't clear player_control.command in quitDecode().
2008-10-24 17:50:24 +02:00
Max Kellermann 18c6ebb023 remove unused sources
These are results from failed merges which I didn't notice.
2008-10-24 17:41:13 +02:00
Max Kellermann f4e6bb2815 jack: support for 24 bit samples
When the audio source provides 24 bit samples, don't bother to convert
(lossily) them to 16 bit before jack's floating point conversion - go
directly from 24 bit to float.
2008-10-24 17:36:11 +02:00
Max Kellermann b1adfaae43 jack: moved code to jack_write_samples_16()
Move sample format dependent code to a separate function.
2008-10-24 17:34:47 +02:00
Max Kellermann 03a077e8a4 jack: eliminated CamelCase
Renamed all variables and functions.  Add the prefix "mpd_jack_" to
function names.
2008-10-24 17:29:37 +02:00
Max Kellermann e19f0a8dbc jack: added assertions against partial frames
We must never pass partial frames.  Added assertions to debug this.
2008-10-24 16:56:10 +02:00
Max Kellermann e7cd237674 jack: optimize local variables
Merge the variables "avail_data" and "avail_frames" into "available".
Both variables are never used at the same time.
2008-10-24 16:56:08 +02:00
Max Kellermann 0a6704420b jack: lockless data transfer to jack thread
The JACK documentation postulates that the process() callback must not
block, therefore locking is forbidden.  Anyway, the old code was racy.

Remove all locks, and don't wait for more data to become available -
just send to the port what is already in the buffer.
2008-10-24 16:55:51 +02:00
Max Kellermann 4ecdaabbb0 jack: partial writes to ring buffer
Don't wait until there is room for the full data chunk passed to
jack_playAudio().  Try to incrementally send as much as possible into
the ring buffer.
2008-10-24 16:39:43 +02:00
Max Kellermann 91ad576aad jack: added constant "frame_size"
Don't hard-code a frame size of "4" (16 bit stereo), calculate the
sample size from sizeof(*buffer), and create the constant
"frame_size".
2008-10-24 15:47:52 +02:00
Max Kellermann 9d6651d8b2 jack: fix indentation
Indent with tabs.
2008-10-24 08:44:40 +02:00
Max Kellermann 8b4829c2fe pcm_resample: support for libsamplerate < 0.1.3
libsamplerate 0.1.2 didn't have the 32 bit <-> float conversion
routines.  Emulate them in case they aren't supported.
2008-10-24 08:41:34 +02:00
Max Kellermann 5fefa954a3 player: don't send partial frames of silence
Another partial frame fix: the silence buffer was 1020 bytes, which
had room for 127.5 24 bit stereo frames.  Don't send the partial last
frame in this case.
2008-10-23 20:54:52 +02:00
Max Kellermann 4eadb0f7aa pcm_utils: added 24 bit conversion functions
24 bit output is as important as 16 bit output.  Provide a
pcm_convert() implementation which can convert to 24 bit with as
little quality loss as possible.
2008-10-23 20:11:37 +02:00
Max Kellermann ec37633f1c pcm_utils: generic pcm_convert_size() implementation
The old pcm_convert_size() ignored most of the destination format,
e.g. it did not check its sample size, and assumed it is 16 bit.
Simplify and universalize it by using audio_format_frame_size().
2008-10-23 20:11:28 +02:00
Max Kellermann 98e4817548 pcm_utils: moved code to pcm_convert_16()
pcm_convert() converted only to 16 bit.  To be able to support other
sample sizes, move that 16 bit specific code to a separate function.
2008-10-23 20:11:24 +02:00
Max Kellermann 8489e90c1e pcm_channels: added 24 bit implementations
The 24 bit implementation is mostly copy'n'paste of the 16 bit
version, except that the data type is int32_t instead of int16_t.
2008-10-23 20:04:37 +02:00
Max Kellermann a0bcbb37f4 pcm_utils: moved channel conversion functions to pcm_channels.c
Separate code from pcm_utils.c to keep it small and simple.
2008-10-23 20:03:14 +02:00
Max Kellermann af7cb932fb pcm_resample: implemented 24 bit resampling
Similar to pcm_resample_16(), implement pcm_resample_24().  The 24 bit
implementation is very similar, but it uses src_int_to_float_array()
instead of src_short_to_float_array() before sending data to
libsamplerate.
2008-10-23 20:02:51 +02:00
Max Kellermann 5bbcbfb7ce pcm_resample: moved code to pcm_resample_set()
A future patch will implement a 24 bit resampler.  To unify code, move
code which can be shared to a separate function.
2008-10-23 20:02:09 +02:00
Max Kellermann 1dcb946fb0 pcm_resample: eliminated "sample" local variables
Copy from source to destination buffer directly, don't use the
temporary variables "lsample" and "rsample".
2008-10-23 20:01:37 +02:00
Max Kellermann 124f79a2a6 pcm_resample: don't resample partial samples
Added assertions which ensure that there are no partial samples in the
source buffer.
2008-10-23 20:01:12 +02:00
Max Kellermann b13d656f81 pcm_resample: don't hard-code sample size
Use sizeof(sample) instead of hard-coding "2".  Although we're in 16
bit right now, this will make code sharing easier when we support
other sample sizes.
2008-10-23 20:01:08 +02:00
Max Kellermann 6b1c54ef96 pcm_utils: moved code to pcm_resample.c
Separate the resampling code from the rest of pcm_utils.c.  Create two
sub-libraries: pcm_resample_libsamplerate.c and
pcm_resample_fallback.c.
2008-10-23 20:00:51 +02:00
Max Kellermann 098991f8e8 command: fix boolean value parser
Due to a logic error, no value was valid for the boolean value
parser.  Replace "||" with "&&".
2008-10-23 18:06:05 +02:00
Max Kellermann 2cc2420f8c mp3: send 24 bit PCM data
libmad produces samples of more than 24 bit.  Rounding that down to 16
bits using dithering makes those people lose quality who have a 24 bit
capable sound device.  Send 24 bit PCM data, and let the receiver
decide whether to apply 16 bit dithering.
2008-10-23 16:58:38 +02:00
Max Kellermann bf5774edbd mp3: use sizeof(sample) instead of hard-coded "2"
We are going to convert the code to 24 bit; don't hard-code a sample
size of 2 bytes.
2008-10-23 16:58:14 +02:00
Max Kellermann 0078837a97 pcm_dither: added generic 24 to 16 bit dithering
Copied and adapted code from the mp3 decoder plugin.  This library now
replaces the old and low-quality function pcm_convert_24_to_16().
2008-10-23 16:58:07 +02:00