From df440428288a61d5a69a6b7cac3f37303ce45f5d Mon Sep 17 00:00:00 2001 From: William Date: Tue, 1 Feb 2022 17:14:12 +0800 Subject: [PATCH] Minor fix --- internal/livestream/rtmp.go | 2 +- pkg/mqttclient/client.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/livestream/rtmp.go b/internal/livestream/rtmp.go index 43cd001..78c595d 100644 --- a/internal/livestream/rtmp.go +++ b/internal/livestream/rtmp.go @@ -128,7 +128,7 @@ func (h *handler) OnVideo(timestamp uint32, payload io.Reader) error { outBuf = append(outBuf, annexBPrefix()...) outBuf = append(outBuf, videoBuffer[offset:offset+bufferLength]...) - offset += int(bufferLength) + offset += bufferLength } case flvtag.AVCPacketTypeSequenceHeader: const spsCountOffset = 5 diff --git a/pkg/mqttclient/client.go b/pkg/mqttclient/client.go index 34d845d..0429b04 100644 --- a/pkg/mqttclient/client.go +++ b/pkg/mqttclient/client.go @@ -1,5 +1,5 @@ // mqtt_client is an highly customized mqtt client build upon github.com/eclipse/paho.mqtt.golang. -// There are several diffrent client options for subscriber clients and publisher clients. +// There are several different client options for subscriber clients and publisher clients. // Mainly, `opts.OnConnect`, `CleanSession` and `client.AddRoute` for subscribers. package mqttclient @@ -72,7 +72,7 @@ func NewClient(ctx context.Context, config ConfigOptions) mqtt.Client { opts.AddBroker(config.Server) opts.SetClientID(config.ClientID + "-" + uuid.NewString()) - // Official suggestion: Unless ordered delivery of messages is essential (and you have configured your broker to support this e.g. max_inflight_messages=1 in mosquitto) then set ClientOptions.SetOrderMatters(false). Doing so will avoid the below issue (deadlocks due to blocking message handlers). + // Official suggestion: Unless ordered delivery of messages is essential (and you have configured your broker to support this e.g. max_inflight_messages=1 in mosquito) then set ClientOptions.SetOrderMatters(false). Doing so will avoid the below issue (deadlocks due to blocking message handlers). opts.SetOrderMatters(false) opts.SetCleanSession(false) opts.SetUsername(config.Username)