[SCM] rtmpdump/upstream: Reconnect directly when authenticating, don't wait for the close message
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jul 20 00:29:38 UTC 2014
The following commit has been merged in the upstream branch:
commit 1a07d6826506b21612b0e6e2b5fa9fb29b01921e
Author: Martin Storsjo <martin at martin.st>
Date: Fri Jul 4 22:37:29 2014 +0300
Reconnect directly when authenticating, don't wait for the close message
This fixes authentication with wowza 4.x servers, which don't
send any close message in the authentication process.
diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c
index 6e788bb..a6ea64d 100644
--- a/librtmp/rtmp.c
+++ b/librtmp/rtmp.c
@@ -3091,7 +3091,14 @@ 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
@@ -3107,22 +3114,6 @@ HandleInvoke(RTMP *r, const char *body, unsigned int nBodySize)
{
RTMP_Log(RTMP_LOGERROR, "rtmp server requested close");
RTMP_Close(r);
-#ifdef CRYPTO
- if ((r->Link.protocol & RTMP_FEATURE_WRITE) &&
- !(r->Link.pFlags & RTMP_PUB_CLEAN) &&
- ( !(r->Link.pFlags & RTMP_PUB_NAME) ||
- !(r->Link.pFlags & RTMP_PUB_RESP) ||
- (r->Link.pFlags & RTMP_PUB_CLATE) ) )
- {
- /* clean later */
- if(r->Link.pFlags & RTMP_PUB_CLATE)
- r->Link.pFlags |= RTMP_PUB_CLEAN;
- RTMP_Log(RTMP_LOGERROR, "authenticating publisher");
-
- if (!RTMP_Connect(r, NULL) || !RTMP_ConnectStream(r, 0))
- goto leave;
- }
-#endif
}
else if (AVMATCH(&method, &av_onStatus))
{
--
rtmpdump packaging
More information about the pkg-multimedia-commits
mailing list