From d7255a305a1c7e583dc9c3ffb1c373ff7da98da6 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Mon, 4 May 2020 14:10:23 +0100 Subject: [PATCH 1/1] clients/playrtp.c: Don't crash if given `-' on the command line. Organization: Straylight/Edgeware From: Mark Wooding That just means that we didn't get the `-' from the server, so we must open a connection for ourselves. We'll still need it to request the RTP stream. --- clients/playrtp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clients/playrtp.c b/clients/playrtp.c index d28369f..8878e8c 100644 --- a/clients/playrtp.c +++ b/clients/playrtp.c @@ -795,6 +795,12 @@ int main(int argc, char **argv) { struct sockaddr *addr; socklen_t addr_len; if(!strcmp(sl.s[0], "-")) { + /* We'll need a connection to request the incoming stream, so open one if + * we don't have one already */ + if(!c) { + if(!(c = disorder_new(1))) exit(EXIT_FAILURE); + if(disorder_connect(c)) exit(EXIT_FAILURE); + } /* Pick address family to match known-working connectivity to the server */ int family = disorder_client_af(c); /* Get a list of interfaces */ -- [mdw]