mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
receiver stop error reporting.
This commit is contained in:
parent
dfea7fca42
commit
a2e0aeec77
@ -406,16 +406,16 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, bitrate int,
|
|||||||
logger.Info().Msgf("received new remote track")
|
logger.Info().Msgf("received new remote track")
|
||||||
|
|
||||||
if !session.Profile().CanShareMedia {
|
if !session.Profile().CanShareMedia {
|
||||||
logger.Warn().Msg("media sharing is disabled for this session")
|
err := receiver.Stop()
|
||||||
receiver.Stop()
|
logger.Warn().Err(err).Msg("media sharing is disabled for this session")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse codec from remote track
|
// parse codec from remote track
|
||||||
codec, ok := codec.ParseRTC(track.Codec())
|
codec, ok := codec.ParseRTC(track.Codec())
|
||||||
if !ok {
|
if !ok {
|
||||||
logger.Warn().Msg("remote track with unknown codec")
|
err := receiver.Stop()
|
||||||
receiver.Stop()
|
logger.Warn().Err(err).Msg("remote track with unknown codec")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,9 +428,9 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, bitrate int,
|
|||||||
}
|
}
|
||||||
|
|
||||||
stopped = true
|
stopped = true
|
||||||
receiver.Stop()
|
err := receiver.Stop()
|
||||||
srcManager.Stop()
|
srcManager.Stop()
|
||||||
logger.Info().Msg("remote track stopped")
|
logger.Err(err).Msg("remote track stopped")
|
||||||
}
|
}
|
||||||
|
|
||||||
if track.Kind() == webrtc.RTPCodecTypeAudio {
|
if track.Kind() == webrtc.RTPCodecTypeAudio {
|
||||||
@ -452,8 +452,8 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, bitrate int,
|
|||||||
}
|
}
|
||||||
manager.camStop = &stopFn
|
manager.camStop = &stopFn
|
||||||
} else {
|
} else {
|
||||||
logger.Warn().Msg("remote track with unsupported codec type")
|
err := receiver.Stop()
|
||||||
receiver.Stop()
|
logger.Warn().Err(err).Msg("remote track with unsupported codec type")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,7 +468,12 @@ func (manager *WebRTCManagerCtx) CreatePeer(session types.Session, bitrate int,
|
|||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for range ticker.C {
|
for range ticker.C {
|
||||||
err := connection.WriteRTCP([]rtcp.Packet{&rtcp.PictureLossIndication{MediaSSRC: uint32(track.SSRC())}})
|
err := connection.WriteRTCP([]rtcp.Packet{
|
||||||
|
&rtcp.PictureLossIndication{
|
||||||
|
MediaSSRC: uint32(track.SSRC()),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Err(err).Msg("remote track rtcp send err")
|
logger.Err(err).Msg("remote track rtcp send err")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user