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.
This commit is contained in:
parent
52996158b3
commit
452a4b5085
@ -4361,10 +4361,10 @@ RTMP_Close(RTMP *r)
|
|||||||
free(r->Link.streams[idx].playpath.av_val);
|
free(r->Link.streams[idx].playpath.av_val);
|
||||||
r->Link.streams[idx].playpath.av_val = NULL;
|
r->Link.streams[idx].playpath.av_val = NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
r->Link.curStreamIdx = 0;
|
r->Link.curStreamIdx = 0;
|
||||||
r->Link.nStreams = 0;
|
r->Link.nStreams = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ((r->Link.protocol & RTMP_FEATURE_WRITE) &&
|
if ((r->Link.protocol & RTMP_FEATURE_WRITE) &&
|
||||||
(r->Link.pFlags & RTMP_PUB_CLEAN) &&
|
(r->Link.pFlags & RTMP_PUB_CLEAN) &&
|
||||||
|
@ -946,6 +946,13 @@ static int try_connect(struct rtmp_stream *stream)
|
|||||||
|
|
||||||
// this should have been called already by rtmp_stream_create
|
// this should have been called already by rtmp_stream_create
|
||||||
//RTMP_Init(&stream->rtmp);
|
//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))
|
if (!RTMP_SetupURL(&stream->rtmp, stream->path.array))
|
||||||
return OBS_OUTPUT_BAD_PATH;
|
return OBS_OUTPUT_BAD_PATH;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user