Commit 4f6a713b authored by Richard Dodd's avatar Richard Dodd Committed by Max Kellermann

Add option to not connect jack ports automatically

parent 8f981845
......@@ -12,6 +12,8 @@ ver 0.22 (not yet released)
- ffmpeg: new plugin based on FFmpeg's libavfilter library
- hdcd: new plugin based on FFmpeg's "af_hdcd" for HDCD playback
- volume: convert S16 to S24 to preserve quality and reduce dithering noise
* output
- jack: add option "auto_destination_ports"
* switch to C++17
- GCC 7 or clang 4 (or newer) recommended
......
......@@ -864,6 +864,10 @@ The jack plugin connects to a `JACK server <http://jackaudio.org/>`_.
- The names of the JACK source ports to be created. By default, the ports "left" and "right" are created. To use more ports, you have to tweak this option.
* - **destination_ports A,B**
- The names of the JACK destination ports to connect to.
* - **auto_destination_ports yes|no**
- If set to *yes*, then MPD will automatically create connections between the send ports of
MPD and receive ports of the first sound card; if set to *no*, then MPD will only create
connections to the contents of *destination_ports* if it is set. Enabled by default.
* - **ringbuffer_size NBYTES**
- Sets the size of the ring buffer for each channel. Do not configure this value unless you know what you're doing.
......
......@@ -57,6 +57,8 @@ struct JackOutput final : AudioOutput {
std::string destination_ports[MAX_PORTS];
unsigned num_destination_ports;
/* overrides num_destination_ports*/
bool auto_destination_ports;
size_t ringbuffer_size;
......@@ -201,6 +203,8 @@ JackOutput::JackOutput(const ConfigBlock &block)
num_destination_ports = 0;
}
auto_destination_ports = block.GetBlockValue("auto_destination_ports", true);
if (num_destination_ports > 0 &&
num_destination_ports != num_source_ports)
FormatWarning(jack_output_domain,
......@@ -498,6 +502,10 @@ JackOutput::Start()
const char *dports[MAX_PORTS], **jports;
unsigned num_dports;
if (num_destination_ports == 0) {
/* if user requests no auto connect, we are done */
if (!auto_destination_ports) {
return;
}
/* no output ports were configured - ask libjack for
defaults */
jports = jack_get_ports(client, nullptr, nullptr,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment