Commit Graph

2874 Commits

Author SHA1 Message Date
Max Kellermann 0b29a22c08 conf: replaced getConfigParamValue() with config_get_string()
Don't return a writable pointer.
2009-01-17 20:23:58 +01:00
Max Kellermann 7acc62366c conf: replaced getBoolBlockParam() with config_get_block_bool()
No "force" parameter, pass a default value instead.
2009-01-17 20:23:56 +01:00
Max Kellermann a1a97cc048 conf: use config_get_bool() instead of getBoolConfigParam() 2009-01-17 20:23:33 +01:00
Max Kellermann 4d472c265e conf: no CamelCase, part I
Renamed functions, types, variables.
2009-01-17 20:23:27 +01:00
Max Kellermann 2bbf378dd8 song: skip archive check for non-musicdir files
If a song is not within the music directory ("file:///..."), it has no
"parent directory".  The archive code nonetheless dereferences the
parent pointer, causing a segmentation fault.  Check parent!=NULL.
2009-01-17 19:56:36 +01:00
Max Kellermann 7f3be96efa decoder_api: always notify_wait() for free chunks
One of the previous patches made MPD consume 100% CPU in a busy wait:
when the music_pipe was full, it did not wait (with notify_wait()) for
free chunks, because a variable has a different meaning now.  Always
pass "true" as the "wait" parameter.
2009-01-17 15:23:57 +01:00
Max Kellermann 5395f5f6b3 moved fallback APE/ID3 tag loader to song.c
Some plugins used the APE or ID3 tag loader as a fallback when their
own methods of loading tags did not work.  Move this code out of all
decoder plugins, into song_file_update().
2009-01-17 13:23:42 +01:00
Max Kellermann 43eefe9c41 decoder_api: pass const pointer to decoder_data() 2009-01-17 13:23:12 +01:00
Max Kellermann 356526457c pcm_convert: return PCM buffer from pcm_convert()
Removed yet another superfluous buffer layer: return the PCM buffer
from pcm_convert() instead of copying PCM data into the
caller-supplied buffer.
2009-01-17 13:11:16 +01:00
Max Kellermann e726e2a004 music_pipe: removed music_pipe_append()
The function is unused, since decoder_api() uses music_pipe_write() /
music_pipe_expand() now.
2009-01-17 13:11:11 +01:00
Max Kellermann 610e79500e decoder_api: use music_pipe_write() instead of music_pipe_append()
Copy PCM data to the music_pipe_write() buffer, and apply replay gain
/ normalization to it, instead of manipulating the source buffer.
2009-01-17 13:11:10 +01:00
Max Kellermann fd948571f8 music_pipe: added functions music_pipe_write() and music_pipe_expand()
This new API gives the caller a writable buffer to the music pipe
chunk.  This may allow the caller to eliminate several buffer copies,
because it may manipulate the returned buffer, until it calls
music_pipe_expand().
2009-01-17 13:09:29 +01:00
Max Kellermann d83eff80a5 oggvorbis: disable seeking on remote songs
When libvorbis knows that a song is seekable, it seeks around like
crazy in the file before starting to decode it.  This is very
expensive on remote HTTP resources, and delays MPD for 10 or 20
seconds.

