mirror of https://bitbucket.org/ausocean/av.git
Removed redundant else, to further abide by go style standards
This commit is contained in:
parent
9b779382eb
commit
98cd4ff9ac
|
@ -264,33 +264,32 @@ func input(input string, output string) {
|
|||
if clip, err := ringBuffer.Get(); err != nil {
|
||||
inputErrChan <- err
|
||||
return
|
||||
} else {
|
||||
for {
|
||||
upperBound := clipSize+mp2tPacketSize
|
||||
_, err := io.ReadFull(br, clip[clipSize:upperBound])
|
||||
if err != nil {
|
||||
}
|
||||
for {
|
||||
upperBound := clipSize+mp2tPacketSize
|
||||
_, err := io.ReadFull(br, clip[clipSize:upperBound])
|
||||
if err != nil {
|
||||
inputErrChan <- err
|
||||
return
|
||||
}
|
||||
if *flags&filterFixContinuity != 0 && mp2tFixContinuity(clip[clipsSize:upperBound], packetCount, uint16(*selectedPID)) {
|
||||
fmt.Printf("Packet #%d.%d fixed\n", clipCount, packetCount)
|
||||
}
|
||||
packetCount++
|
||||
clipSize += mp2tPacketSize
|
||||
// send if (1) our buffer is full or (2) 1 second has elapsed and we have % packetsPerFrame
|
||||
now = time.Now()
|
||||
if (packetCount == mp2tMaxPackets) ||
|
||||
(now.Sub(prevTime) > clipDuration*time.Second && packetCount%packetsPerFrame == 0) {
|
||||
clipCount++
|
||||
if err := ringBuffer.DoneWriting(clipSize); err != nil {
|
||||
inputErrChan <- err
|
||||
return
|
||||
}
|
||||
if *flags&filterFixContinuity != 0 && mp2tFixContinuity(clip[clipsSize:upperBound], packetCount, uint16(*selectedPID)) {
|
||||
fmt.Printf("Packet #%d.%d fixed\n", clipCount, packetCount)
|
||||
}
|
||||
packetCount++
|
||||
clipSize += mp2tPacketSize
|
||||
// send if (1) our buffer is full or (2) 1 second has elapsed and we have % packetsPerFrame
|
||||
now = time.Now()
|
||||
if (packetCount == mp2tMaxPackets) ||
|
||||
(now.Sub(prevTime) > clipDuration*time.Second && packetCount%packetsPerFrame == 0) {
|
||||
clipCount++
|
||||
if err := ringBuffer.DoneWriting(clipSize); err != nil {
|
||||
inputErrChan <- err
|
||||
return
|
||||
}
|
||||
clipSize = 0
|
||||
packetCount = 0
|
||||
prevTime = now
|
||||
break
|
||||
}
|
||||
clipSize = 0
|
||||
packetCount = 0
|
||||
prevTime = now
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue