aboutsummaryrefslogtreecommitdiffstats
path: root/src (unfollow)
Commit message (Collapse)AuthorFilesLines
2006-08-01Several fixes uncovered with -pedanticEric Wong6-20/+20
playerData.c: proper error checking directory.c: properly check myFgets() for errors (it returns NULL on error) inputPlugins/mp3_plugin.c get rid of commas at the end of enums interface.c: we weren't using long long, so strtoll isn't needed get rid of void-pointer arithmetic sllist.c: get rid of void-pointer arithmetic compress.c: get rid of C++ comments, some compilers don't accept them Note that I personally like void pointer arithmetic, but some ancient compilers don't support them :( git-svn-id: https://svn.musicpd.org/mpd/trunk@4510 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01src/listen.c: replace bcopy with memcpyEric Wong1-4/+4
bcopy is old-school, yo git-svn-id: https://svn.musicpd.org/mpd/trunk@4509 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01fix a bug when deleting node and CHILDREN_PER_NODE is evenWarren Dukes1-3/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@4508 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01fix a bug when deleting songs and CHILDREN_PER_NODE > 3Warren Dukes1-8/+6
git-svn-id: https://svn.musicpd.org/mpd/trunk@4507 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01a couple of small cleanupsWarren Dukes1-51/+40
git-svn-id: https://svn.musicpd.org/mpd/trunk@4506 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01deletion of tree nodes now works.Warren Dukes2-6/+14
next is to clean up the code and make obvious optimizations git-svn-id: https://svn.musicpd.org/mpd/trunk@4502 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-31some tree bugfixesWarren Dukes1-37/+78
git-svn-id: https://svn.musicpd.org/mpd/trunk@4498 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-31No code change, just add headersAvuton Olrich4-4/+72
git-svn-id: https://svn.musicpd.org/mpd/trunk@4497 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-31tree updates:Warren Dukes2-6/+246
*) add copyright notice *) implemented node deletion, but not yet tested git-svn-id: https://svn.musicpd.org/mpd/trunk@4496 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30software volume can now be saved and read from the state fileEric Wong3-0/+41
git-svn-id: https://svn.musicpd.org/mpd/trunk@4495 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30Standardize state_file handling routines.Eric Wong9-232/+261
This way it's easier to manage and extend. git-svn-id: https://svn.musicpd.org/mpd/trunk@4494 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30remove deprecated myfprintf wrapperEric Wong10-44/+45
This shaves another 5-6k because we've removed the paranoid fflush() calls after every fprintf. Now we only fflush() when we need to git-svn-id: https://svn.musicpd.org/mpd/trunk@4493 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30tree updates:Warren Dukes2-73/+221
*) when CHILDREN_PER_NODE is large, use binary search *) add a iterator implementation *) some code cleanup git-svn-id: https://svn.musicpd.org/mpd/trunk@4492 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30remove clumsy strncpy useEric Wong8-60/+77
strncpy isn't really safe because it doesn't guarantee null termination, and we have had to work around it in several places. strlcpy (from OpenBSD) isn't great, either because it often leaves errors going unchecked (by truncating strings). So we'll add the pathcpy_trunc() function with is basically strlcpy with a hardcoded MAXPATHLEN as the limit, and we'll acknowledge truncation since we only work on paths and MAXPATHLEN should be set correctly by the system headers[1]. file-specific notes: inputStream_http: eyeballing the changes here, it seems to look alright but I haven't actually tested it myself. ls: don't even bother printing a file if the filename is too long (and when is it ever?) since we won't be able to read it anyways. metadataChunk: it's only metadata, and it's only for showin the user, so truncating it here souldn't be a big issue. memset to zero in init is unecessary, so lets not waste cycles [1] - If the system headers are screwed up, then we're majorly screwed regardless of what we do :x git-svn-id: https://svn.musicpd.org/mpd/trunk@4491 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30Now fix the mp4 plugin warnings to what they were before the dynamic linkingAvuton Olrich1-3/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@4490 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30gcc signedness and sparse fixesEric Wong5-9/+11
git-svn-id: https://svn.musicpd.org/mpd/trunk@4489 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30commandError() cleanups, fixup gcc checksEric Wong8-57/+58
stripped binary size reduced by 9k on my machine from making commandError a function. We'll print out error messages slightly slower before, but the smaller binary is more than worth it. git-svn-id: https://svn.musicpd.org/mpd/trunk@4488 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30beginnings of a B-tree, currently insertion has been implemented and testWarren Dukes2-0/+296
git-svn-id: https://svn.musicpd.org/mpd/trunk@4487 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30command: fix find/search commands from the malloc reduction patchEric Wong1-4/+7
The most we ever use is for search/find, and that limits it to the number of tags we can have. Add one for the command, and one extra to catch errors clients may send us. Thanks to Qball for reporting this bug git-svn-id: https://svn.musicpd.org/mpd/trunk@4486 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30myfprintf: parse paths so we can reopen log files correctlyEric Wong1-2/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@4485 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30fix some warnings introduced in the big malloc-reduction patchEric Wong4-5/+7
The myfprintf bugs that are fixed here were NOT introduced in the last patch, it's just that the stricter warning checks from moving to fprintf caused string format bugs to actually be checked by gcc git-svn-id: https://svn.musicpd.org/mpd/trunk@4484 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30interface/connection malloc reductions from mpd-keEric Wong32-801/+1081
This patch massively reduces the amount of heap allocations at the interface/command layer. Most commands with minimal output should not allocate memory from the heap at all. Things like repeatedly polling status, currentsong, and volume changes should be faster as a result, and more importantly, not a source of memory fragmentation. These changes should be safe in that there's no way for a remote-client to corrupt memory or otherwise do bad stuff to MPD, but an extra set of eyes to review would be good. Of course there's never any warranty :) No longer do we use FILE * structures in the interface, which means we don't have to allocate any new memory for most connections. Now, before you go on about losing the buffering that FILE * +implies+, remember that myfprintf() never took advantage of any of the stdio buffering features. To reduce the diff and make bugs easier to spot in the diff, I've kept myfprintf in places where we write to files (and not network interfaces). Expect myfprintf to go away entirely soon (we'll use fprintf for writing regular files). git-svn-id: https://svn.musicpd.org/mpd/trunk@4483 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30conf.c: bugfix: print out the number, not the addressEric Wong1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4482 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-29replace buffer2array() with cstrtok() from mpd-keEric Wong4-117/+59
This modifies the string in place, and does not allocate any memory from the heap. This is considerably smaller than the function it replaces, and will be instrumental in getting the commands/conf malloc reductions done. git-svn-id: https://svn.musicpd.org/mpd/trunk@4481 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-29command.c: shorten common variable names to argc and argvEric Wong1-209/+209
Any C programmer with half a clue knows they mean argArrayLength and argArray, and I find the code much easier to read and work with. git-svn-id: https://svn.musicpd.org/mpd/trunk@4480 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-27conf.[ch] whitespace cleanupJ. Alexander Treuman2-77/+77
git-svn-id: https://svn.musicpd.org/mpd/trunk@4477 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-27Updating compress.[ch] from AudioCompressJ. Alexander Treuman2-5/+9
git-svn-id: https://svn.musicpd.org/mpd/trunk@4476 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-27Use AudioCompress for volume normalizationJ. Alexander Treuman9-99/+461
git-svn-id: https://svn.musicpd.org/mpd/trunk@4474 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Remove the fifo plugin. It's currently useless for the average user, and ↵J. Alexander Treuman3-254/+0
making it more presentable isn't something I'm willing to do before 0.12. It will likely be added back after 0.12, along with some very experimental stuff to make it more usable. git-svn-id: https://svn.musicpd.org/mpd/trunk@4472 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Typo fixAvuton Olrich1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4470 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Silence a gcc warning... Properly.J. Alexander Treuman1-1/+3
git-svn-id: https://svn.musicpd.org/mpd/trunk@4469 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Silence a gcc warningJ. Alexander Treuman1-0/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@4468 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26jat's second tip of the day: when you change a ternary operator to an if, ↵J. Alexander Treuman1-1/+1
don't forget to take out everything after the :. And don't forget my first tip either. git-svn-id: https://svn.musicpd.org/mpd/trunk@4467 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Try to add the directory, againAvuton Olrich14-0/+4782
git-svn-id: https://svn.musicpd.org/mpd/trunk@4466 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Screw this found_* stuff, just wrap parse_*() in an ifJ. Alexander Treuman1-11/+6
git-svn-id: https://svn.musicpd.org/mpd/trunk@4465 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Don't decode the first frame if it has a xing tag, not only if it has a xing ↵J. Alexander Treuman1-1/+2
tag with a frame count git-svn-id: https://svn.musicpd.org/mpd/trunk@4464 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Use the lame tag's encoder delay/padding to implement gapless mp3 playbackJ. Alexander Treuman1-0/+53
git-svn-id: https://svn.musicpd.org/mpd/trunk@4462 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-26Put mp4ff back into the treeAvuton Olrich2-31/+29
git-svn-id: https://svn.musicpd.org/mpd/trunk@4461 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25Parse lame tag for encoder delay/padding so we can later implement gaplessJ. Alexander Treuman1-0/+67
git-svn-id: https://svn.musicpd.org/mpd/trunk@4460 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25jat's tip of the day: remember to remove your silly debug messages before ↵J. Alexander Treuman1-1/+0
committing git-svn-id: https://svn.musicpd.org/mpd/trunk@4459 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25Add support for mp1/2. Thanks to Stephan Beyer for the patch.J. Alexander Treuman1-2/+5
git-svn-id: https://svn.musicpd.org/mpd/trunk@4458 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25Removing my stupid debug messages for testing xingJ. Alexander Treuman1-2/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@4457 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25Reworking xing parsing so lame tags will fit in betterJ. Alexander Treuman1-20/+19
git-svn-id: https://svn.musicpd.org/mpd/trunk@4456 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-25Thanks for making my code totally unreadable indent!J. Alexander Treuman1-80/+54
git-svn-id: https://svn.musicpd.org/mpd/trunk@4455 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-24Open the db file before daemonizing/creating the master process, so we can ↵J. Alexander Treuman1-2/+1
handle failures gracefully git-svn-id: https://svn.musicpd.org/mpd/trunk@4454 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-24Do normalization if there's replaygain data but replaygain is offJ. Alexander Treuman3-2/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@4445 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-24audioOutput_alsa: better period_size auto-configurationEric Wong1-13/+20
We'll try setting an initial value of 50ms, and halve it each time snd_pcm_hw_params fails with -EPIPE. This way we'll can use a larger (50ms) period_size whenever a device supports it, and automatically pick smaller ones if we can't set larger ones. This removes the calculation borrowed from libao (svn) as well. Other minor things: "Alsa" => "ALSA" in error messages _US appended to *_TIME constants so we won't get confused (shank's request) git-svn-id: https://svn.musicpd.org/mpd/trunk@4438 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-23If we're going to create the db file, make sure the parent path is a directoryJ. Alexander Treuman1-1/+16
git-svn-id: https://svn.musicpd.org/mpd/trunk@4437 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-23Make checkDirectoryDB check that the db file is a regular fileJ. Alexander Treuman1-3/+16
git-svn-id: https://svn.musicpd.org/mpd/trunk@4436 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-23Renaming stat struct to st, for consistency with the rest of mpdJ. Alexander Treuman1-5/+5
git-svn-id: https://svn.musicpd.org/mpd/trunk@4435 09075e82-0dd4-0310-85a5-a0d7c8717e4f