Commit Graph

2814 Commits

Author SHA1 Message Date
Max Kellermann
cad37b2e5a decoder: wrapper functions for methods stream_decode() and file_decode()
Added lots of assertions to the wrapper functions.
2008-11-10 15:02:38 +01:00
Max Kellermann
84b540f435 decoder: added more assertions
Added a lot of assertions checking the state of the decoder plugin.
2008-11-10 15:02:26 +01:00
Max Kellermann
23a4ce4444 flac: call flac_process_metadata() for ogg files
The flac plugin wasn't initialized properly when an OGG file was being
decoded.  For some reason, flac_process_metadata() was explicitly not
called for OGG files.  Since that seems to fix the issue, make it
always call flac_process_metadata().
2008-11-10 14:49:34 +01:00
Max Kellermann
0e87f85598 flac: enable the oggflac plugin with older libflac versions
Since decoder_list.c does not include the libflac headers, it cannot
know whether to add the oggflac plugin to the decoder list.  Solve
this by always enabling the oggflac sub-plugin, even with older
libflac versions.  When the libflac API cannot support oggflac,
disable the plugin at runtime by returning "false" from its init()
method.
2008-11-10 14:39:42 +01:00
Max Kellermann
505959f74d flac: enable oggflac with libflac
The "oggflac" plugin was enabled only if HAVE_FLAC_COMMON was
defined.  HAVE_FLAC_COMMON however is only an automake variable, and
is never available in decoder_list.c.  Make decoder_list.c depend on
HAVE_FLAC||HAVE_OGGFLAC instead.
2008-11-10 14:37:37 +01:00
Daniel Schömer
1256f90825 log: properly check log_threshold 2008-11-09 22:27:58 +01:00
Max Kellermann
c9c7dc6e00 decoder: updated API documentation
Updated documentation on the stream_decode() and file_decode() return
values.
2008-11-09 22:10:48 +01:00
Max Kellermann
ab24e203cd wavpack: removed try_decode() method
Wavpack's try_decode() implementation does nothing useful, it only
duplicates code already in stream_decode() / file_decode(), and slows
down MPD.
2008-11-09 22:10:48 +01:00
Max Kellermann
b054ad0ea6 flac: make the init() method check for oggflac support
Disable flac's "oggflac" sub-plugin when libflac does not support
ogg-flac files.
2008-11-09 22:01:47 +01:00
Max Kellermann
72eba30cf4 decoder: converted dc.error to a dc.state value
The player did not care about the exact error value, it only checked
whether an error has occured.  This could fit well into
decoder_control.state - introduce a new state "DECODE_STATE_ERROR".
2008-11-08 15:48:00 +01:00
Max Kellermann
8cbdc2667e decoder: removed "plugin" from the decoder struct
decoder.plugin was a write-only attribute.
2008-11-08 13:33:44 +01:00
Laszlo Ashin
343a8a20e3 wavpack: make 24-bit samples available for mpd
This patch makes 24-bit samples available for mpd. I tested with the
WavPack Test Suite found on wavpack.com:

 http://www.rarewares.org/wavpack/test_suite.zip

Every test file worked fine.
2008-11-08 13:11:10 +01:00
Laszlo Ashin
3e338da871 wavpack: check last_byte in push_back_byte() method
At this moment the wavpack lib doesn't use the return value of the
push_back function, which has an equivalent meaning of the return
value of ungetc().  This is a lucky situation, because so far it
simply returned with 1 as a hard coded value.  From now on the
function will return EOF on error.  (This function makes exactly one
byte pushable back.)
2008-11-08 13:10:15 +01:00
Laszlo Ashin
cfd55b29bd wavpack: wrapper for converting void* to struct wavpack_input*
A new function has been added to do a cast and a little check in the
wavpack-mpd input stream wrapper.
2008-11-08 13:09:07 +01:00
Laszlo Ashin
2b4a410bb0 wavpack: put braces around one line code blocks
I think this makes the code more easily modifiable and prevents some
annoying mistakes.
2008-11-08 13:08:21 +01:00
Laszlo Ashin
d68df99ef4 wavpack: added prefix to local function names
There are some functions in the wavpack-mpd input streams wrapper
which had too commonly used names (especially can_seek). I prefixed
these with "wavpack_input_".
2008-11-08 13:07:40 +01:00
Laszlo Ashin
ff2e69c003 wavpack: unified code style
Not every function header has its return type in a distinct line. This
patch corrects that.  This way there is more space for the arguments.
2008-11-08 13:07:09 +01:00
Max Kellermann
343f2ac3fc configure.ac: enable _ogg_common.c when flac is enabled
The build failed when the oggvorbis and oggflac decoders were
disabled, because the flac decoder references a symbol from
_ogg_common.c.
2008-11-07 17:21:21 +01:00
Max Kellermann
2172505f5c configure.ac: added AC_CONFIG_SRCDIR 2008-11-07 17:14:52 +01:00
Tom Servo
ea92576219 listen: fix namespace collision on OpenSolaris
The listen.c module breaks the build because the variable name used
("sun") for the Unix domain socket part collides with something else
on an OpenSolaris system, likely Sun specific.  Renaming it to _sun
(or something else of choice) fixes the build.

