aboutsummaryrefslogtreecommitdiff
path: root/src/playlist.c
Commit message (Collapse)AuthorAge
* conf: improved boolean config parameter handling from -keEric Wong2007-09-05
| | | | | | the force flag will issue FATAL() if an invalid value is specified git-svn-id: https://svn.musicpd.org/mpd/trunk@6857 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't kill the player process (and effectively the decode process) whenJ. Alexander Treuman2007-06-04
| | | | | | completely stopped. Instead, send them SIGSTOP to pause the process until they're needed again. Then send them SIGCONT instead of re-spawning them. git-svn-id: https://svn.musicpd.org/mpd/trunk@6485 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Making some bool options more consistent.J. Alexander Treuman2007-06-03
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6468 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Tell the player process (and thus also the decode process) to quit whenJ. Alexander Treuman2007-06-01
| | | | | | | | | | playback is stopped completely. This means the player process will no longer have to wake up 100 times per second to see if it's been told to start playing (the main process will just spawn a new player process when it needs to). On the downside, this means an extra pair of forks() and the re-initializing of the player and decode processes each time playback is restarted. git-svn-id: https://svn.musicpd.org/mpd/trunk@6446 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Minor formatting cleanups.J. Alexander Treuman2007-06-01
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6444 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Changing all calls to ERROR() followed by exit(EXIT_FAILURE) with a singleJ. Alexander Treuman2007-05-26
| | | | | call to FATAL(). git-svn-id: https://svn.musicpd.org/mpd/trunk@6276 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Cleaning up addToStoredPlaylist. Now we call freeJustSong if adding a URL.J. Alexander Treuman2007-05-26
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6269 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Make sure StoredPlaylists always contain UTF-8 paths that are eitherJ. Alexander Treuman2007-05-26
| | | | | | | | | | | | | | | | | | | | | | relative paths in the DB or URLs. The main functional difference is that playlistmove and playlistdelete will rewrite playlists in the correct encoding and remove invalid lines instead of potentially modifying them. The specific changes are: appendSongToStoredPlaylist: * Don't convert to FS charset * Don't prepend music_directory if saving absolute paths writeStoredPlaylistToPath: * Convert to FS charset * Prepend music_directory if saving absolute paths loadStoredPlaylist: * Make sure each line is either in the DB or a URL loadPlaylist: * Don't bother checking paths, since it's done in loadStoredPlaylist now git-svn-id: https://svn.musicpd.org/mpd/trunk@6266 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Committing pat's rewrite of the stored playlist code. This also adds twoJ. Alexander Treuman2007-05-16
| | | | | new commands: playlistmove and playlistdelete. git-svn-id: https://svn.musicpd.org/mpd/trunk@6116 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Typo.J. Alexander Treuman2007-04-08
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5889 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* The massive copyright updateAvuton Olrich2007-04-05
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Doing those previous SONG_* commits properly. Thanks to normalperson forJ. Alexander Treuman2007-03-20
| | | | | pointing it out. git-svn-id: https://svn.musicpd.org/mpd/trunk@5673 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Use SONG_FILE instead of literal "file: " for consistency with db code.J. Alexander Treuman2007-03-20
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5669 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Adding playlistfind and playlistsearch commands for searching the currentJ. Alexander Treuman2007-02-24
| | | | | playlist. git-svn-id: https://svn.musicpd.org/mpd/trunk@5420 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix for bug #1447Warren Dukes2007-02-18
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5369 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* More sparse fixes now that we've re-enabled -Wmissing-prototypesEric Wong2007-01-14
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5260 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't initialize globals to zero (or NULL)Eric Wong2007-01-14
| | | | | | | | Some compilers and linkers aren't smart enough to optimize this, as global variables are implictly initialized to zero. As a result, binaries are a bit smaller as more goes in the .bss and less in the text section. git-svn-id: https://svn.musicpd.org/mpd/trunk@5254 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Remove a line of dead codeQball Cow2007-01-11
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5235 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Use the existing define for the default value of save_absolute_playlistsJ. Alexander Treuman2006-12-23
| | | | | instead of a hardcoded value. git-svn-id: https://svn.musicpd.org/mpd/trunk@5151 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Adding functions for clearing/adding to stored playlists. Commands to makeJ. Alexander Treuman2006-11-20
| | | | | use of these functions are still being worked on. git-svn-id: https://svn.musicpd.org/mpd/trunk@5075 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Replace strdup and {c,re,m}alloc with x* variants to check for OOM errorsEric Wong2006-08-26
| | | | | | | | | | | | | | | | | | | I'm checking for zero-size allocations and assert()-ing them, so we can more easily get backtraces and debug problems, but we'll also allow -DNDEBUG people to live on the edge if they wish. We do not rely on errno when checking for OOM errors because some implementations of malloc do not set it, and malloc is commonly overridden by userspace wrappers. I've spent some time looking through the source and didn't find any obvious places where we would explicitly allocate 0 bytes, so we shouldn't trip any of those assertions. We also avoid allocating zero bytes because C libraries don't handle this consistently (some return NULL, some not); and it's dangerous either way. git-svn-id: https://svn.musicpd.org/mpd/trunk@4690 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix warnings for -Wmissing-prototypesAvuton Olrich2006-08-20
| | | | | | Add -Wmissing-prototypes if compiling with gcc Static where possible git-svn-id: https://svn.musicpd.org/mpd/trunk@4657 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Revert leaks from r4311, and also the leak fixes as a result of thatEric Wong2006-08-14
| | | | | | | | | | | | | | | | | | | | | | 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
* Standardize state_file handling routines.Eric Wong2006-07-30
| | | | | 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-30
| | | | | | | 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
* commandError() cleanups, fixup gcc checksEric Wong2006-07-30
| | | | | | | 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
* interface/connection malloc reductions from mpd-keEric Wong2006-07-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use AudioCompress for volume normalizationJ. Alexander Treuman2006-07-27
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4474 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix a memory leak when removing a playlistJ. Alexander Treuman2006-07-21
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4422 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Remember kids: always test your code before committingJ. Alexander Treuman2006-07-21
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4420 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Make getBoolConfigParam and save_absolute_paths_in_playlist less stupidJ. Alexander Treuman2006-07-21
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4419 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Use getBoolConfigParam for save_absolute_paths_in_playlistJ. Alexander Treuman2006-07-21
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4418 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add mpd-indent.shAvuton Olrich2006-07-20
| | | | | | Add a few new options for indent to try to make things a bit cleaner git-svn-id: https://svn.musicpd.org/mpd/trunk@4411 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add mpd-indent.shAvuton Olrich2006-07-20
| | | | | | Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* sparse: ANSI-fy function declarationsEric Wong2006-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are just warnings from sparse, but it makes the output easier to read. I ran this through a quick perl script, but of course verified the output by looking at the diff and making sure the thing still compiles. here's the quick perl script I wrote to generate this patch: ----------- 8< ----------- use Tie::File; defined(my $pid = open my $fh, '-|') or die $!; if (!$pid) { open STDERR, '>&STDOUT' or die $!; exec 'sparse', @ARGV or die $!; } my $na = 'warning: non-ANSI function declaration of function'; while (<$fh>) { print STDERR $_; if (/^(.+?\.[ch]):(\d+):(\d+): $na '(\w+)'/o) { my ($f, $l, $pos, $func) = ($1, $2, $3, $4); $l--; tie my @x, 'Tie::File', $f or die "$!: $f"; print '-', $x[$l], "\n"; $x[$l] =~ s/\b($func\s*)\(\s*\)/$1(void)/; print '+', $x[$l], "\n"; untie @x; } } git-svn-id: https://svn.musicpd.org/mpd/trunk@4378 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Sigh, another memory leakJ. Alexander Treuman2006-07-16
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4374 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fixing what looks like a *huge* memory leakJ. Alexander Treuman2006-07-16
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4372 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fixing a whopping 4 memory leaksJ. Alexander Treuman2006-07-16
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4371 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* [CLEANUP] cleanup whitespace -> tabsAvuton Olrich2006-07-14
| | | | | static where it makes sense git-svn-id: https://svn.musicpd.org/mpd/trunk@4344 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Change shank's email addressJ. Alexander Treuman2006-07-14
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Huge header update, update the copyright and addAvuton Olrich2006-07-13
| | | | | the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Remove superfluous \n from addid's commandError call.J. Alexander Treuman2006-05-20
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4208 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Commit Jat's patch for bug 1282Qball Cow2006-05-08
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4137 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Commit Jat's patch for bug 1281Qball Cow2006-05-08
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4136 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Adding of plchangesposid command, this is a stripped down version of the ↵Qball Cow2006-04-23
| | | | | plchanges command, it only sends the pos and id of the changed command. Libmpd allready has support for it, and libmpdclient in libmpd too git-svn-id: https://svn.musicpd.org/mpd/trunk@4101 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* src/playlist.c: remove unnecessary strdup()Eric Wong2006-03-26
| | | | | | Yes, I know about what I said on IRC earlier, but this is an allocation + free inside a loop. git-svn-id: https://svn.musicpd.org/mpd/trunk@3953 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Small fix, it's file: test not file:testQball Cow2006-03-26
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3948 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Support for fetching the content of a stored playlist (patch by qball), this ↵Qball Cow2006-03-26
| | | | | adds listPlaylist and listPlaylistInfo git-svn-id: https://svn.musicpd.org/mpd/trunk@3947 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* for windows compatibility, if we're unable to add a song, convert '\' to '/' ↵Warren Dukes2005-03-08
| | | | | and try again to add the file git-svn-id: https://svn.musicpd.org/mpd/trunk@3036 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix stateFile path getting garbledWarren Dukes2005-03-06
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3029 09075e82-0dd4-0310-85a5-a0d7c8717e4f