mirror of https://bitbucket.org/ausocean/av.git
codec/h264/extract.go: simplified switch
This commit is contained in:
parent
2b52266407
commit
529ca0d547
|
@ -95,9 +95,9 @@ func (e *Extracter) Extract(dst io.Writer, src io.Reader, delay time.Duration) e
|
||||||
buf := make([]byte, maxRTPSize)
|
buf := make([]byte, maxRTPSize)
|
||||||
for {
|
for {
|
||||||
n, err := src.Read(buf)
|
n, err := src.Read(buf)
|
||||||
switch {
|
switch err {
|
||||||
case err == nil: // Do nothing.
|
case nil: // Do nothing.
|
||||||
case err == io.EOF:
|
case io.EOF:
|
||||||
return nil
|
return nil
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("source read error: %v\n", err)
|
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
|
// handleSTAPA parses NAL units from an aggregation packet and writes
|
||||||
|
|
Loading…
Reference in New Issue