From d3cb619389ebb37d00bdedfc575b70aa7382391f Mon Sep 17 00:00:00 2001 From: Saxon Date: Fri, 25 Oct 2019 00:31:51 +1030 Subject: [PATCH] input/gvctrl/gvctrl.go: adapted Height option function to support channel 1 resolution options (just 1080p so far) --- input/gvctrl/gvctrl.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/input/gvctrl/gvctrl.go b/input/gvctrl/gvctrl.go index ce99e51e..029b3346 100644 --- a/input/gvctrl/gvctrl.go +++ b/input/gvctrl/gvctrl.go @@ -148,7 +148,15 @@ func CodecOut(c Codec) Option { // heights are 256, 360 and 720. func Height(h int) Option { return func(s settings) (settings, error) { - v, ok := map[int]string{256: res256, 360: res360, 720: res720}[h] + var m map[int]string + switch s.ch { + case 1: + // TODO: add other resolutions supported by channel 1. + m = map[int]string{1080: res1080} + case 2: + m = map[int]string{256: res256, 360: res360, 720: res720} + } + v, ok := m[h] if !ok { return s, fmt.Errorf("invalid display height: %d", h) }