revid: handling csv output var in revid's update function

This commit is contained in:
Saxon 2019-03-05 10:50:31 +10:30
parent 300b55548b
commit 003808858b
1 changed files with 19 additions and 17 deletions

View File

@ -387,24 +387,26 @@ func (r *Revid) Update(vars map[string]string) error {
for key, value := range vars { for key, value := range vars {
switch key { switch key {
case "Output": case "Output":
r.config.Outputs = make([]uint8, 1) outputs := strings.Split(value, ",")
// FIXME(kortschak): There can be only one! r.config.Outputs = make([]uint8, len(outputs))
// How do we specify outputs after the first?
// for i, output := range outputs {
// Maybe we shouldn't be doing this! switch output {
switch value {
case "File": case "File":
r.config.Outputs[0] = File r.config.Outputs[i] = File
case "Http": case "Http":
r.config.Outputs[0] = Http r.config.Outputs[i] = Http
case "Rtmp": case "Rtmp":
r.config.Outputs[0] = Rtmp r.config.Outputs[i] = Rtmp
case "FfmpegRtmp": case "FfmpegRtmp":
r.config.Outputs[0] = FfmpegRtmp r.config.Outputs[i] = FfmpegRtmp
case "Rtp":
r.config.Outputs[i] = Rtp
default: default:
r.config.Logger.Log(logger.Warning, pkg+"invalid Output1 param", "value", value) r.config.Logger.Log(logger.Warning, pkg+"invalid output param", "value", value)
continue continue
} }
}
case "Packetization": case "Packetization":
switch value { switch value {