aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* logging cleanupsEric Wong2006-08-018-184/+225
| | | | | | | | | | | | | | * Moved all logging-related stuff into log.c (and not myfprintf.c) * ISO C90-compliant strftime usage: %e and %R replaced with %d and %H:%M respectively * Got rid of variadic macros since some old-school compilers don't like them * compiling with -DNDEBUG disables the DEBUG() macro git-svn-id: https://svn.musicpd.org/mpd/trunk@4512 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* playerData: move player_pid into the main playerData structureEric Wong2006-08-012-20/+3
| | | | | No point in doing all that extra work for one variable... git-svn-id: https://svn.musicpd.org/mpd/trunk@4511 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Several fixes uncovered with -pedanticEric Wong2006-08-016-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
* src/listen.c: replace bcopy with memcpyEric Wong2006-08-011-4/+4
| | | | | bcopy is old-school, yo git-svn-id: https://svn.musicpd.org/mpd/trunk@4509 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix a bug when deleting node and CHILDREN_PER_NODE is evenWarren Dukes2006-08-011-3/+3
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4508 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix a bug when deleting songs and CHILDREN_PER_NODE > 3Warren Dukes2006-08-011-8/+6
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4507 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* a couple of small cleanupsWarren Dukes2006-08-011-51/+40
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4506 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* deletion of tree nodes now works.Warren Dukes2006-08-012-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
* some tree bugfixesWarren Dukes2006-07-311-37/+78
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4498 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* No code change, just add headersAvuton Olrich2006-07-314-4/+72
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4497 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* tree updates:Warren Dukes2006-07-312-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
* software volume can now be saved and read from the state fileEric Wong2006-07-303-0/+41
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4495 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Standardize state_file handling routines.Eric Wong2006-07-309-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
* remove deprecated myfprintf wrapperEric Wong2006-07-3010-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
* tree updates:Warren Dukes2006-07-302-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
* remove clumsy strncpy useEric Wong2006-07-308-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
* Now fix the mp4 plugin warnings to what they were before the dynamic linkingAvuton Olrich2006-07-301-3/+3
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4490 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* gcc signedness and sparse fixesEric Wong2006-07-305-9/+11
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4489 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* commandError() cleanups, fixup gcc checksEric Wong2006-07-308-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
* beginnings of a B-tree, currently insertion has been implemented and testWarren Dukes2006-07-302-0/+296
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4487 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* command: fix find/search commands from the malloc reduction patchEric Wong2006-07-301-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
* myfprintf: parse paths so we can reopen log files correctlyEric Wong2006-07-301-2/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4485 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix some warnings introduced in the big malloc-reduction patchEric Wong2006-07-304-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
* interface/connection malloc reductions from mpd-keEric Wong2006-07-3032-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
* conf.c: bugfix: print out the number, not the addressEric Wong2006-07-301-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4482 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* replace buffer2array() with cstrtok() from mpd-keEric Wong2006-07-294-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
* command.c: shorten common variable names to argc and argvEric Wong2006-07-291-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
* conf.[ch] whitespace cleanupJ. Alexander Treuman2006-07-272-77/+77
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4477 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Updating compress.[ch] from AudioCompressJ. Alexander Treuman2006-07-272-5/+9
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4476 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Use AudioCompress for volume normalizationJ. Alexander Treuman2006-07-279-99/+461
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4474 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Remove the fifo plugin. It's currently useless for the average user, and ↵J. Alexander Treuman2006-07-263-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
* Typo fixAvuton Olrich2006-07-261-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4470 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Silence a gcc warning... Properly.J. Alexander Treuman2006-07-261-1/+3
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4469 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Silence a gcc warningJ. Alexander Treuman2006-07-261-0/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4468 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* jat's second tip of the day: when you change a ternary operator to an if, ↵J. Alexander Treuman2006-07-261-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
* Try to add the directory, againAvuton Olrich2006-07-2614-0/+4782
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4466 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Screw this found_* stuff, just wrap parse_*() in an ifJ. Alexander Treuman2006-07-261-11/+6
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4465 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't decode the first frame if it has a xing tag, not only if it has a xing ↵J. Alexander Treuman2006-07-261-1/+2
| | | | | tag with a frame count git-svn-id: https://svn.musicpd.org/mpd/trunk@4464 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Use the lame tag's encoder delay/padding to implement gapless mp3 playbackJ. Alexander Treuman2006-07-261-0/+53
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4462 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Put mp4ff back into the treeAvuton Olrich2006-07-262-31/+29
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4461 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Parse lame tag for encoder delay/padding so we can later implement gaplessJ. Alexander Treuman2006-07-251-0/+67
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4460 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* jat's tip of the day: remember to remove your silly debug messages before ↵J. Alexander Treuman2006-07-251-1/+0
| | | | | committing git-svn-id: https://svn.musicpd.org/mpd/trunk@4459 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add support for mp1/2. Thanks to Stephan Beyer for the patch.J. Alexander Treuman2006-07-251-2/+5
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4458 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Removing my stupid debug messages for testing xingJ. Alexander Treuman2006-07-251-2/+0
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4457 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Reworking xing parsing so lame tags will fit in betterJ. Alexander Treuman2006-07-251-20/+19
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4456 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Thanks for making my code totally unreadable indent!J. Alexander Treuman2006-07-251-80/+54
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4455 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Open the db file before daemonizing/creating the master process, so we can ↵J. Alexander Treuman2006-07-241-2/+1
| | | | | handle failures gracefully git-svn-id: https://svn.musicpd.org/mpd/trunk@4454 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Do normalization if there's replaygain data but replaygain is offJ. Alexander Treuman2006-07-243-2/+4
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4445 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* audioOutput_alsa: better period_size auto-configurationEric Wong2006-07-241-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
* If we're going to create the db file, make sure the parent path is a directoryJ. Alexander Treuman2006-07-231-1/+16
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4437 09075e82-0dd4-0310-85a5-a0d7c8717e4f