+static void rtp_get_netconfig(const char *af,
+ const char *addr,
+ const char *port,
+ struct netaddress *na) {
+ char *vec[3];
+
+ vec[0] = uaudio_get(af, NULL);
+ vec[1] = uaudio_get(addr, NULL);
+ vec[2] = uaudio_get(port, NULL);
+ if(!*vec)
+ na->af = -1;
+ else
+ if(netaddress_parse(na, 3, vec))
+ disorder_fatal(0, "invalid RTP address");
+}
+
+static void rtp_set_netconfig(const char *af,
+ const char *addr,
+ const char *port,
+ const struct netaddress *na) {
+ uaudio_set(af, NULL);
+ uaudio_set(addr, NULL);
+ uaudio_set(port, NULL);
+ if(na->af != -1) {
+ int nvec;
+ char **vec;
+
+ netaddress_format(na, &nvec, &vec);
+ if(nvec > 0) {
+ uaudio_set(af, vec[0]);
+ xfree(vec[0]);
+ }
+ if(nvec > 1) {
+ uaudio_set(addr, vec[1]);
+ xfree(vec[1]);
+ }
+ if(nvec > 2) {
+ uaudio_set(port, vec[2]);
+ xfree(vec[2]);
+ }
+ xfree(vec);
+ }
+}
+
+static size_t rtp_play(void *buffer, size_t nsamples, unsigned flags) {