diff --git a/revid/revid.go b/revid/revid.go index 7cc1a0d5..c3f6ee53 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -111,10 +111,9 @@ type Revid struct { cmd *exec.Cmd // lexTo, encoder and packer handle transcoding the input stream. - lexTo func(dst stream.Encoder, src io.Reader, delay time.Duration) error - encoder stream.Encoder - encoder2 *rtp.Encoder - packer packer + lexTo func(dst stream.Encoder, src io.Reader, delay time.Duration) error + encoder stream.Encoder + packer packer // buffer handles passing frames from the transcoder // to the target destination. buffer *ring.Buffer @@ -282,8 +281,7 @@ func (r *Revid) reset(config Config) error { case MpegtsRtp: r.config.Logger.Log(smartlogger.Info, pkg+"using RTP packetisation") frameRate, _ := strconv.Atoi(r.config.FrameRate) - r.encoder2 = rtp.NewEncoder(&r.packer, frameRate) - r.encoder = mts.NewEncoder(r.encoder2, float64(frameRate)) + r.encoder = mts.NewEncoder(rtp.NewEncoder(&r.packer, frameRate), float64(frameRate)) } return nil