From 8489d615d80d47ae8de633f5290c979a988e96f2 Mon Sep 17 00:00:00 2001 From: Saxon Date: Sat, 12 Oct 2019 20:54:32 +1030 Subject: [PATCH] revid: panic if invalid input, or invalid input codec for corresponding input --- revid/revid.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/revid/revid.go b/revid/revid.go index 0f5b51da..471ae830 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -177,6 +177,8 @@ func (r *Revid) reset(config Config) error { case codecutil.MJPEG: st = mts.EncodeMJPEG encOptions = append(encOptions, mts.PacketBasedPSI(int(r.config.MinFrames))) + default: + panic("unknown input codec for raspivid input") } case File, V4L: st = mts.EncodeH264 @@ -189,9 +191,13 @@ func (r *Revid) reset(config Config) error { case codecutil.MJPEG: st = mts.EncodeMJPEG encOptions = append(encOptions, mts.PacketBasedPSI(int(r.config.MinFrames))) + default: + panic("unknown input codec for RTSP input") } case Audio: st = mts.EncodeAudio + default: + panic("unknown input type") } return mts.NewEncoder(dst, float64(fps), st, encOptions...)