- 23 Oct, 2008 11 commits
-
-
Max Kellermann authored
Copied and adapted code from the mp3 decoder plugin. This library now replaces the old and low-quality function pcm_convert_24_to_16().
-
Max Kellermann authored
I added 24 bit support a while ago, but it wasn't possible to force 24 bit output. Add 24 and 8 bit to the list of allowed sample sizes. Although 8 bit audio isn't as widely used as 24 bit, there is no reason to exclude it.
-
Max Kellermann authored
Splitting a frame between two buffer chunks causes distortion in the output. MPD used to assume that the chunk size 1020 would never cause splitted frames, but that isn't the case for 24 bit stereo (127.5 frames), and even less for files with even more channels.
-
Max Kellermann authored
Don't attempt to map paths which are already absolute with map_song_fs(): check with song_in_database() instead of song_is_file().
-
Max Kellermann authored
The "rm" command did not send notifications to idle clients. Add it.
-
Max Kellermann authored
The function deletePlaylist() shouldn't be in playlist.c.
-
Max Kellermann authored
Don't use our deprecated linked list library, use GLib's GPtrArray instead.
-
Max Kellermann authored
The "long" result of strtol() was implicitly casted down to a 32 bit integer. Add some range checking instead.
-
Max Kellermann authored
Many command arguments must not be negative; add a separate parser/checker function for that. For the same reason, add check_bool(). This eliminates two strange special cases handlers from check_int().
-
Max Kellermann authored
Pass index arguments as unsigned integers. They must not be negative, and even if some caller accidently passes -1, it won't pass the bound checks (since it's now 2**32-1).
-
Max Kellermann authored
There are some integers which have a "magic" -1 value which means "undefined" or "nothing". All others can be converted to unsigned, since they must not contain a negative number.
-
- 22 Oct, 2008 18 commits
-
-
Max Kellermann authored
Instead of returning 0 for success and -1 for failure, return true or false. This seems more natural.
-
Max Kellermann authored
Also add names for "error" and "ok". I don't like passing anonymous integer codes around. This is not yet complete: lots of functions (e.g. in playlist.c) follow the same convention of -1/0, and these have to be adapted, too.
-
Max Kellermann authored
http://xkcd.com/292/
-
Max Kellermann authored
Eliminate CamelCase in all public and static functions.
-
Max Kellermann authored
The typedef CommandHandlerFunction is only used once. Move its type into the command struct.
-
Max Kellermann authored
-
Max Kellermann authored
Send last modification timestamps to the client. This allows the client to see when another client modifies a stored playlist.
-
Max Kellermann authored
"listplaylists" returns a list of all stored playlists. This command seems more elaborate than listing them below "lsinfo".
-
Max Kellermann authored
The function print_spl_list() replaces the old function lsPlaylists() from ls.c.
-
Max Kellermann authored
spl_list() provides an interface for enumerating all stored playlists. This separates the internal playlist logic from the protocol specific function lsPlaylists().
-
Max Kellermann authored
The return value of spl_append_uri() was somewhat buggy: some branches returned ACK_* values, and some an enum playlist_result. Unify this.
-
Max Kellermann authored
Rename addToStoredPlaylist() to spl_append_uri(), and remove the clearStoredPlaylist() macro.
-
Max Kellermann authored
The two functions clearStoredPlaylist() and addToStoredPlaylist() don't belong into playlist.c. clearStoredPlaylist() was a wrapper for spl_clear(), and is converted into a CPP macro for now.
-
Max Kellermann authored
Renamed all public functions, prefix is "spl_".
-
Max Kellermann authored
No CamelCase in file names.
-
Max Kellermann authored
The list of commands is known at compile time. Instead of creating a linked list on startup, we can just register all commands in a static sorted array.
-
Max Kellermann authored
The command pointers which are passed around aren't being modified - in fact, no command pointer must be modified once it has been added to the commandList.
-
Max Kellermann authored
No CamelCase and no struct typedefs.
-
- 21 Oct, 2008 6 commits
-
-
Max Kellermann authored
Instead of manually calling memset(0) on the pcm_convert_state struct, client code should use a library function from pcm_utils.c. This way, we can change the semantics of the struct easily.
-
Max Kellermann authored
Renamed all functions which were still in CamelCase.
-
Max Kellermann authored
No CamelCase, and a struct instead of a typedef.
-
Max Kellermann authored
Casting a pointer to some sort of integer and formatting it into a string isn't valid. A pointer derived from this hex string won't work reliably. Since ffmpeg doesn't provide a nice API for passing our pointer, we have to think of a different hack: ffmpeg passes the exact URL pointer to mpdurl_open(), and we can make this string part of a struct. This reduces the problem to casting the string back to the struct. This is still a workaround, but this is "sort of portable", unless the ffmpeg people start messing with the URL pointer (which would be valid according to the API definition).
-
Max Kellermann authored
Since ffmpeg svn r13528, you have to link with libavutil manually.
-
Max Kellermann authored
Since ffmpeg svn r12865, you have to include libavcodec/avcodec.h instead of avcodec.h. This cannot be checked at compile time, instead we have to add a check to configure.ac. Viliam's original ffmpeg plugin was based on the newer ffmpeg library, while my Debian installation had the older version. My attempt to correct his include statements wasn't correct after all.
-
- 20 Oct, 2008 5 commits
-
-
Eric Wong authored
{song,dir}vec_for_each each failed to gracefully handle deleted files when iterating through. While we were thread-safe, we were not safe within the calling thread. If a callback we passed caused sv->nr to shring, our index would still increment; causing files to stay in the database. A way to test this is to remove 10 or so contiguous songs from a >10 song directory.
-
Eric Wong authored
Like the songvec nr_lock, only one lock is used for all traversals since they're rarely changed. This only projects traversals, but not the individual structures themselves.
-
Eric Wong authored
We definitely don't modify them here.
-
Eric Wong authored
This will make it easier to introduce locking
-
Max Kellermann authored
There was only one user of pathcpy_trunc(), which can be eliminated.
-