From 49340a40ec9f0cbd0696c2bf12e48c01642df1ab Mon Sep 17 00:00:00 2001 From: nareix Date: Wed, 13 Jul 2016 20:20:01 +0800 Subject: [PATCH] rtmp: bugfix createURL --- format/rtmp/rtmp.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/format/rtmp/rtmp.go b/format/rtmp/rtmp.go index a9e1c5b..77a23e3 100644 --- a/format/rtmp/rtmp.go +++ b/format/rtmp/rtmp.go @@ -301,7 +301,10 @@ func createURL(tcurl, app, play string) (u *url.URL) { out = append(out, s) } } - path := "/"+strings.Join(out, "/") + if len(out) < 2 { + out = append(out, "") + } + path := strings.Join(out, "/") u, _ = url.ParseRequestURI(path) if tcurl != "" { @@ -311,7 +314,6 @@ func createURL(tcurl, app, play string) (u *url.URL) { u.Scheme = tu.Scheme } } - return } @@ -875,6 +877,7 @@ func (self *Conn) WriteHeader(streams []av.CodecData) (err error) { } } + self.streams = streams self.stage++ return }