mirror of https://bitbucket.org/ausocean/av.git
fixing rtmp handshake error
This commit is contained in:
parent
4fdcaa6d0a
commit
6803554434
|
@ -73,6 +73,7 @@ const (
|
|||
sendFailedDelay = 5
|
||||
maxSendFailedErrorCount = 500
|
||||
clipSizeThreshold = 11
|
||||
rtmpConnectionMaxTries = 5
|
||||
)
|
||||
|
||||
// Log Types
|
||||
|
@ -503,11 +504,17 @@ func (r *revid) setupOutputForFfmpegRtmp() error {
|
|||
|
||||
// setupOutputForLibRtmp sets up rtmp output using the wrapper for the c based
|
||||
// librtmp library - makes connection and starts comms etc.
|
||||
func (r *revid) setupOutputForLibRtmp() (err error) {
|
||||
r.rtmpInst = rtmp.NewRTMPSession(r.config.RtmpUrl, rtmpConnectionTimout)
|
||||
err = r.rtmpInst.StartSession()
|
||||
// go r.testRtmp(5000)
|
||||
return
|
||||
func (r *revid) setupOutputForLibRtmp() error {
|
||||
for r.rtmpInst = rtmp.NewRTMPSession(r.config.RtmpUrl, rtmpConnectionTimout),
|
||||
err = r.rtmpInst.StartSession(), noOfTries := 0;
|
||||
err != nil && noOfTries < rtmpConnectionMaxTries; noOfTries++
|
||||
{
|
||||
r.Log(Error, err.Error())
|
||||
r.Log(Info, "Trying to establish rtmp connection again!")
|
||||
r.rtmpInst = rtmp.NewRTMPSession(r.config.RtmpUrl, rtmpConnectionTimout)
|
||||
err = r.rtmpInst.StartSession()
|
||||
}
|
||||
return errors.New("Could not establish rtmp connection, check rtmp url!")
|
||||
}
|
||||
|
||||
// setupOutputForFile sets up an output file to output data to
|
||||
|
|
Loading…
Reference in New Issue