[mk: renamed to "s_un"]
2008-11-07 10:33:48 +01:00
Laszlo Ashin
2e0ba90208 wavpack: check wvc seekability
Using wvc streams the seekableness depends on the seekability of the
wvc stream as well.
2008-11-06 06:48:33 +01:00
Laszlo Ashin
56d2b51056 wavpack: close wvc stream on error
The input stream opened for wvc is not closed in an if branch.  A
close call has been added.
2008-11-06 06:48:33 +01:00
Laszlo Ashin
089c9b7e5c wavpack: enable seeking
Somehow seeking is disabled on all kinds of wavpack playbacks now in
the git version.  This patch corrects that.
2008-11-06 06:48:33 +01:00
Max Kellermann
dcfb205c46 input_curl: retrieve error message from ERRORBUFFER
libcurl provides better error messages than curl_multi_strerror() when
you set the ERRORBUFFER option.
2008-11-06 06:48:30 +01:00
Max Kellermann
e2d7318a18 input_curl: return 0 on error from read()
The read() method must not return a negative value.  Make it return 0
on error, just like the file input stream.  Also set the "error"
attribute to -1.
2008-11-06 06:44:19 +01:00
Max Kellermann
a8e81326d0 input_curl: enable FAILONERROR
I had this option enabled during development, but at some point, it
must have gotten lost.  FAILONERROR makes the curl stream fail when
the server returns a status code 400 or higher.  We are not interested
in the server's error document.
2008-11-06 06:36:25 +01:00
Max Kellermann
91c1a279e4 MPD version 0.14~alpha1
First alpha version for the upcoming version 0.14.
2008-11-05 21:50:53 +01:00
Max Kellermann
19d3345ab8 path: removed superfluous error check in path_set_fs_charset()
The code which had a possible error condition had been removed.
2008-11-05 21:42:55 +01:00
Max Kellermann
5b2e981253 log: check if log_charset is set
When logging to a file, log_charset would be NULL and g_convert()
would abort.
2008-11-05 21:40:08 +01:00
Max Kellermann
fce8fa0b31 NEWS: updated 0.14 changelog
Adding some of the most important changes since 0.13.
2008-11-05 21:30:05 +01:00
Max Kellermann
2916ef84e4 NEWS: reformatted 0.14 items
Trying to bring a little bit of structure into that list.
2008-11-05 21:29:25 +01:00
Max Kellermann
551aa767ae README: added version number to GPL
MPD is licensed under the version 2 of the GNU General Public License
version 2.  Also added "General".
2008-11-05 21:29:04 +01:00
Max Kellermann
77910edf11 README: removed mp4ff
MPD doesn't include the mp4ff library anymore.
2008-11-05 21:28:47 +01:00
Max Kellermann
efd919a626 UPGRADING: added a 0.14 section 2008-11-05 21:27:30 +01:00
Max Kellermann
1fe987fea2 INSTALL: update dependency list
Documented dependencies on gcc/C99, glib, libvorbisenc, liblame,
ffmpeg.
2008-11-05 21:27:20 +01:00
Max Kellermann
b0f1bc4856 Makefile.am: distribute input_curl.h
input_curl.h was missing in the tarball because it was not listed in
$(mpd_headers).
2008-11-05 21:23:56 +01:00
Max Kellermann
7f880ab8ba main: print usage to stdout
Using the logging library here is inappropriate.
2008-11-05 20:52:14 +01:00
Max Kellermann
130fa94423 log: convert messages to system charset
When logging to the terminal, we should print messages in the system
character set.  Convert all messages in this case.
2008-11-05 18:39:13 +01:00
Max Kellermann
787c6f5e18 log: use bool
Use the bool data type for flags.
2008-11-05 18:39:10 +01:00
Max Kellermann
4c967a6ba2 log: provide a GLib logging handler
Install a default handler which writes to stdout or stderr, and
prepends a time stamp.  This looks just like the 0.13.x logger.
2008-11-05 18:38:55 +01:00
Max Kellermann
a5348a3786 log: use GLib message logging
The logging functions from log.h are deprecated, and the code should
use GLib logging instead.  Make ERROR(), WARNING() etc. call g_logv()
internally.
2008-11-05 18:38:30 +01:00
Max Kellermann
a05fa5cdbb log: no CamelCase
Renamed the variable "logLevel" to "log_threshold".
2008-11-05 18:38:23 +01:00
Max Kellermann
08aaf57ff0 log: removed warning buffer
The warning buffer is a complex piece of code for no good reason.
Remove it and find a better solution, e.g. open the log file earlier.
2008-11-05 18:37:40 +01:00
Max Kellermann
b35ca9e5c4 main: initialize locale (LC_CTYPE)
Initialize libc's locale functions.  Currently, we are only interested
in LC_CTYPE (character classification), because this is what is used
by GLib's g_get_charset().
2008-11-05 18:37:39 +01:00
Max Kellermann
2a1a37107f path: don't allocate charset twice
Make the local variable "charset" const, and don't duplicate its
value.  It is already duplicated by path_set_fs_charset().
2008-11-05 18:26:45 +01:00
Max Kellermann
6a7a26fe42 path: get filesystem charset from GLib
GLib provides the function g_get_filename_charsets() which determines
the file system character set.  This changes MPD's fallback: GLib
prefers UTF-8 as a fallback.  MPD used to fall back to ISO Latin 1.
2008-11-05 18:25:57 +01:00
Max Kellermann
3002fd18cb path: no CamelCase
Rename variables and functions.
2008-11-05 18:21:52 +01:00
Max Kellermann
259c6ed164 enable GLib threading
Call g_thread_init() from main() to enable the GLib features which
make it thread safe.
2008-11-05 18:21:49 +01:00
Max Kellermann
06f9b6c379 main: don't close all file descriptors on startup
Removed closeAllFDs().  The caller is responsible for closing all file
handles.
2008-11-05 18:21:36 +01:00
Max Kellermann
5d6e96e986 pulse: removed reconnect interval
The output thread automatically waits some time before retrying to
open the device.  Don't duplicate this check in the pulse plugin.
2008-11-05 08:10:13 +01:00