fix(format/mp4f): maxFrames should be setable to reduce delay time
This commit is contained in:
parent
b31edccea5
commit
6d02957c38
@ -26,8 +26,9 @@ type Muxer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewMuxer(w *os.File) *Muxer {
|
func NewMuxer(w *os.File) *Muxer {
|
||||||
return &Muxer{}
|
return &Muxer{maxFrames: 5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *Muxer) SetPath(path string) {
|
func (self *Muxer) SetPath(path string) {
|
||||||
self.path = path
|
self.path = path
|
||||||
}
|
}
|
||||||
@ -291,7 +292,7 @@ func (element *Muxer) WritePacket(pkt av.Packet, GOP bool) (bool, []byte, error)
|
|||||||
if stream.lastpkt != nil {
|
if stream.lastpkt != nil {
|
||||||
ts = pkt.Time - stream.lastpkt.Time
|
ts = pkt.Time - stream.lastpkt.Time
|
||||||
}
|
}
|
||||||
got, buf, err := stream.writePacketV3(pkt, ts, 5)
|
got, buf, err := stream.writePacketV3(pkt, ts, element.maxFrames)
|
||||||
stream.lastpkt = &pkt
|
stream.lastpkt = &pkt
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, []byte{}, err
|
return false, []byte{}, err
|
||||||
@ -302,7 +303,7 @@ func (element *Muxer) WritePacket(pkt av.Packet, GOP bool) (bool, []byte, error)
|
|||||||
if stream.lastpkt != nil {
|
if stream.lastpkt != nil {
|
||||||
ts = pkt.Time - stream.lastpkt.Time
|
ts = pkt.Time - stream.lastpkt.Time
|
||||||
}
|
}
|
||||||
got, buf, err := stream.writePacketV2(pkt, ts, 5)
|
got, buf, err := stream.writePacketV2(pkt, ts, element.maxFrames)
|
||||||
stream.lastpkt = &pkt
|
stream.lastpkt = &pkt
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, []byte{}, err
|
return false, []byte{}, err
|
||||||
|
Loading…
Reference in New Issue
Block a user