diff --git a/parser/H264Parser.go b/parser/H264Parser.go index 21191717..3d116367 100644 --- a/parser/H264Parser.go +++ b/parser/H264Parser.go @@ -102,8 +102,9 @@ func (p *h264Parser) parse() { outputBuffer := make([]byte, 0, outputBufferSize) searchingForEnd := false for p.isParsing { + var aByte uint8 if p.isParsing { - aByte := <-p.inputChan + aByte = <-p.inputChan } else { return } @@ -111,7 +112,7 @@ func (p *h264Parser) parse() { outputBuffer = append(outputBuffer, aByte) for i := 1; aByte == 0x00 && i != 4; i++ { if p.isParsing { - aByte := <-p.inputChan + aByte = <-p.inputChan } else { return } @@ -125,7 +126,7 @@ func (p *h264Parser) parse() { searchingForEnd = false } if p.isParsing { - aByte := <-p.inputChan + aByte = <-p.inputChan } else { return }