mirror of
https://github.com/Monibuca/plugin-ts.git
synced 2025-10-28 09:41:30 +08:00
增加发布结束传递链
This commit is contained in:
10
main.go
10
main.go
@@ -21,6 +21,7 @@ type TS struct {
|
|||||||
TSInfo
|
TSInfo
|
||||||
//TsChan chan io.Reader
|
//TsChan chan io.Reader
|
||||||
lastDts uint64
|
lastDts uint64
|
||||||
|
parent Publisher
|
||||||
}
|
}
|
||||||
type TSInfo struct {
|
type TSInfo struct {
|
||||||
TotalPesCount int
|
TotalPesCount int
|
||||||
@@ -164,8 +165,15 @@ func (ts *TS) run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
func (ts *TS) OnClosed() {
|
||||||
|
if ts.parent != nil {
|
||||||
|
ts.parent.OnClosed()
|
||||||
|
}
|
||||||
|
}
|
||||||
func (ts *TS) Publish(streamPath string, publisher Publisher) (result bool) {
|
func (ts *TS) Publish(streamPath string, publisher Publisher) (result bool) {
|
||||||
|
if publisher != ts {
|
||||||
|
ts.parent = publisher
|
||||||
|
}
|
||||||
if result = ts.InputStream.Publish(streamPath, publisher); result {
|
if result = ts.InputStream.Publish(streamPath, publisher); result {
|
||||||
ts.TSInfo.RoomInfo = &ts.Room.RoomInfo
|
ts.TSInfo.RoomInfo = &ts.Room.RoomInfo
|
||||||
ts.MpegTsStream = mpegts.NewMpegTsStream(2048)
|
ts.MpegTsStream = mpegts.NewMpegTsStream(2048)
|
||||||
|
|||||||
Reference in New Issue
Block a user