// 设置请求参数
rval := reqf.Rval{
Url: m3u8_url.String(),
+ Retry: 2,
ConnectTimeout: 2000,
ReadTimeout: 1000,
Timeout: 2000,
if err != nil {
t.log.L(`E: `, `获取解析m3u8发生错误`, err)
if len(download_seq) != 0 {
- t.log.L(`I: `, `下载最后切片:`, len(download_seq))
continue
}
- break
+ if !reqf.IsTimeout(err) {
+ break
+ }
}
if len(m4s_links) == 0 {
time.Sleep(time.Second)
// 是否在直播
F.Get(&t.common).Get(`Liveing`)
if !t.common.Liveing {
- t.log.L(`T: `, `未直播`)
+ t.log.L(`W: `, `未直播`)
break
}
}
func (t *M4SStream) Stop() {
+ if !t.Status.Islive() {
+ return
+ }
t.exitSign = signal.Init()
t.Status.Done()
t.log.L(`I: `, `正在等待切片下载...`)