aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs/audioOutput_jack.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* jack: added constant "frame_size"Max Kellermann2008-10-241-1/+2
| | | | | | Don't hard-code a frame size of "4" (16 bit stereo), calculate the sample size from sizeof(*buffer), and create the constant "frame_size".
* jack: fix indentationMax Kellermann2008-10-241-33/+33
| | | | Indent with tabs.
* audio_format: renamed sampleRate to sample_rateMax Kellermann2008-10-101-4/+4
| | | | | The last bit of CamelCase in audio_format.h. Additionally, rename a bunch of local variables.
* don't include os_compat.hMax Kellermann2008-10-081-0/+2
| | | | | When there are standardized headers, use these instead of the bloated os_compat.h.
* use C99 struct initializersMax Kellermann2008-09-291-9/+8
| | | | | | The old struct initializers are error prone and don't allow moving elements around. Since we are going to overhaul some of the APIs soon, it's easier to have all implementations use C99 initializers.
* output: make "struct audio_output" opaque for output pluginsMax Kellermann2008-09-241-30/+27
| | | | | | | | | | | We have eliminated direct accesses to the audio_output struct from the all output plugins. Make it opaque for them, and move its real declaration to output_internal.h, similar to decoder_internal.h. Pass the opaque structure to plugin.init() only, which will return the plugin's data pointer on success, and NULL on failure. This data pointer will be passed to all other methods instead of the audio_output struct.
* output: added audio_output_closed()Max Kellermann2008-09-241-1/+1
| | | | | | The JACK output plugin needs to reset its "opened" flag when the JACK server fails. To prevent it from accessing the audio_output struct directly introduce the API function audio_output_closed().
* output: set audio_output->open=1 in audio_output_task()Max Kellermann2008-09-241-4/+1
| | | | | Since the output plugin returns a value indicating success or error, we can have the output core code assign the "open" flag.
* output: pass audio_format to plugin.init() and plugin.open()Max Kellermann2008-09-241-8/+18
| | | | | | | Pass the globally configured audio_format as a const pointer to plugin.init(). plugin.open() gets a writable pointer which contains the audio_format requested by the plugin. Its initial value is either the configured audio_format or the input file's audio_format.
* output: const plugin structuresMax Kellermann2008-09-081-1/+1
| | | | | Since the plugin struct is never modified, we should store it in constant locations.
* output: renamed typedef AudioOutput to struct audio_outputMax Kellermann2008-09-071-12/+12
| | | | | Also rename AudioOutputPlugin to struct audio_output_plugin, and use forward declarations to reduce include dependencies.
* output: added output_api.hMax Kellermann2008-09-071-3/+2
| | | | | Just like decoder_api.h, output_api.h provides the audio output API which is used by the plugins.
* audio_format: converted typedef AudioFormat to struct audio_formatMax Kellermann2008-09-071-2/+2
| | | | | Get rid of CamelCase, and don't use a typedef, so we can forward-declare it, and unclutter the include dependencies.
* fix -Wcast-qual -Wwrite-strings warningsMax Kellermann2008-09-071-8/+9
| | | | | | | | | 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.
* made "sample_size" static constMax Kellermann2008-08-261-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-261-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-261-10/+0
|
* jack: don't set audioOutput->data=NULLMax Kellermann2008-08-261-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-261-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-261-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-261-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-261-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.
* enable -Wpointer-arith, -Wstrict-prototypesMax Kellermann2008-08-261-2/+2
| | | | | | 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
* use size_t and constant pointer in ao pluginsMax Kellermann2008-04-121-3/+4
| | | | | | | 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
* Cleanup #includes of standard system headers and put them in one placeEric Wong2008-01-031-7/+6
| | | | | | | | | | | | | 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
* adding \n to a bunch of error message stringsJ. Alexander Treuman2007-08-271-3/+3
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6826 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Changing some DEBUG/ERROR/FATAL messages in the JACK plugin.J. Alexander Treuman2007-05-231-18/+13
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@6232 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Only a few changes in jack_playAudio.José Anarch2007-04-111-13/+19
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5909 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Now process and playAudio use mutexes.José Anarch2007-04-091-52/+20
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5897 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
* Another patch from JoseAvuton Olrich2007-03-231-50/+29
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5733 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* Add new update from Jose for JACKAvuton Olrich2007-03-231-31/+71
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5729 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* José Anarch: JACK updatesAvuton Olrich2007-01-201-40/+63
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5267 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* jack: fix type warning in error messageEric Wong2007-01-141-2/+2
| | | | | | | | just casting to int because it's the simplest (%z is not well-supported) Noticed-by: avuton on a 64-bit machine git-svn-id: https://svn.musicpd.org/mpd/trunk@5257 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* jack: fix double-free in finish routineEric Wong2007-01-141-3/+12
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5252 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* jack: fix potential segfaults in parsing bad configs for 'ports'Eric Wong2007-01-141-5/+21
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5251 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* jack: fix multiple segfaults when jackd hasn't been startedEric Wong2007-01-141-8/+17
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5250 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* jack: strdup => xstrdup for error checkingEric Wong2007-01-141-4/+4
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5249 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* jack: declare global variables as staticEric Wong2007-01-141-3/+3
| | | | | | | There's no reason they shouldn't be static. Additionally, output_ports doesn't need to be initialized to NULLs; that is (and has always been) implicit (for all global variables) git-svn-id: https://svn.musicpd.org/mpd/trunk@5247 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* And a fix for the warnings in the last patch for JACKAvuton Olrich2006-12-301-4/+5
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5192 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* A JACK patch to fix some old issues, from author.Avuton Olrich2006-12-301-170/+189
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@5191 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* remove some unneccesary includes from the audioOutput'sWarren Dukes2006-10-181-5/+0
| | | git-svn-id: https://svn.musicpd.org/mpd/trunk@4913 09075e82-0dd4-0310-85a5-a0d7c8717e4f
* jack patch from anarch (and some type fixes for mp4 and acc plugins)Warren Dukes2006-10-181-0/+380
git-svn-id: https://svn.musicpd.org/mpd/trunk@4912 09075e82-0dd4-0310-85a5-a0d7c8717e4f