mirror of https://bitbucket.org/ausocean/av.git
codec/h264/h264dec: wrote explantory comment for neglectance of io.EOF error when peeking in RBSP parsing process
This commit is contained in:
parent
4d65d0d433
commit
865c1676da
|
@ -262,6 +262,11 @@ func NewNALUnit(br *bits.BitReader) (*NALUnit, error) {
|
|||
|
||||
for moreRBSPData(br) {
|
||||
next3Bytes, err := br.PeekBits(24)
|
||||
|
||||
// If PeekBits cannot get 3 bytes, but there still might be 2 bytes left in
|
||||
// the source, we will get an io.EOF; we wish to ignore this and continue.
|
||||
// The call to moreRBSPData will determine when we have reached the end of
|
||||
// the NAL unit.
|
||||
if err != nil && errors.Cause(err) != io.EOF {
|
||||
return nil, errors.Wrap(err, "could not Peek next 3 bytes")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue