From 2de43144ce91fbcabd596598c3fbd4f1512eb0de Mon Sep 17 00:00:00 2001 From: mask-pp Date: Thu, 6 Aug 2020 16:41:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=84=E8=8C=83=E6=80=A7=E5=B0=8F?= =?UTF-8?q?=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocol/rtmp/rtmprelay/rtmprelay.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/protocol/rtmp/rtmprelay/rtmprelay.go b/protocol/rtmp/rtmprelay/rtmprelay.go index af152e2..549a61f 100644 --- a/protocol/rtmp/rtmprelay/rtmprelay.go +++ b/protocol/rtmp/rtmprelay/rtmprelay.go @@ -3,6 +3,7 @@ package rtmprelay import ( "bytes" "fmt" + "github.com/gwuhaolin/livego/av" "io" "github.com/gwuhaolin/livego/protocol/amf" @@ -92,14 +93,14 @@ func (self *RtmpRelay) Start() error { self.connectPublishClient = core.NewConnClient() log.Debugf("play server addr:%v starting....", self.PlayUrl) - err := self.connectPlayClient.Start(self.PlayUrl, "play") + err := self.connectPlayClient.Start(self.PlayUrl, av.PLAY) if err != nil { log.Debugf("connectPlayClient.Start url=%v error", self.PlayUrl) return err } log.Debugf("publish server addr:%v starting....", self.PublishUrl) - err = self.connectPublishClient.Start(self.PublishUrl, "publish") + err = self.connectPublishClient.Start(self.PublishUrl, av.PUBLISH) if err != nil { log.Debugf("connectPublishClient.Start url=%v error", self.PublishUrl) self.connectPlayClient.Close(nil) From 57a7b19671bbbc12e6710243ba6bf72d632f4bb9 Mon Sep 17 00:00:00 2001 From: mask-pp Date: Fri, 28 Aug 2020 18:32:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=84=E8=8C=83=E6=80=A7=E6=94=B9?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocol/httpflv/writer.go | 2 -- protocol/rtmp/rtmp.go | 1 - protocol/rtmp/rtmprelay/rtmprelay.go | 2 +- test.go | 1 + 4 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 test.go diff --git a/protocol/httpflv/writer.go b/protocol/httpflv/writer.go index e6caa73..1b58222 100755 --- a/protocol/httpflv/writer.go +++ b/protocol/httpflv/writer.go @@ -154,8 +154,6 @@ func (flvWriter *FLVWriter) SendPacket() error { } } - - return nil } func (flvWriter *FLVWriter) Wait() { diff --git a/protocol/rtmp/rtmp.go b/protocol/rtmp/rtmp.go index ec57546..81bd165 100755 --- a/protocol/rtmp/rtmp.go +++ b/protocol/rtmp/rtmp.go @@ -329,7 +329,6 @@ func (v *VirWriter) SendPacket() error { } } - return nil } func (v *VirWriter) Info() (ret av.Info) { diff --git a/protocol/rtmp/rtmprelay/rtmprelay.go b/protocol/rtmp/rtmprelay/rtmprelay.go index 549a61f..bc6a39f 100644 --- a/protocol/rtmp/rtmprelay/rtmprelay.go +++ b/protocol/rtmp/rtmprelay/rtmprelay.go @@ -86,7 +86,7 @@ func (self *RtmpRelay) sendPublishChunkStream() { func (self *RtmpRelay) Start() error { if self.startflag { - return fmt.Errorf("The rtmprelay already started, playurl=%s, publishurl=%s", self.PlayUrl, self.PublishUrl) + return fmt.Errorf("The rtmprelay already started, playurl=%s, publishurl=%s\n", self.PlayUrl, self.PublishUrl) } self.connectPlayClient = core.NewConnClient() diff --git a/test.go b/test.go new file mode 100644 index 0000000..06ab7d0 --- /dev/null +++ b/test.go @@ -0,0 +1 @@ +package main