aboutsummaryrefslogtreecommitdiffstats
path: root/src (unfollow)
Commit message (Collapse)AuthorFilesLines
2006-08-18fix a few warnings on 64-bit machinesEric Wong2-3/+3
size_t is bigger than int on most 64-bit machines, so cast size_t to long when passing them to printf-like functions. Ideally we'd use %z, but many compilers don't support it. git-svn-id: https://svn.musicpd.org/mpd/trunk@4656 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-18Cast isostr to char * to fix yet another warningJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4655 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-18Change type of isostr to fix warningJ. Alexander Treuman1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4654 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-15Avoid an unnecessary encoding conversion when converting id3v1 tags. Also ↵J. Alexander Treuman1-22/+17
make getID3Info static. git-svn-id: https://svn.musicpd.org/mpd/trunk@4642 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-15tag.c: fix segfault on failed id3v1 character conversionEric Wong1-0/+10
convStrDup() returns NULL if character conversion fails, so make sure we check the return values and drop the tag if we can't get a conversion. This should close bug 1313: http://musicpd.org/mantis/view.php?id=1313 git-svn-id: https://svn.musicpd.org/mpd/trunk@4641 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-14Several bugfixes during exit found by valgrindEric Wong3-3/+8
First, make sure we call finishPlaylist() before closeMp3Directory() since the latter will free non-SONG_TYPE_URL songs in playlist, which causes an invalid read when we try to look for SONG_TYPE_URL songs to free in finishPlaylist. Secondly, make sure our children have all exited before freeing the playerData. If we do not, slowly-delivered signals can trigger a race condition in the signal handlers of the decode and player processes which rely on getPlayerData. To avoid waitpid-ing too long (or at all), move the freePlayerData() call farther down in main() (this won't affect anything else) to give the OS a better chance to deliver signals and finish running sig handlers for terminated children. git-svn-id: https://svn.musicpd.org/mpd/trunk@4640 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-14Revert leaks from r4311, and also the leak fixes as a result of thatEric Wong5-37/+26
utf8ToFsCharset() and fsCharsetToUtf8() got very broken in r4311, and resulted in several commits to fix those leaks. Unfortunately, not all of those newly introduced leaks were fixed, nor was the result pretty. Also, fixed a double-free in lsPlaylists(). This is very hard to trigger (and therefore exploit) at the moment because we check printDirectoryInfo() beforehand. Intended behavior for utf8ToFsCharset() and fsCharsetToUtf8() as God^H^H^Hshank originally intended is now documented in path.h to prevent future errors like this. mpd could still use some good valgrind testing before the 0.12.0 release. <plug>In addition to reducing heap fragmentation, malloc reductions from mpd-ke greatly reduces the chance of leaks from happening due to programming errors.</plug> git-svn-id: https://svn.musicpd.org/mpd/trunk@4639 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-13Stop decoding once we've dropped samples at the end (it messes up the audio ↵J. Alexander Treuman1-1/+3
if there's more mp3 to decode) git-svn-id: https://svn.musicpd.org/mpd/trunk@4619 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-13Presume that the Xing frame count is accurate, and stop decoding when we hit ↵J. Alexander Treuman1-2/+9
the last frame git-svn-id: https://svn.musicpd.org/mpd/trunk@4618 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-12audioOutput_alsa.c: avoid changing our internal period and buffer time valuesEric Wong1-6/+9
Passing a ref to snd_pcm_hw_params_set_{buffer,period}_time_near can modify our internal {period,buffer}_time members inside the AlsaData structure, making re-initializing the device across sample/bit rate and channel changes non-idempotent. git-svn-id: https://svn.musicpd.org/mpd/trunk@4616 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-12always support DEBUG() logging, even if -DNDEBUGWarren Dukes2-9/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4613 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-11Spelling & GrammarAvuton Olrich7-9/+9
git-svn-id: https://svn.musicpd.org/mpd/trunk@4612 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-10Separate PROTOCOL_VERSION from VERSIONEric Wong1-1/+1
So we can have VERSION=0.12.0rc1 and keep the clients seeing 0.12.0 git-svn-id: https://svn.musicpd.org/mpd/trunk@4608 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-09labels should be on the left most column, no tabbingWarren Dukes4-4/+5
git-svn-id: https://svn.musicpd.org/mpd/trunk@4605 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-09we have the parentPos, so use it when incrementing the tree iterator.Warren Dukes1-14/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@4604 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-08audioOutput_pulse: ansi-fy function declarations (sparse)Eric Wong1-2/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@4599 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-08more sparse cleanupsEric Wong6-49/+46
* less-commonly compiled things like ao/mvp outputs * Adding -Wno-transparent-union to SPARSE_FLAGS makes it check inside decode.c, directory.c, player.c, and sig_handlers.c * remove unused variables leftover from the master process in sig_handlers.c git-svn-id: https://svn.musicpd.org/mpd/trunk@4598 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-08mpc_plugin: fix seeking bugEric Wong1-0/+1
remember to reset our chunk pointer when seeking git-svn-id: https://svn.musicpd.org/mpd/trunk@4597 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07mpc_plugin.c: fix compilation error with MPC_FIXED_POINTEric Wong1-1/+1
(It sounds like crap though) git-svn-id: https://svn.musicpd.org/mpd/trunk@4596 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07sparse / gcc-2.95 / -pedantic fixesEric Wong3-30/+37
Not everybody has access to the latest and greatest compilers. git-svn-id: https://svn.musicpd.org/mpd/trunk@4595 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07rewrite getId3Tag so we can get rid of this silly ID3_TAG_BUFLEN crapJ. Alexander Treuman1-28/+21
git-svn-id: https://svn.musicpd.org/mpd/trunk@4594 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07command: static-fication since commandError is no longer a macroEric Wong2-5/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@4593 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07Indent some #defines in tag.c for better readabilityJ. Alexander Treuman1-8/+8
git-svn-id: https://svn.musicpd.org/mpd/trunk@4592 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07Ok, don't use memcmp for comparing audio formats!J. Alexander Treuman1-1/+2
git-svn-id: https://svn.musicpd.org/mpd/trunk@4591 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07Eliminate unnecessary use of a variableJ. Alexander Treuman1-2/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4586 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07Use memcmp to compare audio formatsJ. Alexander Treuman1-2/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4585 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07Reopen the audio device if the audio format has changedJ. Alexander Treuman1-0/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@4584 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07Add PERMISSION_NONE define, for commands that require no permissionJ. Alexander Treuman2-9/+10
git-svn-id: https://svn.musicpd.org/mpd/trunk@4583 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-07Reformatting initCommands and fillBufferJ. Alexander Treuman2-83/+56
git-svn-id: https://svn.musicpd.org/mpd/trunk@4582 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-06remove overzealous asserts (wait for np to clean up his COMMAND_MAX_ARGS stuff)Warren Dukes1-3/+0
git-svn-id: https://svn.musicpd.org/mpd/trunk@4575 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-06renamce cstrtok to buffer2array. please don't rename functions; especially ↵Warren Dukes6-26/+42
to names that look extremely std-lib-ish. also, don't use isspace, apparently it's local dependent and potentially consideres ' ' or '\t' not to be a space, or considers other characters to be a space. git-svn-id: https://svn.musicpd.org/mpd/trunk@4574 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-06merge changes from mpd-tree:Warren Dukes12-295/+916
-use tree for tagTracker -eliminate the master process git-svn-id: https://svn.musicpd.org/mpd/trunk@4571 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-05buffer2array: more unit testsEric Wong1-0/+21
git-svn-id: https://svn.musicpd.org/mpd/trunk@4570 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-05buffer2array: fix for trailing sub-quoted text inside a quoted contextEric Wong1-2/+36
Also added a unit test to check for errors/bugs to make sure we don't have regressions. Bug found by Qball. git-svn-id: https://svn.musicpd.org/mpd/trunk@4569 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-03Our id3 tag buffer should be an array of bytes, not an array of pointers to ↵J. Alexander Treuman1-4/+4
bytes. Now I know where those warnings came from... git-svn-id: https://svn.musicpd.org/mpd/trunk@4540 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-03buffer2array: oops, we forgot to take into account that \ is escaped, tooEric Wong1-1/+2
Any escaped instances of \ must already be inside an already quoted string, though. git-svn-id: https://svn.musicpd.org/mpd/trunk@4539 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-03log: oops, brain fart caused a segfaultEric Wong1-1/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4538 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-03log: switch to using FILE * for logging, since fdprintf isn't reentrantEric Wong1-12/+15
(and fdprintf was never meant to be reentrant, either) A huge thanks to welshbyte for reporting the bug and being very helpful in helping me fix it. git-svn-id: https://svn.musicpd.org/mpd/trunk@4537 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-03Undoing more indent sillinessJ. Alexander Treuman1-8/+4
git-svn-id: https://svn.musicpd.org/mpd/trunk@4536 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-03remove tree.[ch] from trunk, it will be added back once the mpd-tree branch isWarren Dukes2-722/+0
merged back into trunk git-svn-id: https://svn.musicpd.org/mpd/trunk@4535 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-03main.c: initialize the verbose flag correctlyEric Wong1-0/+1
git-svn-id: https://svn.musicpd.org/mpd/trunk@4533 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-02tree optimization: reduce the number of compares required for insertion and ↵Warren Dukes1-101/+103
deletion by storing the position in the parent node of each child git-svn-id: https://svn.musicpd.org/mpd/trunk@4532 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01audioOutput_oss: cleanups (stolen from -ke)Eric Wong1-73/+58
git-svn-id: https://svn.musicpd.org/mpd/trunk@4518 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01charConv: optimize away a boatload of strdups during update (try #2)Eric Wong1-4/+13
This was originally introduced in r3718, but reverted r3859 since the original r3718 commit was incorrect (and I was too excited about the speedup and also lacking in UTF-8 files to notice :x) git-svn-id: https://svn.musicpd.org/mpd/trunk@4517 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01audio: pause/resume-from-statefile bugfixes,Eric Wong1-45/+37
Oops, I broke pause/resuming from a statefile r4514 Everything should be fixed out. Also we now avoid opening the audio device until we have a playable audio_format set. This is a long-standing bug that got exposed more blatantly with the single array. Thanks to MattD in #mpd for reporting my breakage. git-svn-id: https://svn.musicpd.org/mpd/trunk@4516 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01audio: malloc reductionsEric Wong3-62/+52
Just malloc all of the audioOutput array in one shot to avoid fragmentation and to improve cache locality when iterating through the array. We also know name and type members of the AudioOutput struct won't change in the config, so there's no need to strdup them. newAudioOutput => initAudioOutput git-svn-id: https://svn.musicpd.org/mpd/trunk@4515 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01audio: get rid of the myAudioDevicesEnabled arrayEric Wong3-66/+78
It just made things more confusing. We'll just store the states in playerData_pd->audioDevicesStates and be done with it (it's a unsigned byte now). git-svn-id: https://svn.musicpd.org/mpd/trunk@4514 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01audio: remove AUDIO_MAX_DEVICES limitEric Wong4-24/+33
Some people have more than 8 devices (the old limit). It's pretty easy to support as many as our hardware and OS allows so we might as well. git-svn-id: https://svn.musicpd.org/mpd/trunk@4513 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-01logging cleanupsEric Wong8-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
2006-08-01playerData: move player_pid into the main playerData structureEric Wong2-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