codec/h264/extract.go: simplified switch

This commit is contained in:
Saxon 2019-10-23 14:38:18 +10:30
parent 2b52266407
commit 529ca0d547
1 changed files with 3 additions and 4 deletions

View File

@ -95,9 +95,9 @@ func (e *Extracter) Extract(dst io.Writer, src io.Reader, delay time.Duration) e
buf := make([]byte, maxRTPSize)
for {
n, err := src.Read(buf)
switch {
case err == nil: // Do nothing.
case err == io.EOF:
switch err {
case nil: // Do nothing.
case io.EOF:
return nil
default:
return fmt.Errorf("source read error: %v\n", err)
@ -143,7 +143,6 @@ func (e *Extracter) Extract(dst io.Writer, src io.Reader, delay time.Duration) e
}
}
}
return nil
}
// handleSTAPA parses NAL units from an aggregation packet and writes