Skip to content

Commit

Permalink
修复bug,等待写入后才能获取type
Browse files Browse the repository at this point in the history
  • Loading branch information
langhuihui committed Oct 1, 2020
1 parent 0bdd303 commit 9e626d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9e626d8

Please sign in to comment.