aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* directory.c: get rid of the horrid dirname(3) and libgen.h dependencyEric Wong2008-01-03
| | | | | | | | | Ok, so basename(3) is even more brain-damaged, inconsistent and/or broken than dirname(3) on most systems, but there are broken implementations of it out there. Just use our already existing internal parent_path() function instead and get rid of the only place where we look for libgen.h. git-svn-id: https://svn.musicpd.org/mpd/trunk@7129 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* document parent_path()Eric Wong2008-01-03
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7128 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* playerCloseAudio() is staticEric Wong2008-01-03
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7127 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* player.c: introduce set_current_song to avoid needless repetitionEric Wong2008-01-03
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7126 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* song: updateSongInfo: left out charset conversion when going thread-safeEric Wong2008-01-01
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7124 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* silence is constant, as is the buffer we pass to playAudioEric Wong2008-01-01
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7123 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Simplify decode cleanup logic a bitEric Wong2008-01-01
| | | | | | | | | | | DECODE_STATE_STOP is always set as dc->state, and dc->stop is always cleared. So handle it in decodeStart once rather than doing it in every plugin. While we're at it, fix a long-standing (but difficult to trigger) bug in mpc_decode where we failed to return if mpc_decoder_initialize() fails. git-svn-id: https://svn.musicpd.org/mpd/trunk@7122 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* charConv: tie the buffer size for iconv() to our PATH_MAX constantEric Wong2008-01-01
| | | | | | | Although most PATH_MAX is higher than the 1k buffer we set, some implementations will set a 256 (or even 64) byte PATH_MAX, so we should be prepared for that. git-svn-id: https://svn.musicpd.org/mpd/trunk@7121 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* storedPlaylist: remove the needless StoredPlaylist struct and just use ListEric Wong2008-01-01
| | | | | | | | | | | Abstractions should reduce the amount of code and make things easier to follow. The StoredPlaylist struct did not do that, so get rid of it and just use our standard linked list implementation instead. diffstat agrees with me that the abstraction is pointless: 3 files changed, 60 insertions(+), 90 deletions(-) git-svn-id: https://svn.musicpd.org/mpd/trunk@7120 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* storedPlaylist: cleanup API and avoid needless heap allocations + error checksEric Wong2008-01-01
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7119 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* storedPlaylist: cleanup load functionEric Wong2008-01-01
| | | | | | | | | | | * stop supporting unused parentlen block, I have no idea how it was ever usable, but playlists don't work in subdirectories... * myFgets is far easier to use than fgetc loops. * Since we're using myFgets, we'll just skip lines that are too long, rather than error out and bitch and moan about things... git-svn-id: https://svn.musicpd.org/mpd/trunk@7118 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* playlist: cleanup pathname generation for the "rm" command, tooEric Wong2008-01-01
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7117 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* playlist: avoid the use of newStoredPlaylist for saving active playlistsEric Wong2008-01-01
| | | | | | It was a nice way to double the memory needed to write the playlist to a file. git-svn-id: https://svn.musicpd.org/mpd/trunk@7116 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Make utf8_to_fs_playlist_path universally accessibleEric Wong2008-01-01
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7115 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* storedPlaylist: fix compile warning (last-second internal API change)Eric Wong2008-01-01
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7114 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* mpc_plugin: break out if a missed error branchEric Wong2008-01-01
| | | | | We shouldn't try to continue if mpc_decoder_initialize() fails. git-svn-id: https://svn.musicpd.org/mpd/trunk@7113 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Revert r7111 and begin to properly fix storedPlaylist codeEric Wong2008-01-01
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7112 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Don't let xstrdup(s) crash crash when s is NULL, but return Null in steadQball Cow2007-12-31
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7111 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* ogg_common: fix indent screwupEric Wong2007-12-31
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7109 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix builds that only have FLAC >= 1.1.3 but not Ogg-VorbisEric Wong2007-12-31
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7108 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Merge branches/ew r7104Eric Wong2007-12-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-27
| | | | | | 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-16
| | | | | 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-16
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7077 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix possible wrong 'addition'Qball Cow2007-12-10
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7076 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix replaygain for latest flac version.Qball Cow2007-12-06
| | | | | | 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-28
| | | | | | 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-28
| | | | | | | | 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-21
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7042 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Fix Sun C 5.9 / C99 compatiblityAvuton Olrich2007-11-21
| | | 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-21
| | | | | | | 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-18
| | | | | 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-16
| | | 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-03
| | | | | 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-26
| | | | | | | | | | | | | 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-17
| | | | | | 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-14
| | | 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-10
| | | 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-10
| | | | | | | | 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-10
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6872 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* playerInit() is staticEric Wong2007-09-08
| | | 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-08
| | | | | | | | | | | | | | 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-07
| | | | | | 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-07
| | | | | 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-06
| | | | | | | | | | | | | | 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-06
| | | | | | | | 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-06
| | | | | | | 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-05
| | | 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-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
* Redirect stdin *before* we establish a listen socketEric Wong2007-09-05
| | | | | | 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