mirror of https://bitbucket.org/ausocean/av.git
removed mutex
This commit is contained in:
parent
45f33f3d3a
commit
5847aad552
|
@ -314,6 +314,10 @@ func (r *revid) packClips() {
|
||||||
// Keep clearing output chan until out buffer has some space
|
// Keep clearing output chan until out buffer has some space
|
||||||
for clip, err = r.ringBuffer.Get(); err != nil; {
|
for clip, err = r.ringBuffer.Get(); err != nil; {
|
||||||
r.flushData()
|
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()
|
rtmpError := r.rtmpInst.StartSession()
|
||||||
if rtmpError != nil {
|
if rtmpError != nil {
|
||||||
r.Log(Error, rtmpError.Error())
|
r.Log(Error, rtmpError.Error())
|
||||||
|
|
|
@ -82,8 +82,6 @@ func (s *rtmpSession) StartSession() error {
|
||||||
// WriteFrame writes a frame (flv tag) to the rtmp connection
|
// WriteFrame writes a frame (flv tag) to the rtmp connection
|
||||||
// TODO: Remove mutex
|
// TODO: Remove mutex
|
||||||
func (s *rtmpSession) WriteFrame(data []byte, dataLength uint) error {
|
func (s *rtmpSession) WriteFrame(data []byte, dataLength uint) error {
|
||||||
s.mutex.Lock()
|
|
||||||
defer s.mutex.Unlock()
|
|
||||||
if s.running {
|
if s.running {
|
||||||
dataCopy := make([]byte, len(data))
|
dataCopy := make([]byte, len(data))
|
||||||
copy(dataCopy, data)
|
copy(dataCopy, data)
|
||||||
|
|
Loading…
Reference in New Issue