diff --git a/codec/mjpeg/extract.go b/codec/mjpeg/extract.go index 9174074f..6fb987bd 100644 --- a/codec/mjpeg/extract.go +++ b/codec/mjpeg/extract.go @@ -72,7 +72,7 @@ func (e *Extractor) Extract(dst io.Writer, src io.Reader, delay time.Duration) e return fmt.Errorf("could not read RTP marker: %w", err) } - err = c.ParseScan(p, m) + err = c.ParsePayload(p, m) if err != nil { return fmt.Errorf("could not parse JPEG scan: %w", err) } diff --git a/codec/mjpeg/jpeg.go b/codec/mjpeg/jpeg.go index 804119fc..41f9e529 100644 --- a/codec/mjpeg/jpeg.go +++ b/codec/mjpeg/jpeg.go @@ -151,8 +151,8 @@ func NewCtx(d io.Writer) *Ctx { } } -// ParseScan will parse a JPEG scan from an RTP/JPEG payload and append -func (c *Ctx) ParseScan(p []byte, m bool) error { +// ParsePayload will parse an RTP/JPEG payload and append to current image. +func (c *Ctx) ParsePayload(p []byte, m bool) error { b := newByteStream(p) _ = b.get8() // Ignore type-specific flag