Removed extra indentation using continue

This commit is contained in:
Saxon Milton 2018-04-16 14:57:42 +09:30
parent 3e9d7ef523
commit fa7437cbd7
1 changed files with 16 additions and 16 deletions

View File

@ -302,23 +302,23 @@ func (r *revid) packClips() {
r.Log(Error, err.Error())
r.Log(Warning, "Clearing output chan!")
r.flushData()
} else {
for {
frame := r.getFrame()
lenOfFrame := len(frame)
upperBound := clipSize + lenOfFrame
copy(clip[clipSize:upperBound], frame)
packetCount++
clipSize += lenOfFrame
if packetCount >= r.config.FramesPerClip {
if err := r.ringBuffer.DoneWriting(clipSize); err != nil {
r.Log(Error, err.Error())
r.Log(Warning, "Dropping clip!")
}
clipSize = 0
packetCount = 0
break
continue
}
for {
frame := r.getFrame()
lenOfFrame := len(frame)
upperBound := clipSize + lenOfFrame
copy(clip[clipSize:upperBound], frame)
packetCount++
clipSize += lenOfFrame
if packetCount >= r.config.FramesPerClip {
if err := r.ringBuffer.DoneWriting(clipSize); err != nil {
r.Log(Error, err.Error())
r.Log(Warning, "Dropping clip!")
}
clipSize = 0
packetCount = 0
break
}
}
}