Browse Source

fix crash that happened when publishing audio with RTMP (#810)

pull/846/head v0.17.16
aler9 5 years ago
parent
commit
9c38b42b4c
  1. 3
      internal/core/rtmp_conn.go

3
internal/core/rtmp_conn.go

@ -254,7 +254,6 @@ func (c *rtmpConn) runRead(ctx context.Context) error {
var h264Decoder *rtph264.Decoder var h264Decoder *rtph264.Decoder
var audioTrack *gortsplib.TrackAAC var audioTrack *gortsplib.TrackAAC
audioTrackID := -1 audioTrackID := -1
var audioClockRate int
var aacDecoder *rtpaac.Decoder var aacDecoder *rtpaac.Decoder
for i, track := range res.stream.tracks() { for i, track := range res.stream.tracks() {
@ -434,7 +433,7 @@ func (c *rtmpConn) runRead(ctx context.Context) error {
return err return err
} }
pts += 1000 * time.Second / time.Duration(audioClockRate) pts += 1000 * time.Second / time.Duration(audioTrack.ClockRate())
} }
} }
} }

Loading…
Cancel
Save