revid: removed revid's overwnship of rtp encoder

This commit is contained in:
saxon 2018-11-21 21:34:28 +10:30
parent 92294aed70
commit 4f4bebae25
1 changed files with 4 additions and 6 deletions

View File

@ -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