mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-10-05 15:57:03 +08:00
feat: add speed play
This commit is contained in:
@@ -20,6 +20,12 @@ type HDLPuller struct {
|
||||
pool *util.ScalableMemoryAllocator
|
||||
}
|
||||
|
||||
func NewHDLPuller() *HDLPuller {
|
||||
return &HDLPuller{
|
||||
pool: util.NewScalableMemoryAllocator(1024),
|
||||
}
|
||||
}
|
||||
|
||||
func (puller *HDLPuller) Connect(p *m7s.Puller) (err error) {
|
||||
if strings.HasPrefix(p.RemoteURL, "http") {
|
||||
var res *http.Response
|
||||
@@ -88,8 +94,10 @@ func (puller *HDLPuller) Pull(p *m7s.Puller) (err error) {
|
||||
mem := frame.Malloc(int(dataSize))
|
||||
_, err = io.ReadFull(puller, mem)
|
||||
if err != nil {
|
||||
frame.Recycle()
|
||||
return
|
||||
}
|
||||
frame.ReadFromBytes(mem)
|
||||
puller.absTS = offsetTs + (timestamp - startTs)
|
||||
frame.Timestamp = puller.absTS
|
||||
// fmt.Println(t, offsetTs, timestamp, startTs, puller.absTS)
|
||||
|
Reference in New Issue
Block a user