diff --git a/revid/Revid.go b/revid/Revid.go index 6d35f48c..14021837 100644 --- a/revid/Revid.go +++ b/revid/Revid.go @@ -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() } } diff --git a/rtmp/RTMP.go b/rtmp/RTMP.go index 76ee7588..87236421 100644 --- a/rtmp/RTMP.go +++ b/rtmp/RTMP.go @@ -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!") }