mirror of
https://github.com/lkmio/lkm.git
synced 2025-10-30 02:02:01 +08:00
完善超时处理
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"github.com/lkmio/avformat/libflv"
|
"github.com/lkmio/avformat/libflv"
|
||||||
"github.com/lkmio/avformat/librtmp"
|
"github.com/lkmio/avformat/librtmp"
|
||||||
"github.com/lkmio/avformat/utils"
|
"github.com/lkmio/avformat/utils"
|
||||||
|
"github.com/lkmio/lkm/log"
|
||||||
"github.com/lkmio/lkm/stream"
|
"github.com/lkmio/lkm/stream"
|
||||||
"net"
|
"net"
|
||||||
)
|
)
|
||||||
@@ -32,7 +33,12 @@ func (p *Publisher) Input(data []byte) error {
|
|||||||
func (p *Publisher) OnDeMuxStream(stream utils.AVStream) {
|
func (p *Publisher) OnDeMuxStream(stream utils.AVStream) {
|
||||||
//AVStream的ExtraData已经拷贝, 释放掉内存池中最新分配的内存
|
//AVStream的ExtraData已经拷贝, 释放掉内存池中最新分配的内存
|
||||||
p.FindOrCreatePacketBuffer(stream.Index(), stream.Type()).FreeTail()
|
p.FindOrCreatePacketBuffer(stream.Index(), stream.Type()).FreeTail()
|
||||||
p.PublishSource.OnDeMuxStream(stream)
|
if !p.IsCompleted() {
|
||||||
|
p.PublishSource.OnDeMuxStream(stream)
|
||||||
|
} else if !p.IsTimeoutTrack(stream.Index()) {
|
||||||
|
p.SetTimeoutTrack(stream.Index())
|
||||||
|
log.Sugar.Errorf("添加 %s track超时", stream.Type().ToString())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// OnVideo 解析出来的完整视频包
|
// OnVideo 解析出来的完整视频包
|
||||||
|
|||||||
Reference in New Issue
Block a user