summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2009-01-16decoder_api: added assertion on partial framesMax Kellermann
Decoder plugins must not send partial frames.
2009-01-16pcm_resample_fallback: corrected the sample calculationMax Kellermann
Due to rounding errors, it was possible that the fallback resampler returned partial frames.
2009-01-15input_curl: don't call input_curl_select() when already at EOFMax Kellermann
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-15input_curl: set "ready" flag on EOFMax Kellermann
Set the "ready" flag for empty resources.
2009-01-15input_curl: call curl_multi_info_read() in constructorMax Kellermann
To check for early connect failures, call curl_multi_info_read() in the constructor input_curl_open(). This fixes an assertion failure.
2009-01-14playlist: safely search the playlist for deleted songMax Kellermann
When a song file is deleted during database update, all pointers to it must be removed from the playlist. The "for" loop in deleteASongFromPlaylist() did not deal with multiple copies of the deleted song properly, and left instances of the (to-be-invalidated) pointer in. Fix this by reversing the loop.
2009-01-14song_save: check for colon and space when loading a tagMax Kellermann
matchesAnMpdTagItemKey() broke when two tag items had the same prefix, because it did not check if the tag name ended after the prefix. Add a check for the colon and the space after the tag name.
2009-01-13input_curl: honour http_proxy_* config directivesJoe Milbourn
If http_proxy_{host, port, user, password} are provided in mpd.conf they are not passed on to libcurl. As a result mpd cannot stream from behind an http proxy. The attached patch `http_proxy.patch` makes the relevant calls to curl_easy_setopt(...) for all proxy configuration parameters, but is only tested for host and port.
2009-01-13playlist: implement Fisher-Yates shuffle properlyMax Kellermann
MPD's shuffling algorithm was not implemented well: it considers songs which were already swapped, making it somewhat non-random. Fix the Fisher-Yates shuffle algorithm by passing the proper bounds to the PRNG.
2009-01-13playlist: use GLib's random number generatorMax Kellermann
srandom() and random() are not portable. Use GLib's implementation.
2009-01-13input_curl: use select() to eliminate busy loop during connectMax Kellermann
When decoder_run_song() (decoder_thread.c) waits for the input stream to become ready, it did that in a busy loop. Add a select() call to input_curl_buffer() during connect/handshake (i.e. before the first chunk of body data was received), to let the CPU relax.
2009-01-13decoder_api: don't ignore DECODE_COMMAND_STOPMax Kellermann
When the decoder thread is waiting for free chunks in the music pipe, don't ignore the STOP command. Just return dc.command without further checks.
2009-01-13update: save the database even if it is emptyMax Kellermann
Save an empty database, even if the music directory is empty.
2009-01-13pcm_utils: use the custom PRNG for volume ditheringMax Kellermann
Don't use libc's rand() function, because it is slow. Our own trivial linear congruential generator is good enough for dithering.
2009-01-13update: refresh stats when database update is finishedMax Kellermann
2009-01-13playlist: log errors during loadPlaylist()Max Kellermann
Don't call command_error() if loading a song from the playlist fails. This may result in assertion failures, since command_error() may be called more than once.
2009-01-04player_thread: fix cross-fading duplicate chunk bugMax Kellermann
When the decoder of the new song is not fast enough, the player thread has to wait for it for a moment. However the variable "nextChunk" was reset to -1 during that, making the next loop iteration assume that cross-fading has not begun yet. This patch overwrites it with "0" while waiting.
2009-01-04decoder_api: moved code to do_send_tag(), free temporary tagMax Kellermann
This patch fixes a minor memory leak: when decoder_tag() attempted to send a merged tag object (created by tag_add_stream_tags()), and was interrupted by a decoder command, it did not free the temporary merged tag object.
2009-01-02jack: duplicate jack_get_ports() return valuesMax Kellermann
JACK documentation states: "The caller is responsible for calling free(3) any non-NULL returned value." This does not seem to include the array elements. Duplicate them after jack_get_ports(), and free only the array. Convert JackData.output_ports to non-const.
2009-01-02bonjour: fixed "unused parameter" warningsMax Kellermann
Add G_GNUC_UNUSED attributes.
2009-01-02main: use g_setenv() instead of setenv()Max Kellermann
Removed the fallback setenv() implementation for solaris.
2009-01-02log: automatically append newlineMax Kellermann
If a log message does not include a newline character, append it.
2009-01-02tag_id3: strip leading and trailing whitespace from ID3 tagsThomas Jansen
Fix for bug #1491.
2009-01-02mp4: support the writer/composer tagFrank Mulder
I tried to search for a certain composer in my collection, but only non-mp4 files showed up. The source code reveals that this tag is not read. This can be fixed by reading the 'Writer' tag field, in mp4_plugin.c, in function mp4_load_tag. I actually tried this, and after compiling with those lines added, also mp4 (.m4a) files showed up when searching for a composer.
2008-12-24playlist: fix stored playlist modifications with absolute pathsMax Kellermann
When save_absolute_paths_in_playlists was enabled in mpd.conf, MPD broke all playlists when manipulated using the "playlistdelete" command. The reason was that map_directory_child_fs() was used, which doesn't accept slashes in the file name. Use the new map_uri_fs() function instead.
2008-12-24stored_playlist: fix integer overflow in length estimationMax Kellermann
With a large maximum playlist length, the integer multiplication "playlist_max_length * MPD_PATH_MAX" may overflow. Change that to a division. This was not a dangerous bug, since it was only used for a quick estimate.
2008-12-24ffmpeg: case AV_NOPTS_VALUE to int64_tMax Kellermann
The old code casted it to a 32 bit integer, which cut off bits. AVFormatContext.duration is a int64_t, so use this type.
2008-12-24ffmpeg: don't assign "0" to pointerMax Kellermann
Use NULL instead. Found by sparse.
2008-12-24Makefile.am: fix sparse invocationMax Kellermann
Added missing includes.
2008-12-24mp3: "tag" argument is unused when libid3tag is disabledMax Kellermann
Add G_GNUC_UNUSED attributes.
2008-12-24listen: "port" argument is unused when TCP support is disabledMax Kellermann
Add a G_GNUC_UNUSED attribute.
2008-12-24pcm_utils: check pcm_convert()==0Max Kellermann
It is illegal to pass an empty audio buffer around. pcm_resample() sometimes seems to result in 0 samples, maybe related to libsamplerate. To work around that problem, add special checks after both pcm_convert() invocations. Removed the pcm_resample()==0 checks from pcm_convert().
2008-12-24client: always attempt to flush deferred buffersMax Kellermann
When a response is very long (e.g. a large playlist > 100k songs), most of it will end up in the deferred buffers. Filling the deferred queue is very expensive currently, because a new buffer is allocated for every client_write() operation. This may lead to long delays, and the client might give up and disconnect meanwhile. This patch makes MPD attempt to flush the deferred queue as often as possible, to work around this problem. Due to the MPD 0.14 code freeze, we should not optimize the buffering code now.
2008-12-23shout: fixed bad error message printoutViliam Mateicka
2008-12-21Merge branch 'http_buffer_remove' of git://git.musicpd.org/avuton/mpdMax Kellermann
2008-12-20Remove obsolete http_buffer* stuff that went away with the new curl backend.Avuton Olrich
2008-12-20log: map log level "SECURE" to GLib's "INFO"Max Kellermann
Make "secure" a log level different from "default". "secure" should be right between "default" and "verbose". Map "default" to Glib's "MESSAGE" log level.
2008-12-17Remove useless statement.Emanuele Giaquinta
2008-12-17player_control: check if errored_song is setMax Kellermann
getPlayerErrorStr() assumes that pc.errored_song is set when an error occured. Since the song may have been deleted meanwhile, add a NULL check.
2008-12-17playlist: clear pc.errored_song on deleteMax Kellermann
When a (remote) song is deleted from the playlist, there may still be a reference to it in pc.errored_song. Clear this reference.
2008-12-17Remove useless computation. After the pthread_cond_wait loop there are at ↵Emanuele Giaquinta
least MIN(od->bufferSize, size) free bytes in the buffer. Thus MIN(od->bufferSize - od->len, size) is always equal to MIN(od->bufferSize, size).
2008-12-17Remove useless statement, curpos is initialized at the beginning of the loop.Emanuele Giaquinta
2008-12-17Factor computation.Emanuele Giaquinta
2008-12-17Use MIN.Emanuele Giaquinta
2008-12-17Call CloseComponent after AudioUnitUninitialize.Emanuele Giaquinta
2008-12-16command: reject unsupported URI schemesMax Kellermann
When a client-specified URI has a scheme which is not supported, do not try to open it as a local file, but provide a meaningful error message.
2008-12-16ls: added uri_has_scheme()Max Kellermann
uri_has_scheme() checks if an URI contains the sub string "://", which makes MPD assume that it is a remote URI.
2008-12-16ls: don't return suffix from parent directory nameMax Kellermann
When a file had no file name extension, getSuffix() could return the extension of the parent directory (if it had one).
2008-12-16ls: reimplement getSuffix() with strrchr()Max Kellermann
The old getSuffix() code was quite wasteful, and can be replaced completely with strrchr().
2008-12-16ls: use boolMax Kellermann
Use the C99 "bool" data type instead of "int".