update gohlslib (#1566)

This commit is contained in:
Alessandro Ros
2023-03-12 16:59:04 +01:00
committed by GitHub
parent f4b9133bb8
commit ed45a09800
7 changed files with 49 additions and 41 deletions

View File

@@ -52,13 +52,10 @@ func (s *hlsSource) run(ctx context.Context, cnf *conf.PathConf, reloadConf chan
}
}()
c, err := hls.NewClient(
cnf.Source,
cnf.SourceFingerprint,
hlsLoggerWrapper(s.Log),
)
if err != nil {
return err
c := &gohlslib.Client{
URI: cnf.Source,
Fingerprint: cnf.SourceFingerprint,
Logger: hlsLoggerWrapper(s.Log),
}
c.OnTracks(func(tracks []format.Format) error {
@@ -144,11 +141,15 @@ func (s *hlsSource) run(ctx context.Context, cnf *conf.PathConf, reloadConf chan
return nil
})
c.Start()
err := c.Start()
if err != nil {
return err
}
for {
select {
case err := <-c.Wait():
c.Close()
return err
case <-reloadConf: