+static void rtp_configure(void) {
+ char buffer[64];
+
+ uaudio_set("rtp-mode", config->rtp_mode);
+ rtp_set_netconfig("rtp-destination-af",
+ "rtp-destination",
+ "rtp-destination-port", &config->broadcast);
+ rtp_set_netconfig("rtp-source-af",
+ "rtp-source",
+ "rtp-source-port", &config->broadcast_from);
+ snprintf(buffer, sizeof buffer, "%ld", config->multicast_ttl);
+ uaudio_set("multicast-ttl", buffer);
+ uaudio_set("multicast-loop", config->multicast_loop ? "yes" : "no");
+ if(config->rtp_verbose)
+ disorder_info("RTP: configured");
+}
+
+/** @brief Add an RTP recipient address
+ * @param sa Pointer to recipient address
+ * @return 0 on success, -1 on error
+ */
+int rtp_add_recipient(const struct sockaddr_storage *sa) {
+ struct rtp_recipient *r;
+ int rc;
+ pthread_mutex_lock(&rtp_lock);
+ for(r = rtp_recipient_list;
+ r && sockaddrcmp((struct sockaddr *)sa,
+ (struct sockaddr *)&r->sa);
+ r = r->next)
+ ;
+ if(r)
+ rc = -1;
+ else {
+ r = xmalloc(sizeof *r);
+ memcpy(&r->sa, sa, sizeof *sa);
+ r->next = rtp_recipient_list;
+ rtp_recipient_list = r;
+ rc = 0;
+ }
+ pthread_mutex_unlock(&rtp_lock);
+ return rc;