obs-outputs: Fix RTMP authentication

RTMP authentication requires the curStreamIdx and nStreams be set
between the disconnect / reconnect that occurs in PublisherAuth. Now
that there's no good place to clean them up, zero the whole rtmp->Link
before starting a new stream.
master
Richard Stanway 2020-03-06 22:52:50 +01:00
parent 52996158b3
commit 452a4b5085
2 changed files with 10 additions and 3 deletions

View File

@ -4361,10 +4361,10 @@ RTMP_Close(RTMP *r)
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

@ -946,6 +946,13 @@ static int try_connect(struct rtmp_stream *stream)
// this should have been called already by rtmp_stream_create
//RTMP_Init(&stream->rtmp);
// since we don't call RTMP_Init above, there's no other good place
// to reset this as doing it in RTMP_Close breaks the ugly RTMP
// authentication system
memset(&stream->rtmp.Link, 0, sizeof(stream->rtmp.Link));
stream->rtmp.last_error_code = 0;
if (!RTMP_SetupURL(&stream->rtmp, stream->path.array))
return OBS_OUTPUT_BAD_PATH;