mirror of https://bitbucket.org/ausocean/av.git
trying to fix rtmp issues
This commit is contained in:
parent
c29d4097e2
commit
b9987fe227
|
@ -312,7 +312,7 @@ func (r *revid) packClips() {
|
|||
r.Log(Error, err.Error())
|
||||
r.Log(Warning, "Clearing output chan!")
|
||||
// Keep clearing output chan until out buffer has some space
|
||||
r.rtmpInst.EndSession()
|
||||
//r.rtmpInst.EndSession()
|
||||
for clip, err = r.ringBuffer.Get(); err != nil; {
|
||||
r.flushData()
|
||||
clip, err = r.ringBuffer.Get()
|
||||
|
@ -400,7 +400,6 @@ func (r *revid) outputClips() {
|
|||
r.Log(Error, err2.Error())
|
||||
if r.config.Output == NativeRtmp && errorCount > 10 {
|
||||
r.rtmpInst.EndSession()
|
||||
r.rtmpInst = rtmp.NewRTMPSession(r.config.RtmpUrl, rtmpConnectionTimout)
|
||||
err = r.rtmpInst.StartSession()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,10 +97,10 @@ func (s *rtmpSession) WriteFrame(data []byte, dataLength uint) error {
|
|||
// EndSession terminates the rtmp connection
|
||||
func (s *rtmpSession) EndSession() error {
|
||||
if s.running {
|
||||
s.running = false
|
||||
if !tools.UintToBool(uint(C.RTMP_end_session())) {
|
||||
return errors.New("RTMP end session error! Check rtmp log for details!")
|
||||
}
|
||||
s.running = false
|
||||
} else {
|
||||
return errors.New("Tried to stop rtmp session, but not running!")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue