update gohlslib (#1565)
This commit is contained in:
@@ -32,7 +32,6 @@ jobs:
|
||||
go-version: "1.19"
|
||||
|
||||
- run: |
|
||||
go mod download
|
||||
go mod tidy
|
||||
git diff --exit-code
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ jobs:
|
||||
|
||||
- run: |
|
||||
sed -i '/gortsplib/d' go.mod
|
||||
go mod download
|
||||
go mod tidy
|
||||
git diff --exit-code
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
<h1 align="center">
|
||||
<img src="logo.png" alt="MediaMTX / rtsp-simple-server">
|
||||
</h1>
|
||||
|
||||
@@ -7,7 +7,7 @@ require (
|
||||
github.com/alecthomas/kong v0.7.1
|
||||
github.com/aler9/gortsplib/v2 v2.1.4
|
||||
github.com/asticode/go-astits v1.11.0
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230310115623-ec8d496cca25
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230312114838-5feec7e35841
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
github.com/gin-gonic/gin v1.9.0
|
||||
github.com/google/uuid v1.3.0
|
||||
|
||||
@@ -12,8 +12,8 @@ github.com/asticode/go-astikit v0.30.0 h1:DkBkRQRIxYcknlaU7W7ksNfn4gMFsB0tqMJflx
|
||||
github.com/asticode/go-astikit v0.30.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0=
|
||||
github.com/asticode/go-astits v1.11.0 h1:GTHUXht0ZXAJXsVbsLIcyfHr1Bchi4QQwMARw2ZWAng=
|
||||
github.com/asticode/go-astits v1.11.0/go.mod h1:QSHmknZ51pf6KJdHKZHJTLlMegIrhega3LPWz3ND/iI=
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230310115623-ec8d496cca25 h1:F5rtyEy7a8yILctfOrWjuCAFQhL9MG3E+rWrG8gKZV8=
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230310115623-ec8d496cca25/go.mod h1:lIJHdX5oH3VLUfH3cjA+w3HGIswtgiriB9koNv6ZKCc=
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230312114838-5feec7e35841 h1:J5AIpE6ue/l/IgIlLCi/QQJL2MNBTFQrAkDScGbUaDs=
|
||||
github.com/bluenviron/gohlslib v0.0.0-20230312114838-5feec7e35841/go.mod h1:SYixOK6Kux6cA9AGR1sg1GJdU2TmYiccVpPmS/Rxdt0=
|
||||
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
||||
github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA=
|
||||
github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
_ "embed"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"sync"
|
||||
@@ -97,7 +98,6 @@ func newHLSMuxer(
|
||||
partDuration conf.StringDuration,
|
||||
segmentMaxSize conf.StringSize,
|
||||
readBufferCount int,
|
||||
req *hlsMuxerRequest,
|
||||
wg *sync.WaitGroup,
|
||||
pathName string,
|
||||
pathManager hlsMuxerPathManager,
|
||||
@@ -305,6 +305,7 @@ func (m *hlsMuxer) runInner(innerCtx context.Context, innerReady chan struct{})
|
||||
uint64(m.segmentMaxSize),
|
||||
videoFormat,
|
||||
audioFormat,
|
||||
"",
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("muxer error: %v", err)
|
||||
@@ -540,7 +541,7 @@ func (m *hlsMuxer) handleRequest(req *hlsMuxerRequest) func() *hls.MuxerFileResp
|
||||
Header: map[string]string{
|
||||
"Content-Type": `text/html`,
|
||||
},
|
||||
Body: bytes.NewReader(hlsIndex),
|
||||
Body: io.NopCloser(bytes.NewReader(hlsIndex)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ outer:
|
||||
select {
|
||||
case pa := <-s.chPathSourceReady:
|
||||
if s.alwaysRemux {
|
||||
s.createMuxer(pa.name, "", nil)
|
||||
s.createMuxer(pa.name, "")
|
||||
}
|
||||
|
||||
case pa := <-s.chPathSourceNotReady:
|
||||
@@ -226,7 +226,7 @@ outer:
|
||||
req.res <- nil
|
||||
|
||||
default:
|
||||
r := s.createMuxer(req.path, req.ctx.ClientIP(), req)
|
||||
r := s.createMuxer(req.path, req.ctx.ClientIP())
|
||||
r.processRequest(req)
|
||||
}
|
||||
|
||||
@@ -331,6 +331,7 @@ func (s *hlsServer) onRequest(ctx *gin.Context) {
|
||||
ctx.Writer.WriteHeader(res.Status)
|
||||
|
||||
if res.Body != nil {
|
||||
defer res.Body.Close()
|
||||
n, _ := io.Copy(ctx.Writer, res.Body)
|
||||
res1.muxer.addSentBytes(uint64(n))
|
||||
}
|
||||
@@ -340,7 +341,7 @@ func (s *hlsServer) onRequest(ctx *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *hlsServer) createMuxer(pathName string, remoteAddr string, req *hlsMuxerRequest) *hlsMuxer {
|
||||
func (s *hlsServer) createMuxer(pathName string, remoteAddr string) *hlsMuxer {
|
||||
r := newHLSMuxer(
|
||||
s.ctx,
|
||||
pathName,
|
||||
@@ -353,7 +354,6 @@ func (s *hlsServer) createMuxer(pathName string, remoteAddr string, req *hlsMuxe
|
||||
s.partDuration,
|
||||
s.segmentMaxSize,
|
||||
s.readBufferCount,
|
||||
req,
|
||||
&s.wg,
|
||||
pathName,
|
||||
s.pathManager,
|
||||
|
||||
Reference in New Issue
Block a user