From 003808858b4daff62a6ba693f6d4f017fe33a821 Mon Sep 17 00:00:00 2001 From: Saxon Date: Tue, 5 Mar 2019 10:50:31 +1030 Subject: [PATCH 1/2] revid: handling csv output var in revid's update function --- revid/revid.go | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/revid/revid.go b/revid/revid.go index f36cbca0..9fea7eab 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -387,23 +387,25 @@ func (r *Revid) Update(vars map[string]string) error { for key, value := range vars { switch key { case "Output": - r.config.Outputs = make([]uint8, 1) - // FIXME(kortschak): There can be only one! - // How do we specify outputs after the first? - // - // Maybe we shouldn't be doing this! - switch value { - case "File": - r.config.Outputs[0] = File - case "Http": - r.config.Outputs[0] = Http - case "Rtmp": - r.config.Outputs[0] = Rtmp - case "FfmpegRtmp": - r.config.Outputs[0] = FfmpegRtmp - default: - r.config.Logger.Log(logger.Warning, pkg+"invalid Output1 param", "value", value) - continue + outputs := strings.Split(value, ",") + r.config.Outputs = make([]uint8, len(outputs)) + + for i, output := range outputs { + switch output { + case "File": + r.config.Outputs[i] = File + case "Http": + r.config.Outputs[i] = Http + case "Rtmp": + r.config.Outputs[i] = Rtmp + case "FfmpegRtmp": + r.config.Outputs[i] = FfmpegRtmp + case "Rtp": + r.config.Outputs[i] = Rtp + default: + r.config.Logger.Log(logger.Warning, pkg+"invalid output param", "value", value) + continue + } } case "Packetization": From 79d0dad757f9c89dce7b48fa43e2e93fb4b48a14 Mon Sep 17 00:00:00 2001 From: Saxon Date: Tue, 5 Mar 2019 16:38:32 +1030 Subject: [PATCH 2/2] revid: checking for changes to rtp address in vars now --- revid/revid.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/revid/revid.go b/revid/revid.go index 9fea7eab..193e5175 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -427,6 +427,8 @@ func (r *Revid) Update(vars map[string]string) error { r.config.FramesPerClip = uint(f) case "RtmpUrl": r.config.RtmpUrl = value + case "RtpAddr": + r.config.RtpAddress = value case "Bitrate": v, err := strconv.ParseUint(value, 10, 0) if err != nil {