diff --git a/revid/Revid.go b/revid/Revid.go index 3d97a937..e72388b8 100644 --- a/revid/Revid.go +++ b/revid/Revid.go @@ -314,6 +314,10 @@ func (r *revid) packClips() { // Keep clearing output chan until out buffer has some space for clip, err = r.ringBuffer.Get(); err != nil; { r.flushData() + r.Log(Debug,"Ending rtmp session") + r.rtmpInst.EndSession() + r.Log(Debug, "Creating new session") + r.rtmpInst = rtmp.NewRTMPSession(r.config.RtmpUrl, rtmpConnectionTimout) rtmpError := r.rtmpInst.StartSession() if rtmpError != nil { r.Log(Error, rtmpError.Error()) diff --git a/rtmp/RTMP.go b/rtmp/RTMP.go index 579f1651..76ee7588 100644 --- a/rtmp/RTMP.go +++ b/rtmp/RTMP.go @@ -82,8 +82,6 @@ func (s *rtmpSession) StartSession() error { // WriteFrame writes a frame (flv tag) to the rtmp connection // TODO: Remove mutex func (s *rtmpSession) WriteFrame(data []byte, dataLength uint) error { - s.mutex.Lock() - defer s.mutex.Unlock() if s.running { dataCopy := make([]byte, len(data)) copy(dataCopy, data)