obs-outputs: Fix rtmp authentication

Reinstate flag checks in RTMP_Close that were erroneously removed.

Clear out the Link state before we establish a new connection. There is
too much state carried around during authentication that has no good
place to clear it in librtmp, which assumes a clean structure when the
connection is initially established.
This commit is contained in:
Jess Mayo 2015-07-11 13:53:07 +09:00
parent 1efb8491be
commit 1682d77df3
2 changed files with 10 additions and 6 deletions

View File

@ -4221,14 +4221,17 @@ RTMP_Close(RTMP *r)
}
#if defined(CRYPTO) || defined(USE_ONLY_MD5)
for (int idx = 0; idx < r->Link.nStreams; idx++)
if (!(r->Link.protocol & RTMP_FEATURE_WRITE) || (r->Link.pFlags & RTMP_PUB_CLEAN))
{
free(r->Link.streams[idx].playpath.av_val);
r->Link.streams[idx].playpath.av_val = NULL;
}
for (int idx = 0; idx < r->Link.nStreams; idx++)
{
free(r->Link.streams[idx].playpath.av_val);
r->Link.streams[idx].playpath.av_val = NULL;
}
r->Link.curStreamIdx = 0;
r->Link.nStreams = 0;
r->Link.curStreamIdx = 0;
r->Link.nStreams = 0;
}
if ((r->Link.protocol & RTMP_FEATURE_WRITE) &&
(r->Link.pFlags & RTMP_PUB_CLEAN) &&

View File

@ -394,6 +394,7 @@ static int try_connect(struct rtmp_stream *stream)
info("Connecting to RTMP URL %s...", stream->path.array);
memset(&stream->rtmp.Link, 0, sizeof(stream->rtmp.Link));
if (!RTMP_SetupURL(&stream->rtmp, stream->path.array))
return OBS_OUTPUT_BAD_PATH;