From d3c8f81cc225ca1ffedcf4dcd2b8d8eca6f01cb5 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 17 Feb 2015 09:22:03 -0800 Subject: [PATCH] obs-outputs: Fix potential RTMP auth issue --- plugins/obs-outputs/librtmp/rtmp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/obs-outputs/librtmp/rtmp.c b/plugins/obs-outputs/librtmp/rtmp.c index b0f6e9afb..e983468ad 100644 --- a/plugins/obs-outputs/librtmp/rtmp.c +++ b/plugins/obs-outputs/librtmp/rtmp.c @@ -3046,7 +3046,18 @@ HandleInvoke(RTMP *r, const char *body, unsigned int nBodySize) AMFProp_GetString(AMF_GetProp(&obj2, &av_description, -1), &description); RTMP_Log(RTMP_LOGDEBUG, "%s, error description: %s", __FUNCTION__, description.av_val); /* if PublisherAuth returns 1, then reconnect */ - PublisherAuth(r, &description); + if (PublisherAuth(r, &description) == 1) + { + RTMP_Close(r); + if (r->Link.pFlags & RTMP_PUB_CLATE) + { + r->Link.pFlags |= RTMP_PUB_CLEAN; + } + if (!RTMP_Connect(r, NULL) || !RTMP_ConnectStream(r, 0)) + { + goto leave; + } + } } } else