aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* fix builds that only have FLAC >= 1.1.3 but not Ogg-VorbisEric Wong2007-12-313-9/+9
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7108 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Merge branches/ew r7104Eric Wong2007-12-2829-430/+408
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thread-safety work in preparation for rewrite to use pthreads Expect no regressions against trunk (r7078), possibly minor performance improvements in update (due to fewer heap allocations), but increased stack usage. Applied the following patches: * maxpath_str for reentrancy (temporary fix, reverted) * path: start working on thread-safe variants of these methods * Re-entrancy work on path/character-set conversions * directory.c: exploreDirectory() use reentrant functions here * directory/update: more use of reentrant functions + cleanups * string_toupper: a strdup-less version of strDupToUpper * get_song_url: a static-variable-free version of getSongUrl() * Use reentrant/thread-safe get_song_url everywhere * replace rmp2amp with the reentrant version, rmp2amp_r * Get rid of the non-reentrant/non-thread-safe rpp2app, too. * buffer2array: assert strdup() returns a usable value in unit tests * replace utf8ToFsCharset and fsCharsetToUtf8 with thread-safe variants * fix storing playlists w/o absolute paths * parent_path(), a reentrant version of parentPath() * parentPath => parent_path for reentrancy and thread-safety * allow "make test" to automatically run embedded unit tests * remove convStrDup() and maxpath_str() * use MPD_PATH_MAX everywhere instead of MAXPATHLEN * path: get rid of appendSlash, pfx_path and just use pfx_dir * get_song_url: fix the ability to play songs in the top-level music_directory git-svn-id: https://svn.musicpd.org/mpd/trunk@7106 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* If clearing stored playlist fails, don't return error + OK. but only the error.Qball Cow2007-12-271-2/+1
| | | | | | this was caused by always having the handleStoredPlaylist function return 0. git-svn-id: https://svn.musicpd.org/mpd/trunk@7105 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* scripts/mpd-indent.sh: fixup goto label indentationEric Wong2007-12-161-1/+6
| | | | | Additionally, use proper shell quoting and shebang line git-svn-id: https://svn.musicpd.org/mpd/trunk@7078 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Know about SND_PCM_STATE_RUNNING, might fix some bugsQball Cow2007-12-161-0/+4
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7077 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix possible wrong 'addition'Qball Cow2007-12-101-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7076 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix replaygain for latest flac version.Qball Cow2007-12-061-0/+9
| | | | | | The updated initialize method did not tell the libFLAC to look for the tag containing the replay information. git-svn-id: https://svn.musicpd.org/mpd/trunk@7075 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Re-enable seeking in http streams.Qball Cow2007-11-282-7/+4
| | | | | | Fixing stopping mpd from block when trying to stop a ogg stream that is buffering. git-svn-id: https://svn.musicpd.org/mpd/trunk@7053 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't try to forever to get data when the sockets winds up in "temporaryQball Cow2007-11-281-8/+21
| | | | | | | | unavailable" when streaming music. But give up after 100 times. This is atm better then waiting until the connection gets back, because mpd blocks on this. git-svn-id: https://svn.musicpd.org/mpd/trunk@7052 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* A better way to do the last patch (extremely minor patch)Avuton Olrich2007-11-211-4/+2
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7042 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix Sun C 5.9 / C99 compatiblityAvuton Olrich2007-11-211-0/+3
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7041 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* When parsing id3_frames take in account that there are different framesQball Cow2007-11-211-40/+137
| | | | | | | and with different field types. This fixes comments for id3v1 and id3v2 git-svn-id: https://svn.musicpd.org/mpd/trunk@7040 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Disable seeking on streams, because of bug 1611. When playing ogg, the ↵Qball Cow2007-11-181-1/+1
| | | | | decoder seeks through the file then starts to play. This does not mix well with streams from websites. Stopping playback of an oggstream that is trying to stream will result in mpd hanging. git-svn-id: https://svn.musicpd.org/mpd/trunk@7039 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Use POSIX compatible tr arguments in autogen.shAvuton Olrich2007-11-161-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7038 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix wavpack endian issues, tested to work for 16bit. (after blowing my ears ↵Qball Cow2007-10-031-1/+18
| | | | | off with white noise) git-svn-id: https://svn.musicpd.org/mpd/trunk@6952 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Playlist queue patch (http://musicpd.org/mantis/view.php?id=1478) version 11.Qball Cow2007-09-265-1/+258
| | | | | | | | | | | | | This adds the following commands: * queueid <id> Add song <id> to the queue. * dequeue <pos> Remove song from <pos> from the queue * queueinfo List the queue To the statusfield it adds the following entry: playlistqueue: <uid> UID can be used by clients to track changes in the playlist queue. git-svn-id: https://svn.musicpd.org/mpd/trunk@6927 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* inputPlugins/_ogg_common.c: fixup includes for new (1.1.4+ FLAC)Eric Wong2007-09-171-1/+3
| | | | | | ogg_stream_type_detect may not be compiled correctly when compiling FLAC (1.1.4+) without Vorbis git-svn-id: https://svn.musicpd.org/mpd/trunk@6896 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add oga extension for flac-1.2.1Avuton Olrich2007-09-141-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6888 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* conf.c: remove extra semi-colon here, tooEric Wong2007-09-101-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6874 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* buffer input while waiting for outputBuffer space in mp4 and (ogg)flacEric Wong2007-09-102-2/+3
| | | | | | | | Both mp4 and (ogg)flac inputPlugins got HTTP inputStream support later in the game, so their calls to sendDataToOutputBuffer() didn't get updated to support buffering while the outputBuffer was full. This fixes it. git-svn-id: https://svn.musicpd.org/mpd/trunk@6873 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* pcm_utils: gcc 2.95 compile fix (extra semi-colon)Eric Wong2007-09-101-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6872 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* playerInit() is staticEric Wong2007-09-082-3/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6868 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* inputStream_http: signal the server to close after all requestsEric Wong2007-09-081-1/+1
| | | | | | | | | | | | | | We want the partial content goodies of HTTP/1.1 without requiring persistent connections. Persistent connections across multiple HTTP requests don't really help in the case of MPD, either, because our content is usually big and heavy. Note: this puts MPD at the hands of the server to correctly close() the TCP connection we're using. If we connect to a rogue server that keeps the connection alive even when request not to, we'll spin :( However, encountering such a server is very unlikely... git-svn-id: https://svn.musicpd.org/mpd/trunk@6867 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* decode: fix seek when pausedEric Wong2007-09-071-0/+1
| | | | | | We need to SIGCONT the decoder process to allow for seeking while paused. git-svn-id: https://svn.musicpd.org/mpd/trunk@6864 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* get rid of unused DECODE_SUFFIX_* #definesEric Wong2007-09-071-7/+0
| | | | | These haven't been used for several years git-svn-id: https://svn.musicpd.org/mpd/trunk@6863 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Once again get rid of busy waiting and use SIGSTOP for pauseEric Wong2007-09-062-4/+24
| | | | | | | | | | | | | | The problems I had were related to the OSS driver and USB device I was using. The problems existed even with the old busy-waiting scheme enabled. OSS - Bithead USB => bad ALSA - Bithead USB => OK OSS - Onboard i8x0 => OK ALSA - Onboard i8x0 => OK bad - slow shutdown, pauses, dropped audio after pause/resume git-svn-id: https://svn.musicpd.org/mpd/trunk@6861 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* return to busy-waiting on pause for now..Eric Wong2007-09-062-24/+4
| | | | | | | | Until we can fix it properly (or replace it with a cleaner event system), I don't want this in trunk. Currently there are strange pauses when queueing and during shutdown that I can't seem to figure out right away. git-svn-id: https://svn.musicpd.org/mpd/trunk@6860 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* send SIGCONT to the player process whenever we need to busy wait on itEric Wong2007-09-061-0/+11
| | | | | | | This fixes the problem of playlist moving/changnig while we're paused Followup to r6822 git-svn-id: https://svn.musicpd.org/mpd/trunk@6859 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* conf: use getBoolBlockParam for block params, tooEric Wong2007-09-052-13/+7
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6858 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* conf: improved boolean config parameter handling from -keEric Wong2007-09-056-34/+68
| | | | | | 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
* Redirect stdin *before* we establish a listen socketEric Wong2007-09-052-29/+29
| | | | | | This way we'll avoid listening on fd=0 and have a better chance of having fd=0 as /dev/null git-svn-id: https://svn.musicpd.org/mpd/trunk@6852 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* log: oops, fix a syntax errorEric Wong2007-09-041-1/+1
| | | | | (yes, it helps to actually compile code before committing it) git-svn-id: https://svn.musicpd.org/mpd/trunk@6851 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* log: better bug avoidance for libraries incorrectly handling fd=0Eric Wong2007-09-041-2/+16
| | | | | | | | | | | | | We redirect stdin to /dev/null to work around a libao bug, but this bug has been fixed in libao since 2003 (according to jat). However, there are likely other bugs in other libraries (and even our code!) that handle fd=0 incorrectly and I'd rather not take the risk[1]. So So it's easiest to just keep fd=0==/dev/null for now... [1] - I've seen several of these myself... git-svn-id: https://svn.musicpd.org/mpd/trunk@6849 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* zeroconf: avoid passing NULLs to Avahi *_free() routinesEric Wong2007-09-021-4/+6
| | | | | | This should fix Debian bug #428551 (mpd crashes when restarting the dbus daemon) git-svn-id: https://svn.musicpd.org/mpd/trunk@6844 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix endless loop when mpd is launched from a non-interactive shell.Eric Wong2007-09-021-1/+5
| | | | | | | | | | | | | | | | | | Thanks to _noth_ for the patch, this fixes Mantis bug #1534 _noth_ wrote: > When MPD is launched from a non-interactive shell, it enters an endless > loop, filling up its error log file with "error accept()'ing" messages. > This is caused by the fact that stdin is already closed when mpd starts > up. listenOnPort() opens up the first of its sockets as fd 0 (the first > empty fd table position). Then, setup_log_output()->redirect_stdin() > overwrites fd0 (fd=open("/dev/null",...); dup2(fd, STDIN_FILENO);) > without checking if it corresponds to the actual standard input (or if > it is open in the first place). This means that listenSockets[0].fd now > is a fd for /dev/null, thus doIOForInterfaces()->getConnections() can't > accept(2) on it and fails with the above error. The attached patch fixes > this for me. git-svn-id: https://svn.musicpd.org/mpd/trunk@6843 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* interface: fix IPV6 hostname buffer deallocation from automaticsEric Wong2007-09-011-12/+7
| | | | | | | | | | | | The host buffer that hostname pointed to is no longer on the stack by the time the SECURE() message is printed. So make it static and thus accessible to all. We won't be calling this stuff in the middle of a child process/thread/task, so there's no Also, hostname is a constant string we shouldn't modify, so mark it as const char *. git-svn-id: https://svn.musicpd.org/mpd/trunk@6842 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* inputPlugins/flac: improve error messagesEric Wong2007-08-281-12/+13
| | | | | | | | | For the default: case, just use the error message that libFLAC provides instead of using something ambiguous. Also, this gets rid of long lines in the code, making it easier to digest. Of course, we save ~100 bytes of text space in the process :) git-svn-id: https://svn.musicpd.org/mpd/trunk@6830 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* log: cleanup: avoid "magic" numbersEric Wong2007-08-281-6/+8
| | | | | | We used a bare '15' in several places and it's not immediately obvious where it came from. This makes it more obvious git-svn-id: https://svn.musicpd.org/mpd/trunk@6829 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* removing debug messages from signal handlersJ. Alexander Treuman2007-08-274-10/+18
| | | | | | | | | As unfortunate as it is to remove such useful debugging messages, it's necessary to fix a potential deadlock with signal handling. A bunch of functions the debug functions call aren't safe to call from a signal handler. There are some alternate solutions, but they're neither pretty nor simple. So just remove them entirely for now. git-svn-id: https://svn.musicpd.org/mpd/trunk@6828 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* interface: print whole debug message at onceJ. Alexander Treuman2007-08-271-7/+8
| | | | | | Using SECURE once without a \n, and again with one, results in a timestamp mid-line. Let's not do that. git-svn-id: https://svn.musicpd.org/mpd/trunk@6827 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* adding \n to a bunch of error message stringsJ. Alexander Treuman2007-08-275-8/+8
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6826 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* send SIGSTOP to player and decoder processes on pause, tooEric Wong2007-08-272-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | as with the stop command, this will cause the player and decoder to suspend and not wake up hundreds of times a second to poll a variable for wakeup. This will reduce power consumption on some CPUs while mpd is paused and not playing. tests: pause && unpause => OK pause && stop && play => OK pause && exit && restart w/statefile && unpause => OK pause && block sound device && \ unpause => failed to open sound device \ => still paused and suspended => unblock sound device && unpause => OK (playing) In all cases, the player process releases the audio device when paused before going into the suspended state. git-svn-id: https://svn.musicpd.org/mpd/trunk@6822 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* export FATAL() with noreturn attributeEric Wong2007-08-274-8/+5
| | | | | | | | | | | | | | | | | | | | | This attribute was set in log.c, but not exported to other modules in log.h This allows us to remove some unneccessary variable initializations that were added in r6277. I did audioOutput_shout.c a bit differently, to avoid some jumps. before: $ size src/mpd text data bss dec hex filename 225546 4040 14600 244186 3b9da src/mpd after: $ size src/mpd text data bss dec hex filename 224698 4040 14600 243338 3b68a src/mpd git-svn-id: https://svn.musicpd.org/mpd/trunk@6821 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* ChangeLog: adding LAME tag ReplayGainJ. Alexander Treuman2007-08-251-0/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6810 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* inputPlugins/mp3_plugin: parse LAME tags for ReplayGain infoJ. Alexander Treuman2007-08-221-46/+104
| | | | | | | | | | | | Parse ReplayGain info in LAME tags and use it if no ID3v2 ReplayGain tags are found. This is currently a bit unsafe, as apparently some LAME tags have bogus ReplayGain values. But I'm finding a lot of MP3s with valid LAME tags that fail the LAME tag CRC check. So until I figure out why that's happening, it's an unreliable method for checking if the LAME tag is valid. A big thanks to tmz for writing the original patch. git-svn-id: https://svn.musicpd.org/mpd/trunk@6798 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* decode: close audio device after initial open if pausedJ. Alexander Treuman2007-08-121-1/+5
| | | | | | | | | | Currently, if we start decoding while the pause flag is set, we open the audio device and leave it opened, blocking other apps from using it. The obvious thing to do is to not open the audio device if the pause flag is set, but the open call also sets the audio format. Therefore I'm leaving the open call in, and just closing it immediately afterwards if the pause flag is set. git-svn-id: https://svn.musicpd.org/mpd/trunk@6745 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* decode: reformatting for better readabilityJ. Alexander Treuman2007-08-121-6/+9
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6742 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* audioOutputs/audioOutput_shout: adding timers backJ. Alexander Treuman2007-08-111-27/+80
| | | | | | | The shout plugin will now feign playback until the connect timeout is hit, preventing connection attempts from blocking playback on local outputs. Note that this patch is very different from remiss' original one. git-svn-id: https://svn.musicpd.org/mpd/trunk@6738 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Cleanup a outcommented debug statementQball Cow2007-08-111-5/+0
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6736 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Extra debug outputQball Cow2007-07-161-3/+16
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6689 09075e82-0dd4-0310-85a5-a0d7c8717e4f