mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-05 08:36:56 +08:00
修复bug,等待写入后才能获取type
This commit is contained in:
@@ -75,11 +75,12 @@ func (s *Subscriber) Subscribe(streamPath string) (err error) {
|
||||
for atsent, dropping, droped := s.AudioTag==nil, false, 0; s.Err() == nil; packet.GoNext() {
|
||||
s.TotalPacket++
|
||||
if !dropping {
|
||||
packet.Wait()
|
||||
if !atsent && packet.Type == avformat.FLV_TAG_TYPE_AUDIO {
|
||||
s.sendAv(s.AudioTag, 0)
|
||||
atsent = true
|
||||
}
|
||||
s.send(packet)
|
||||
s.sendAv(&packet.AVPacket, packet.Timestamp-s.startTime)
|
||||
if s.checkDrop(packet) {
|
||||
dropping = true
|
||||
droped = 0
|
||||
|
Reference in New Issue
Block a user