mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-20 02:00:05 -08:00
api: return static sources in paths/list even if sourceOnDemand is true
This commit is contained in:
parent
ac0a5e9fc7
commit
7067c02030
6 changed files with 315 additions and 174 deletions
|
|
@ -21,8 +21,8 @@ import (
|
|||
|
||||
type rtmpSourceParent interface {
|
||||
log(logger.Level, string, ...interface{})
|
||||
onSourceStaticSetReady(req pathSourceStaticSetReadyReq) pathSourceStaticSetReadyRes
|
||||
onSourceStaticSetNotReady(req pathSourceStaticSetNotReadyReq)
|
||||
onSourceStaticImplSetReady(req pathSourceStaticSetReadyReq) pathSourceStaticSetReadyRes
|
||||
onSourceStaticImplSetNotReady(req pathSourceStaticSetNotReadyReq)
|
||||
}
|
||||
|
||||
type rtmpSource struct {
|
||||
|
|
@ -119,9 +119,7 @@ func (s *rtmpSource) run(ctx context.Context) error {
|
|||
tracks = append(tracks, audioTrack)
|
||||
}
|
||||
|
||||
res := s.parent.onSourceStaticSetReady(pathSourceStaticSetReadyReq{
|
||||
tracks: tracks,
|
||||
})
|
||||
res := s.parent.onSourceStaticImplSetReady(pathSourceStaticSetReadyReq{tracks: tracks})
|
||||
if res.err != nil {
|
||||
return res.err
|
||||
}
|
||||
|
|
@ -129,7 +127,7 @@ func (s *rtmpSource) run(ctx context.Context) error {
|
|||
s.Log(logger.Info, "ready")
|
||||
|
||||
defer func() {
|
||||
s.parent.onSourceStaticSetNotReady(pathSourceStaticSetNotReadyReq{})
|
||||
s.parent.onSourceStaticImplSetNotReady(pathSourceStaticSetNotReadyReq{})
|
||||
}()
|
||||
|
||||
for {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue