aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/jack_plugin.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* output/jack: fix crash with mono playbackMax Kellermann2011-02-271-1/+1
| | | | | | With mono sound, jack_sample_size is smaller than frame_size (4 vs 2 bytes), and "space/jack_sample_size==0". That means mpd_jack_play() will return 0, although no error has occurred.
* output/jack: rename variable sample_size to jack_sample_sizeMax Kellermann2011-02-251-5/+6
|
* all: Update copyright header.Avuton Olrich2009-03-131-5/+7
| | | | | | | | This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
* output: removed duplicate debug messages from pluginsMax Kellermann2009-03-011-1/+0
| | | | | The MPD core logs the audio format of all audio outputs. Remove the duplicate message from the plugins.
* output_plugin: report errors with GErrorMax Kellermann2009-02-261-21/+40
| | | | | | | Use GLib's GError library for reporting output device failures. Note that some init() methods don't clean up properly after a failure, but that's ok for now, because the MPD core will abort anyway.
* output_plugin: don't pass audio_output object to method init()Max Kellermann2009-02-251-2/+1
| | | | | | audio_output_get_name() has been removed, which was the only function left in output_api.h. The output plugin doesn't need the audio_output object at all, remove the parameter from the init() method.
* output_api: removed audio_output_get_name()Max Kellermann2009-02-251-10/+4
| | | | Use config_get_block_string("name") instead of audio_output_get_name().
* jack: initialize local variable "space"Max Kellermann2009-02-241-1/+1
| | | | | Fix a gcc warning, initialize the "space" variable at the beginning of mpd_jack_play().
* output: pass the music chunk pointer as void*, not char*Max Kellermann2009-02-231-2/+2
| | | | | | The meaning of the chunk depends on the audio format; don't suggest a specific format by declaring the pointer as "char*", pass "void*" instead.
* output_api: play() returns a lengthMax Kellermann2009-02-231-18/+15
| | | | | | | | The old API required an output plugin to not return until all data passed to the play() method is consumed. Some output plugins have to loop to fulfill that requirement, and may block during that. Simplify these, by letting them consume only part of the buffer: make play() return the length of the consumed data.
* utils: use g_usleep() instead of my_usleep()Max Kellermann2009-02-191-2/+1
| | | | | | | Now that I've found this nice function in the GLib docs, we can finally remove our custom sleep function. Still all those callers of g_usleep() have to be migrated one day to use events, instead of regular polling.
* output_api: don't include config.hMax Kellermann2009-02-161-0/+1
| | | | If an output plugin requires config.h, it should include it directly.
* jack: don't override output_ports in connect()Max Kellermann2009-01-301-10/+22
| | | | | | If no ports are configured, don't overwrite the (NULL) configuration with the port names of the first JACK server. If the server changes after a JACK reconnect, MPD won't attempt to auto-detect again.
* jack: removed sample_rate callbackMax Kellermann2009-01-301-20/+7
| | | | | | | | | | | Currently, the JACK plugin manipulates the audio_format struct which was passed to the open() method. This is very likely to break, because the plugin must not permanently store this pointer. After this patch, MPD ignores sample rate changes. It looks like other software is doing the same, and I guess this is a non-issue. This patch converts the audio_format pointer within jack_data into a static audio_format struct.
* configure.ac: detect jack_set_info_function()Max Kellermann2009-01-301-0/+5
| | | | | jack_set_info_function() is not provided by older libjack versions. Attempt to detect if it is available.
* jack: print info messagesMax Kellermann2009-01-301-0/+7
| | | | | Use jack_set_info_function() to install an info callback. Don't let libjack print them to stderr.
* jack: don't manually close on shutdownMax Kellermann2009-01-291-3/+1
| | | | Return false from mpd_jack_play(), let the MPD core close the device.
* jack: initialize output_ports if not configuredMax Kellermann2009-01-291-0/+3
| | | | Don't leave uninitialized bytes in the jack_data struct.
* jack: close JACK client on stopMax Kellermann2009-01-291-4/+4
| | | | When MPD stops playback, close the JACK client connection.
* jack: removed "bps" attributeMax Kellermann2009-01-291-5/+1
| | | | The "bps" attribute is calculated, but never used.
* jack: make mpd_jack_connect() return boolMax Kellermann2009-01-291-10/+10
| | | | Return true/false instead of 1/-1.
* jack: use loops for allocating/freeing ports/buffersMax Kellermann2009-01-291-36/+32
| | | | | | | Preparation for supporting other channel numbers than stereo: use loops instead of duplicating code for the second channel. Most likely, gcc will unroll these loops, so the binary won't be any different.
* jack: fail if jack_get_ports() returns NULLMax Kellermann2009-01-291-19/+23
| | | | | When jack_get_ports() returns NULL, we cannot have any ports to connect to, and the device cannot play anything.
* jack: use jack_port_name() instead of g_malloc()+sprintf()Max Kellermann2009-01-291-12/+2
| | | | | libjack's jack_port_name() function returns the effective port name, we don't need to do it manually.
* jack: initialize libjack's error function in mpd_jack_init()Max Kellermann2009-01-291-1/+2
| | | | | Do the global libjack initialization in the global plugin initialization function.
* jack: reduced sleep time to 1msMax Kellermann2009-01-291-1/+1
| | | | | | | | | | When waiting for free space in the ring buffer, the JACK plugin sleeped 10ms until there is enough space. This delay was too large for low-latency setups (<10ms), and created a lot of xruns. Work around that by reducing the sleep time to 1ms. A proper solution for this would be to use an event based approach, and we will do it, just not now.
* jack: clear "shutdown" flag on reconnectMax Kellermann2009-01-291-0/+2
| | | | | | | When the connection failed once, you had to restart MPD, because it never cleared the jack_data.shutdown flag. Instead, it refused to play anything "because there is no client thread" (which is wrong at that point).
* jack: allocate ring buffers before connectingMax Kellermann2009-01-291-5/+3
| | | | | If the ring buffers are allocated after jack_activate(), mpd_jack_process() might segfault because it attempts to access them.
* jack: register ports before activating clientsMax Kellermann2009-01-291-5/+5
| | | | Call jack_port_register() before jack_activate().
* use g_free() instead of free()Max Kellermann2009-01-251-4/+4
| | | | | | On some platforms, g_free() must be used for memory allocated by GLib. This patch intends to correct a lot of occurrences, but is probably not complete.
* conf: allow param==NULLMax Kellermann2009-01-251-13/+1
| | | | | | | | Return the default value in the conf_get_block_*() functions when param==NULL was passed. This simplifies a lot of code, because all initialization can be done in one code path, regardless whether configuration is present.
* conf: const pointers in block get functionsMax Kellermann2009-01-251-1/+1
| | | | | All config_get_block_*() functions should accept constant config_param pointers.
* conf: added config_get_block_unsigned()Max Kellermann2009-01-181-15/+2
| | | | Eliminate some more getBlockParam() invocations.
* conf: added config_get_block_string()Max Kellermann2009-01-181-3/+5
| | | | This replaces lots of getBlockParam() invocations.
* jack: parse "ports" setting with g_strsplit()Max Kellermann2009-01-181-20/+7
| | | | Don't modify the configured string.
* jack: use audio_output_get_name()Max Kellermann2009-01-181-11/+1
| | | | | Determine the audio output name with audio_output_get_name() instead of obtaining the name from the configuration again.
* conf: no CamelCase, part IMax Kellermann2009-01-171-2/+2
| | | | Renamed functions, types, variables.
* jack: use GLib instead of utils.hMax Kellermann2009-01-021-15/+14
|
* jack: duplicate jack_get_ports() return valuesMax Kellermann2009-01-021-3/+4
| | | | | | | | | JACK documentation states: "The caller is responsible for calling free(3) any non-NULL returned value." This does not seem to include the array elements. Duplicate them after jack_get_ports(), and free only the array. Convert JackData.output_ports to non-const.
* output plugins: don't include gcc.hMax Kellermann2009-01-011-4/+4
| | | | Use GLib's G_GNUC_UNUSED instead of gcc.h's mpd_unused.
* jack: use GLib loggingMax Kellermann2008-12-291-28/+30
|
* alsa, jack: no const pointers for allocated stringsMax Kellermann2008-11-011-9/+17
| | | | | Make the pointers "device" and "name" non-const, so we don't need the xfree() hack. The default value is expressed as NULL.
* output: use bool for return values and flagsMax Kellermann2008-10-291-8/+8
| | | | | Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
* output: don't compile plugins which are disabledMax Kellermann2008-10-261-9/+0
| | | | Don't compile the sources of disabled output plugins at all.
* renamed src/audioOutputs/ to src/output/Max Kellermann2008-10-261-0/+486
Again, no CamelCase in the directory name.