From cec88d2897a14f9d0ee10c2a2d4d7b6c93827650 Mon Sep 17 00:00:00 2001 From: Jess Mayo Date: Sat, 11 Jul 2015 14:01:11 +0900 Subject: [PATCH] obs-outputs: Fix stuck "Connecting" with no key With no stream key, no streams were actually being created. This is a crazy configuration anyway, but it resulted in OBS getting stuck in the "Connecting" state with no way to cancel. We now just use the blank key and hope for the best. --- plugins/obs-outputs/librtmp/parseurl.c | 3 +++ plugins/obs-outputs/librtmp/rtmp.c | 13 +++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/obs-outputs/librtmp/parseurl.c b/plugins/obs-outputs/librtmp/parseurl.c index 7a4787df8..7706373f3 100644 --- a/plugins/obs-outputs/librtmp/parseurl.c +++ b/plugins/obs-outputs/librtmp/parseurl.c @@ -177,6 +177,9 @@ void RTMP_ParsePlaypath(AVal *in, AVal *out) out->av_val = NULL; out->av_len = 0; + if (!playpath) + return; + if ((*ppstart == '?') && (temp=strstr(ppstart, "slist=")) != 0) { diff --git a/plugins/obs-outputs/librtmp/rtmp.c b/plugins/obs-outputs/librtmp/rtmp.c index 16d729ce4..425644984 100644 --- a/plugins/obs-outputs/librtmp/rtmp.c +++ b/plugins/obs-outputs/librtmp/rtmp.c @@ -633,16 +633,13 @@ int RTMP_SetupURL(RTMP *r, char *url) int RTMP_AddStream(RTMP *r, const char *playpath) { int idx = -1; + AVal pp = { (char*)playpath, playpath?(int)strlen(playpath):0 }; - if (playpath && *playpath) - { - AVal pp = {(char*)playpath, (int)strlen(playpath)}; - RTMP_ParsePlaypath(&pp, &r->Link.streams[r->Link.nStreams].playpath); - r->Link.streams[r->Link.nStreams].id = -1; + RTMP_ParsePlaypath(&pp, &r->Link.streams[r->Link.nStreams].playpath); + r->Link.streams[r->Link.nStreams].id = -1; - idx = r->Link.nStreams; - r->Link.nStreams++; - } + idx = r->Link.nStreams; + r->Link.nStreams++; return idx; }