This patch disables seeking on remote songs, because the advantages of
quickly playing a song seem to weigh more than the theoretical ability
of seeking for most MPD users.  If users feel this feature is needed,
we will make a configuration option for that.
2009-01-17 11:46:31 +01:00
Max Kellermann da6f8c270a decoder_api: added assertion on partial frames
Decoder plugins must not send partial frames.
2009-01-16 18:53:32 +01:00
Max Kellermann 953b258e5e pcm_resample_fallback: corrected the sample calculation
Due to rounding errors, it was possible that the fallback resampler
returned partial frames.
2009-01-16 18:52:01 +01:00
Max Kellermann 285a741b27 playlist: don't store getBoolConfigParam() in a bool
getBoolConfigParam() returns an int.  It is not possible to check for
CONF_BOOL_UNSET after it has been assigned to a bool; use a temporary
int value for that.
2009-01-16 17:11:18 +01:00
Max Kellermann 2a7d99702f listen: explicitly include sys/socket.h 2009-01-16 17:11:18 +01:00
Max Kellermann b19a8505f4 player_control: fix shadow warning with older gcc
Older gcc versions complained about shadowed parameters in prototypes.
2009-01-16 17:11:18 +01:00
Max Kellermann 106bfaa726 oss: evaluate the oss_open() return value properly
It returns bool, not int.
2009-01-16 17:11:18 +01:00
Max Kellermann b12b5130c9 mixer: check param==NULL in the alsa and oss mixer code
When MPD starts without audio output configuration, the "param"
variable is NULL.  This triggers a segmentation fault in both mixer
plugins.
2009-01-16 17:11:18 +01:00
Qball Cow b533307d6f Enable wav file streaming for ffmpeg input plugin 2009-01-16 17:11:16 +01:00
Rasmus Steinke 3e87e4f3ab flac: map "Album Artist" to "AlbumArtist"
This patch allows mpd to recognise the albumartist tag in the way
foobar2000 and others write it to files.
2009-01-15 22:45:29 +01:00
Max Kellermann 9cc373d62d flac: splitted flac_copy_vorbis_comment()
Splitted flac_copy_vorbis_comment() into flac_copy_comment() and
flac_copy_comment().
2009-01-15 22:45:28 +01:00
Max Kellermann 0dec3f787f flac: moved code to flac_comment_value()
Simplify flac_copy_vorbis_comment() by moving the comment
identification code out.
2009-01-15 22:44:21 +01:00
Max Kellermann f30adc3526 flac: always allocate tag object
Free the tag object when it turns out to be empty.  This simplifies
several functions and APIs.
2009-01-15 22:43:39 +01:00
Max Kellermann ccea365494 tag: added tag_is_defined()
tag_is_defined() checks whether there is any information in the tag
object.
2009-01-15 22:00:26 +01:00
Max Kellermann 15435b09af flac: use bool instead of int 2009-01-15 19:57:57 +01:00
Max Kellermann 8307dd3e87 flac: removed "vorbis_comment_found" flag
Use tag_is_empty() instead.
2009-01-15 19:53:07 +01:00
Max Kellermann 86dc79293f flac: no CamelCase
Renamed types, functions, variables.
2009-01-15 19:50:28 +01:00
Max Kellermann a7461dc27d input_curl: don't call input_curl_select() when already at EOF
Calling input_curl_select() after EOF has been reached causes an
assertion failure.  This can happen if the HTTP response is empty.
Check c->eof before calling input_curl_select().
2009-01-15 16:16:57 +01:00
Max Kellermann f1790fc8bf input_curl: set "ready" flag on EOF
Set the "ready" flag for empty resources.
2009-01-15 16:16:55 +01:00
Max Kellermann fa3899f7b0 input_curl: call curl_multi_info_read() in constructor
To check for early connect failures, call curl_multi_info_read() in
the constructor input_curl_open().  This fixes an assertion failure.
2009-01-15 16:16:53 +01:00
Max Kellermann 08e18f7070 input_curl: added fallback for g_queue_clear()
g_queue_clear() was introduced in GLib 2.14.  Add a macro hack for
older GLib versions to emulate it.
2009-01-15 09:20:01 +01:00
Max Kellermann 29baf0c190 log, pcm_convert: added return statements after g_error()
gcc doesn't know that g_error() never returns.  Work around the gcc
warning.
2009-01-15 09:17:06 +01:00
Max Kellermann 2151e2ea53 mapper: check if g_get_user_special_dir() is supported by GLib
g_get_user_special_dir() was introduced with GLib 2.14.  Don't use it
in older versions.
2009-01-15 09:16:20 +01:00
Max Kellermann 6139174d81 pcm_convert: removed unused variable "dest_size"
dest_size is only used in an assertion.  Remove its declaration and
move the formula into the assertion.
2009-01-15 08:35:58 +01:00
Max Kellermann 8fe867c71d decoder_api: added G_GNUC_UNUSED attribute to decoder_initialized()
In NDEBUG, the parameter "decoder" is not used.
2009-01-15 08:33:32 +01:00
Max Kellermann 5232f05470 listen: don't compile ipv6Supported() if !HAVE_IPV6
The function ipv6Supported() is not used at all when IPv6 support was
disabled at compile time.
2009-01-15 08:33:32 +01:00
Rasmus Steinke 9b0ce18144 oggvorbis: map "Album Artist" to "AlbumArtist"
This patch allows mpd to recognise the albumartist tag in the way foobar2000
and others write it to files.
2009-01-15 06:51:58 +01:00
Max Kellermann 9e55a08d79 songvec: sort songs by disc and track number
Sorting songs by file name does not make much sense.  Most of the
time, users want to add songs in track order to the playlist.
2009-01-15 00:22:30 +01:00
Max Kellermann 2fad578376 tag: added tag_get_value() 2009-01-15 00:21:08 +01:00
Max Kellermann 4847bbaad3 dirvec, songvec: sort using g_utf8_collate()
Path names in the directory and song structs are always encoded in
UTF-8.  Don't use strcmp(), it cannot handle UTF-8 characters
properly.  Use GLib's UTF-8 aware g_utf8_collate() function for that.
2009-01-15 00:09:18 +01:00
Antoine Beaupré b7fe09fa52 shout: enlarge buffer size to 32 kB
I was having problems with shoutcast stream outputs before applying
the attached patch, which enlarges the shoutcast output
buffer. Ideally, this should be configurable, but this resolves the
issue for my needs.
2009-01-14 23:28:26 +01:00
Max Kellermann 283c2621f3 oggvorbis: use g_ascii_strncasecmp() instead of strncasecmp()
Don't depend on the daemon's locale settings.  Comment names are
ASCII.
2009-01-14 23:23:05 +01:00
Max Kellermann f353bf77ba oggvorbis: moved tag look into vorbis_parse_comment()
vorbis_parse_comment() should be a function which converts one comment
to a tag item.  It should do everything required to do the conversion,
including looping over all possible tag types.
2009-01-14 23:21:45 +01:00
Max Kellermann 69b033757f oggvorbis: moved code to vorbis_copy_comment() 2009-01-14 23:15:14 +01:00
Max Kellermann 25cf333355 oggvorbis: use vorbis_comment_value() in vorbis_parse_comment()
Eliminate some duplicate code.
2009-01-14 23:09:36 +01:00
Max Kellermann 5a26c949bb oggvorbis: always allocate a tag object
Always allocate a new tag object before parsing the vorbis comments;
free it when it turns out to be empty.  This simplifies the code a
bit.
2009-01-14 23:09:31 +01:00
Max Kellermann b5cadc9c04 oggvorbis: no CamelCase
Renamed functions and variables.
2009-01-14 23:09:02 +01:00
Max Kellermann b8e06d414a oggvorbis: use bool
Make ogg_parseCommentAddToTag() return bool instead of unsigned int.
2009-01-14 22:51:11 +01:00