Skip to content

Commit

Permalink
Merge pull request #27 from ZSC714725/http-fmp4-3
Browse files Browse the repository at this point in the history
update
  • Loading branch information
ZSC714725 authored Aug 10, 2023
2 parents d92ea58 + b101a2c commit 4d72913
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fmp4/http-fmp4/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,14 @@ func (session *HttpFmp4Session) handleSession(c *gin.Context) {
return
}
session.hooks.AddConsumer(session.subscriberId, session)
defer session.hooks.RemoveConsumer(session.subscriberId)
connCloseErr := make(chan error, 1)
go func() {
readBuf := make([]byte, 1024)
if _, err = conn.Read(readBuf); err != nil {
connCloseErr <- err
}
}()

session.muxer.WriteInitSegment(conn)
for {
writeFragment := func(data []byte) error {
Expand Down Expand Up @@ -272,6 +272,7 @@ func (session *HttpFmp4Session) handleSession(c *gin.Context) {
}
case <-connCloseErr:
session.OnStop()
return
}
}

Expand Down

0 comments on commit 4d72913

Please sign in to comment.