Merged in err-check (pull request #459)

revid: check mtsEnc errors and fix codec strings

Approved-by: Saxon Milton
This commit is contained in:
Trek Hopton 2021-03-16 05:16:16 +00:00
commit fa374128c5
2 changed files with 6 additions and 3 deletions

View File

@ -297,7 +297,7 @@ var Variables = []struct {
}, },
{ {
Name: KeyInputCodec, Name: KeyInputCodec,
Type_: "enum:H264,H265,MJPEG,JPEG,PCM,ADPCM", Type_: "enum:h264,h265,mjpeg,jpeg,pcm,adpcm",
Update: func(c *Config, v string) { Update: func(c *Config, v string) {
c.InputCodec = v c.InputCodec = v
}, },

View File

@ -227,7 +227,10 @@ func (r *Revid) setupPipeline(mtsEnc func(dst io.WriteCloser, rate float64) (io.
// as a destination. // as a destination.
if len(mtsSenders) != 0 { if len(mtsSenders) != 0 {
mw := multiWriter(mtsSenders...) mw := multiWriter(mtsSenders...)
e, _ := mtsEnc(mw, float64(r.cfg.FrameRate)) e, err := mtsEnc(mw, float64(r.cfg.FrameRate))
if err != nil {
return fmt.Errorf("error from setting up MTS encoder: %w", err)
}
encoders = append(encoders, e) encoders = append(encoders, e)
} }
@ -238,7 +241,7 @@ func (r *Revid) setupPipeline(mtsEnc func(dst io.WriteCloser, rate float64) (io.
mw := multiWriter(flvSenders...) mw := multiWriter(flvSenders...)
e, err := flvEnc(mw, int(r.cfg.FrameRate)) e, err := flvEnc(mw, int(r.cfg.FrameRate))
if err != nil { if err != nil {
return err return fmt.Errorf("error from setting up FLV encoder: %w", err)
} }
encoders = append(encoders, e) encoders = append(encoders, e)
} }