From fac6e9ecdba34f98e55644010527c0b8f960e98e Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Fri, 6 Nov 2009 01:54:58 +0100
Subject: [PATCH] output/jack: renamed option "ports" to "destination_ports"

Be more clear which kind of port should be configured here.
---
 NEWS                            |  1 +
 doc/user.xml                    |  2 +-
 src/output/jack_output_plugin.c | 10 +++++++++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 515bd5903..b181a9a87 100644
--- a/NEWS
+++ b/NEWS
@@ -38,6 +38,7 @@ ver 0.16 (20??/??/??)
   - jack: connect to server on MPD startup
   - jack: added option "client_name"
   - jack: clear ring buffers before activating
+  - jack: renamed option "ports" to "destination_ports"
   - jack: support mono input
   - httpd: bind port when output is enabled
   - wildcards allowed in audio_format configuration
diff --git a/doc/user.xml b/doc/user.xml
index 59c5c41d7..6eba599ed 100644
--- a/doc/user.xml
+++ b/doc/user.xml
@@ -758,7 +758,7 @@ cd mpd-version</programlisting>
               </row>
               <row>
                 <entry>
-                  <varname>ports</varname>
+                  <varname>destination_ports</varname>
                   <parameter>A,B</parameter>
                 </entry>
                 <entry>
diff --git a/src/output/jack_output_plugin.c b/src/output/jack_output_plugin.c
index 0986a635d..d4aea0f67 100644
--- a/src/output/jack_output_plugin.c
+++ b/src/output/jack_output_plugin.c
@@ -238,7 +238,15 @@ mpd_jack_init(G_GNUC_UNUSED const struct audio_format *audio_format,
 	if (!config_get_block_bool(param, "autostart", false))
 		jd->options |= JackNoStartServer;
 
-	value = config_get_block_string(param, "ports", NULL);
+	value = config_get_block_string(param, "destination_ports", NULL);
+	if (value == NULL) {
+		/* compatibility with MPD < 0.16 */
+		value = config_get_block_string(param, "ports", NULL);
+		if (value != NULL)
+			g_warning("deprecated option 'ports' in line %d",
+				  param->line);
+	}
+
 	if (value != NULL) {
 		char **ports = g_strsplit(value, ",", 0);