From: qydysky Date: Mon, 31 Jul 2023 23:15:47 +0000 (+0800) Subject: Fix 配置显示错误 X-Git-Tag: v0.10.8~13 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=9322395fb6d4a1d2016cd7694fc99a50ac625cb7;p=bili_danmu%2F.git Fix 配置显示错误 --- diff --git a/F/api.go b/F/api.go index c3f802e..7129fb0 100644 --- a/F/api.go +++ b/F/api.go @@ -360,7 +360,15 @@ func (t *GetFunc) Html() (missKey []string) { // 配置直播流 func (t *GetFunc) configStreamType(sts []J.StreamType) { - defer apilog.Base_add(`configStreamType`).L(`T: `, fmt.Sprintf("使用直播流 %s %s %s", t.Qn[t.Live_qn], t.StreamType.Format_name, t.StreamType.Codec_name)) + var chosenType c.StreamType + + defer func() { + apilog := apilog.Base_add(`configStreamType`) + if _, ok := t.Qn[t.Live_qn]; !ok { + apilog.L(`W: `, `未知的清晰度`, t.Live_qn) + } + apilog.L(`T: `, fmt.Sprintf("使用直播流 %s %s %s", t.Qn[t.Live_qn], chosenType.Format_name, chosenType.Codec_name)) + }() if v, ok := t.Common.K_v.LoadV(`直播流类型`).(string); ok { if st, ok := t.AllStreamType[v]; ok { @@ -384,6 +392,7 @@ func (t *GetFunc) configStreamType(sts []J.StreamType) { continue } + chosenType = t.StreamType //当前直播流质量 t.Live_qn = v.CurrentQn if t.Live_want_qn == 0 { @@ -443,6 +452,7 @@ func (t *GetFunc) configStreamType(sts []J.StreamType) { continue } + chosenType = streamType //当前直播流质量 t.Live_qn = v.CurrentQn if t.Live_want_qn == 0 {