[pulseaudio-discuss] [PATCH 2/3] rtp: rename modarg destination to dstip

Robin H. Johnson robbat2 at gentoo.org
Sat Nov 17 15:31:17 PST 2012


From: "Robin H. Johnson" <robbat2 at gentoo.org>

The module argument 'source' already has special meaning as the
pa_source, however, the argument 'destination' expects an IP address.

Prior to introducing 'srcip', for the source IP address, rename the
'destination' argument to 'dstip'. Include compatibility support for old
RTP users so they don't need to change their variable usage
immediately.

Signed-off-by: Robin H. Johnson <robbat2 at gentoo.org>
---
 src/modules/rtp/module-rtp-send.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/modules/rtp/module-rtp-send.c b/src/modules/rtp/module-rtp-send.c
index 95cb439..1826283 100644
--- a/src/modules/rtp/module-rtp-send.c
+++ b/src/modules/rtp/module-rtp-send.c
@@ -63,7 +63,7 @@ PA_MODULE_USAGE(
         "format=<sample format> "
         "channels=<number of channels> "
         "rate=<sample rate> "
-        "destination=<destination IP address> "
+        "dstip=<destination IP address> "
         "port=<port number> "
         "mtu=<maximum transfer unit> "
         "loop=<loopback to local host?> "
@@ -83,7 +83,8 @@ static const char* const valid_modargs[] = {
     "format",
     "channels",
     "rate",
-    "destination",
+    "destination", /* Compatbility */
+    "dstip",
     "port",
     "mtu" ,
     "loop",
@@ -241,7 +242,10 @@ int pa__init(pa_module*m) {
         goto fail;
     }
 
-    dst_addr = pa_modargs_get_value(ma, "destination", DEFAULT_DESTINATION);
+    dst_addr = pa_modargs_get_value(ma, "destination", NULL);
+	if(dst_addr == NULL) {
+		dst_addr = pa_modargs_get_value(ma, "dstip", DEFAULT_DESTINATION);
+	}
 
     if (inet_pton(AF_INET, dst_addr, &dst_sa4.sin_addr) > 0) {
         dst_sa4.sin_family = af = AF_INET;
@@ -317,7 +321,8 @@ int pa__init(pa_module*m) {
 
     pa_source_output_new_data_init(&data);
     pa_proplist_sets(data.proplist, PA_PROP_MEDIA_NAME, "RTP Monitor Stream");
-    pa_proplist_sets(data.proplist, "rtp.destination", dst_addr);
+    pa_proplist_sets(data.proplist, "rtp.destination", dst_addr); /* Compatability, can we drop it? */
+    pa_proplist_sets(data.proplist, "rtp.dstip", dst_addr);
     pa_proplist_setf(data.proplist, "rtp.mtu", "%lu", (unsigned long) mtu);
     pa_proplist_setf(data.proplist, "rtp.port", "%lu", (unsigned long) port);
     pa_proplist_setf(data.proplist, "rtp.ttl", "%lu", (unsigned long) ttl);
-- 
1.8.0



More information about the pulseaudio-discuss mailing list