aboutsummaryrefslogtreecommitdiffstats
path: root/src/decode.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove a useless if (quit) block. It's enclosed in two while loops: theJ. Alexander Treuman2007-06-091-4/+0
| | | | | | | top depending on !quit, which doesn't set it anywhere before the if (quit) block is reached, and the inner one which doesn't set quit at all. Since it's a local variable and can't be modified externally, it'll never be hit. git-svn-id: https://svn.musicpd.org/mpd/trunk@6524 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Send SIGCONT to the decode process before sending it SIGTERM.J. Alexander Treuman2007-06-071-0/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6503 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't send the main process SIGUSR1 until we've sent the decode processJ. Alexander Treuman2007-06-041-1/+2
| | | | | SIGSTOP. git-svn-id: https://svn.musicpd.org/mpd/trunk@6486 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't kill the player process (and effectively the decode process) whenJ. Alexander Treuman2007-06-041-4/+16
| | | | | | 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
* Cleanup some formatting in decode.c.J. Alexander Treuman2007-06-041-10/+4
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6480 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* The massive copyright updateAvuton Olrich2007-04-051-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't stop decoding when unpausing fails because no audio device can beJ. Alexander Treuman2007-04-031-5/+5
| | | | | opened. Instead just remain in paused state. git-svn-id: https://svn.musicpd.org/mpd/trunk@5820 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Reformatting some code.J. Alexander Treuman2007-04-031-5/+5
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5819 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* #1) fix a few potential deadlock conditons in decode.c when crossfading is ↵Warren Dukes2007-02-111-5/+6
| | | | | | | enabled #2) fix a deadlock condition when attempting to seek if the decoder quit and returned to playerInit() git-svn-id: https://svn.musicpd.org/mpd/trunk@5325 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* on second thought, comment out the debug statement so that users aren't ↵Warren Dukes2007-01-241-1/+1
| | | | | potentially flooded git-svn-id: https://svn.musicpd.org/mpd/trunk@5270 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* add debug statement for bug #1380Warren Dukes2007-01-241-0/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5269 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't initialize globals to zero (or NULL)Eric Wong2007-01-141-1/+1
| | | | | | | | 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
* Do not set metadataState to PLAYER_METADATA_STATE_READ when decoding stops.J. Alexander Treuman2006-12-241-1/+0
| | | | | | | | This fixes a bug where streams that won't play somehow appear with the metadata of a previously played stream. As far as I can tell, the only reason this is done is to sync any buffered metadata with the displayed metadata when decoding stops, so there should be no other adverse effects. git-svn-id: https://svn.musicpd.org/mpd/trunk@5161 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Adding support for seeking HTTP streams.J. Alexander Treuman2006-12-231-1/+3
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5159 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Replace strdup and {c,re,m}alloc with x* variants to check for OOM errorsEric Wong2006-08-261-2/+2
| | | | | | | | | | | | | | | | | | | 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-201-1/+1
| | | | | | 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-141-7/+3
| | | | | | | | | | | | | | | | | | | | | | 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
* more sparse cleanupsEric Wong2006-08-081-1/+1
| | | | | | | | | * 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
* logging cleanupsEric Wong2006-08-011-2/+2
| | | | | | | | | | | | | | * 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
* remove clumsy strncpy useEric Wong2006-07-301-18/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add mpd-indent.shAvuton Olrich2006-07-201-258/+253
| | | | | | 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
* Fixing a whopping 4 memory leaksJ. Alexander Treuman2006-07-161-1/+6
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4371 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* [CLEANUP] Cleanup spaces->tabsAvuton Olrich2006-07-141-87/+87
| | | | | Make functions static where it makes sense git-svn-id: https://svn.musicpd.org/mpd/trunk@4335 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Change shank's email addressJ. Alexander Treuman2006-07-141-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4333 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Remove test on a local variable that won't have been modified yetJ. Alexander Treuman2006-07-141-1/+0
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4324 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Remove unused playSilenceOrSleep macroJ. Alexander Treuman2006-07-141-6/+0
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4323 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Remove some misleading comments, fix shanks terrible spellingJ. Alexander Treuman2006-07-141-6/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4322 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Huge header update, update the copyright and addAvuton Olrich2006-07-131-1/+1
| | | | | the GPL header where necessary git-svn-id: https://svn.musicpd.org/mpd/trunk@4317 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* merge with mpd/trunk up to r3925Eric Wong2006-03-161-21/+60
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3926 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* call dropBufferedAudio() when pausingWarren Dukes2005-12-171-1/+4
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3732 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* gcc 2.95 fixesEric Wong2005-11-191-1/+1
| | | | | | | | | | audioOutput_osx.c, aac_decode.c, mp4_decode.c have NOT been thoroughly checked, but I nevertheless managed to eyeball and fix one incompatibility in audioOutput_osx.c All other files have been build successfully with gcc 2.95 git-svn-id: https://svn.musicpd.org/mpd/trunk@3688 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* DJWLindenaar balanced tree and master process patchQball Cow2005-11-161-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3669 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* "&", not "&&" (the bug itself was harmless, but a bug nevertheless)Eric Wong2005-08-201-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3445 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* drop the current audio buffer when seekingWarren Dukes2005-03-211-0/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3107 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix some signal handlingWarren Dukes2005-03-191-9/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3101 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* todo update, and remove a potentially gratutious playSilence() callWarren Dukes2005-03-101-1/+6
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@3051 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* *) add support for pid filesWarren Dukes2005-03-091-36/+39
| | | | | | | *) we now require pid_file to specified in the config *) new prefered method for killing mpd: mpd --kill *) cleaned up some nastiness with decode_pid handling git-svn-id: https://svn.musicpd.org/mpd/trunk@3042 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* undo fix for killall not preserving the current format properly, it causes ↵Warren Dukes2005-03-081-2/+5
| | | | | problems for alsa and other things that spawn extra process w/o us knowing git-svn-id: https://svn.musicpd.org/mpd/trunk@3039 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* now player and decoder processes should only exit() when receiving term ↵Warren Dukes2005-03-081-2/+3
| | | | | signal from their respective parent processes git-svn-id: https://svn.musicpd.org/mpd/trunk@3034 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* implemented dropping of current buffered audio, works for oss, but there seemsWarren Dukes2005-03-051-0/+1
| | | | | to be a "blip" for alsa devices, needs more work git-svn-id: https://svn.musicpd.org/mpd/trunk@3011 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* merge changes from metadata-rewrite branchWarren Dukes2004-11-101-4/+0
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2589 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* forgot a '\n' at the end of a error statementWarren Dukes2004-11-031-2/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2490 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* when sending metadata to audiodevice, put filename in title if no tag data ↵Warren Dukes2004-10-281-0/+4
| | | | | is found git-svn-id: https://svn.musicpd.org/mpd/trunk@2381 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* undo last changesWarren Dukes2004-10-261-21/+11
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2345 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* try to fix metadata on initially playing (metadata being sent before device ↵Warren Dukes2004-10-261-12/+22
| | | | | is open) git-svn-id: https://svn.musicpd.org/mpd/trunk@2344 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* parse metadata and send to output when playing another streamWarren Dukes2004-10-251-2/+8
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@2338 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix a big time bug in metadataChunk (off by one in an array assignment)Warren Dukes2004-10-251-1/+9
| | | | | also, now we have metadata in our streams git-svn-id: https://svn.musicpd.org/mpd/trunk@2337 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* #1) Fix a potential security hole, where mpd sends a line from a playlist to ↵Warren Dukes2004-10-161-1/+5
| | | | | | | a client if the line is too long. But this is a rare circumstance, since the file would need to have a .m3u suffix and the line would need to be very long. #2) Fix qball's bug, basically when we try todo initial buffering in decodeStart(), sleep for a few seconds after each attempt to finish init'ing the connection and begin buffering. git-svn-id: https://svn.musicpd.org/mpd/trunk@2236 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix a spelling error in messageWarren Dukes2004-08-091-2/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1993 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* report error to error log when unable to open audio deviceWarren Dukes2004-07-121-0/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@1852 09075e82-0dd4-0310-85a5-a0d7c8717e4f