aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Switch to C99 types (retaining compat with old compilers)Eric Wong2008-09-293-4/+4
| | | | | | | | | | | | | | | Seeing the "mpd_" prefix _everywhere_ is mind-numbing as the mind needs to retrain itself to skip over the first 4 tokens of a type to get to its meaning. So avoid having extra characters on my terminal to make it easier to follow code at 2:30 am in the morning. Please report any new issues you may come across on Free toolchains. I realize how difficult it can be to build/maintain cross-compiling toolchains and I have no intention of forcing people to upgrade their toolchains to build mpd. Tested with gcc 2.95.4 and and gcc 4.3.1 on x86-32.
* Merge branch 'mk/client-merge'Eric Wong2008-09-122-10/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mk/client-merge: (49 commits) client: shorten names of the struct client variables client: simplified client_read() client: client_input_received() returns 0 client: check for COMMAND_RETURN_CLOSE client: renamed local variable "selret" to "ret" client: moved CLOSE/KILL check after client_process_line() client: don't check FD_ISSET(client->fd) on expired client client: removed assert(client->fd)>=0 fix -Wcast-qual -Wwrite-strings warnings playlist: return -1 after assert(0) command: concatenate strings at compile time audio: don't pass "fd" to {en,dis}ableAudioDevice() volume: don't pass "fd" to changeVolumeLevel() directory: printDirectoryInfo() does not call commandError() directory: don't pass fd to traverseAllIn() directory: don't pass fd to traverseAllIn() callbacks playlist: PlaylistInfo() does not call commandError() playlist: don't pass "fd" to storedPlaylist.c functions playlist: don't pass "fd" to playlist.c functions playlist: showPlaylist() and shufflePlaylist() cannot fail ...
| * fix -Wcast-qual -Wwrite-strings warningsMax Kellermann2008-09-092-10/+11
| | | | | | | | | | | | | | | | | | The previous patch enabled these warnings. In Eric's branch, they were worked around with a generic deconst_ptr() function. There are several places where we can add "const" to pointers, and in others, libraries want non-const strings. In the latter, convert string literals to "static char[]" variables - this takes the same space, and seems safer than deconsting a string literal.
* | alsa: re-enable-nonblocking, but sleep if busyEric Wong2008-09-101-7/+9
|/ | | | | | | Instead of letting ALSA block for us (and potentially allowing something stupid on certain hardware or drivers), we do the sleeping ourselves. We calculate the sleep to be a fraction of period_time to avoid oversleeping (and thus audible skipping).
* alsa: use blocking instead of non-blocking writeEric Wong2008-09-081-1/+6
| | | | | | | | | | | | The way we used non-blocking mode was HORRIBLE. It was non-blocking to ALSA, but we end up blocking in a busy loop that does absolutely NOTHING but retry. We don't check for playback cancellation (like we do in decoders) or anything. This is seriously broken and I can imagine it affects people on fast CPUs more because we do asynchronous output buffering and our ALSA device will always have data ready.
* alsa: show more debugging informationEric Wong2008-09-081-10/+14
| | | | | | | | | Print out {buffer,period}_{size,time}. Not sure if this is going to help. I've been searching everywhere looking for a possible clue as to what's causing the high CPU usage problems... Also, add device information to some messages I missed earlier.
* alsa: cleanup the mmap logic a bitEric Wong2008-09-081-8/+6
|
* alsa: snd_pcm_sw_params_set_xfer_align is deprecatedEric Wong2008-09-081-3/+0
| | | | | Lets not use deprecated functions. It's apparently possible to not care about the sw_params stuff at all!
* alsa: only run snd_config_update_free_global once atexitEric Wong2008-09-071-3/+7
| | | | | | | | | This is safer than the patch in http://www.musicpd.org/mantis/view.php?id=1542 with multiple audio outputs enabled. Sadly, I only noticed that patch/problem when I googled for "snd_config_update_free_global"
* alsa: move bitformat reading code out of the wayEric Wong2008-09-071-16/+12
|
* alsa: always print the period_time we setEric Wong2008-09-071-2/+1
|
* alsa: avoid unnecessary heap usage if we don't set a device nameEric Wong2008-09-071-11/+12
|
* alsa: get rid of the needless canPause flagEric Wong2008-09-071-3/+0
| | | | | We never use it for anything anyways as we release the device entirely on pause.
* alsa: avoid reassigning ad->writeiEric Wong2008-09-071-7/+4
| | | | This saves me precious terminal space
* alsa: add reasoning for the non-portable macroEric Wong2008-09-071-0/+2
|
* alsa: capitalize "ALSA" consistently in messagesEric Wong2008-09-071-16/+9
| | | | That's the name of this project.
* alsa: optimistically try resuming from suspendEric Wong2008-09-071-11/+12
| | | | | | | | | | | | Apparently snd_pcm_hw_params_can_resume() can return false even though my hardware does in fact support resuming. So stop carrying that value in the canResume flag and just try to resume when we're in the suspended state; falling back to snd_pcm_prepare only if resuming fails. libao does something similar on resume, too. While we're at it, use the E() macro which will enable us to have better error reporting.
* alsa: extra debugging outputs to fix suspend/hibernateEric Wong2008-09-071-3/+9
| | | | | | Hibernating my laptop while MPD is playing results in ugliness about "alsa device foo was suspend" constantly printed to the logs.
* alsa: cleanup debug assignment of the "cmd" variableEric Wong2008-09-071-66/+50
| | | | | Given the length of the ALSA command names, I only want to see them once per-section of code, if at all...
* tag: fix the shout and oggflac pluginsMax Kellermann2008-09-021-5/+5
| | | | | | During the tag library refactoring, the shout plugin was disabled, and I forgot about adapting it to the new API. Apply the same fixes to the oggflac decoder plugin.
* tag: renamed functions, no CamelCaseMax Kellermann2008-09-021-4/+4
|
* tag: renamed MpdTag and MpdTagItem to struct mpd_tag, struct tag_itemMax Kellermann2008-09-021-2/+2
| | | | | Getting rid of CamelCase; not having typedefs also allows us to forward-declare the structures.
* use deconst_ptr instead of duplicating deconst logicEric Wong2008-09-012-24/+9
|
* jack: made "sample_size" static constMax Kellermann2008-08-311-1/+1
| | | | | sample_size is a variable which is computed at compile time. Declare it "static const", so the compiler can optimize it away.
* moved jack configuration to the JackData structMax Kellermann2008-08-311-49/+64
| | | | | | Storing local configuration in global (static) variables is obviously a bad idea. Move all those variables into the JackData struct, including the locks.
* jack: removed unused macrosMax Kellermann2008-08-311-10/+0
|
* jack: don't set audioOutput->data=NULLMax Kellermann2008-08-311-5/+5
| | | | | | | There is only one caller of freeJackData() left: jack_finishDriver(). This function is called by the mpd core, and is called exactly once for every successful jack_initDriver(). We do not need to clear audioOutput->data, since this variable is invalidated anyway.
* jack: initialize JackData in jack_initDriver()Max Kellermann2008-08-311-6/+2
| | | | | | | | Over the lifetime of the jack AudioOutput object, we want a single valid JackData object, so we can persistently store data there (configuration etc.). Allocate JackData in jack_initDriver(). After that, we can safely remove all audioOutput->data==NULL checks (and replace them with assertions).
* jack: added freeJackClient()Max Kellermann2008-08-311-13/+25
| | | | | | | No need to destroy the JackData object when an error occurs, since jack_finishDriver() already frees it. Only deinitialize the jack library, introduce freeJackClient() for that, and move code from freeJackData().
* jack: initialize jd->client after !jd checkMax Kellermann2008-08-311-5/+5
| | | | | | Prepare the next patch: make the "!jd" check independent of the jd->client initialization. This way we can change the "jd" initialization semantics later.
* jack: eliminate superfluous freeJackData() callsMax Kellermann2008-08-311-6/+0
| | | | | | | connect_jack() invokes freeJackData() in every error handler, although its caller also invokes this function after a failure. We can save a lot of lines in connect_jack() by removing these redundant freeJackData() invocations.
* converted MpdTagItem.type to an enumMax Kellermann2008-08-301-0/+2
| | | | | Don't use CPP macros when you can use C enum... this also allows better type checking.
* enable -Wpointer-arith, -Wstrict-prototypesMax Kellermann2008-08-304-6/+8
| | | | | | Also enable -Wunused-parameter - this forces us to add the gcc "unused" attribute to a lot of parameters (mostly library callback functions), but it's worth it during code refactorizations.
* jack: initialize audioOutput->dataMax Kellermann2008-06-131-1/+3
| | | | | | | | | | | | | Initialize audioOutput->data with NULL in jack_initDriver(). Previously, this was never initialized, although the other functions relied on it being NULL prior to jack_openDevice(). This patch addresses bug 0001641[1]. In contrast to the patch provided by the bug reporter, it moves the initialization before the "!param" check. [1] - http://musicpd.org/mantis/view.php?id=1641 git-svn-id: https://svn.musicpd.org/mpd/trunk@7375 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fixed another shadow warningMax Kellermann2008-04-121-11/+11
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7307 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* use size_t and constant pointer in ao pluginsMax Kellermann2008-04-1210-31/+59
| | | | | | | The audio output plugins should get a constant pointer, because they must not modify the buffer. Since the size is a non-negative buffer size in bytes, we should change its type to size_t. git-svn-id: https://svn.musicpd.org/mpd/trunk@7293 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* yet more unsigned integersMax Kellermann2008-04-121-1/+1
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@7287 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* whitespace cleanupMax Kellermann2008-04-121-7/+7
| | | | | Clean up some space indentations, replace with tabs. git-svn-id: https://svn.musicpd.org/mpd/trunk@7239 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* eliminated duplicate initializationMax Kellermann2008-03-262-4/+4
| | | | | | | Local variables which are never read before the first assignment don't need initialization. Saves a few bytes of text. Also don't reset variables which are never read until function return. git-svn-id: https://svn.musicpd.org/mpd/trunk@7199 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* parse/initialize with the correct data typeMax Kellermann2008-03-261-1/+1
| | | | | | | When we expect an integer as result, why would we use the double precision floating point parser? strtol() is a better match, although we should probably check for overflows... git-svn-id: https://svn.musicpd.org/mpd/trunk@7198 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* explicitly downcastMax Kellermann2008-03-262-3/+3
| | | | | | | | Tools like "sparse" check for missing downcasts, since implicit cast may be dangerous. Although that does not change the compiler result, it may make the code more readable (IMHO), because you always see when there may be data cut off. git-svn-id: https://svn.musicpd.org/mpd/trunk@7196 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fix -Wconst warningsMax Kellermann2008-02-051-6/+11
| | | | | | [ew: cleaned up the dirty union hack a bit] Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fixed "comparison between signed and unsigned"Max Kellermann2008-01-261-1/+1
| | | | | Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7146 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fixed -Wshadow warningsMax Kellermann2008-01-261-44/+44
| | | | | Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7143 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* fixed invalid C prototypesMax Kellermann2008-01-261-1/+1
| | | | | Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7142 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Cleanup #includes of standard system headers and put them in one placeEric Wong2008-01-039-60/+12
| | | | | | | | | | | | | This will make refactoring features easier, especially now that pthreads support and larger refactorings are on the horizon. Hopefully, this will make porting to other platforms (even non-UNIX-like ones for masochists) easier, too. os_compat.h will house all the #includes for system headers considered to be the "core" of MPD. Headers for optional features will be left to individual source files. git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 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
* 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
* adding \n to a bunch of error message stringsJ. Alexander Treuman2007-08-272-4/+4
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6826 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* export FATAL() with noreturn attributeEric Wong2007-08-271-3/+1
| | | | | | | | | | | | | | | | | | | | | 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