mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
check if we already listen to requested stream. (#13)
This commit is contained in:
parent
5ad5daa6bb
commit
d608e312eb
@ -100,6 +100,11 @@ func (t *Track) SetStream(stream types.StreamSinkManager) error {
|
||||
t.streamMu.Lock()
|
||||
defer t.streamMu.Unlock()
|
||||
|
||||
// if we already listen to the stream, do nothing
|
||||
if t.stream == stream {
|
||||
return nil
|
||||
}
|
||||
|
||||
var err error
|
||||
if t.stream != nil {
|
||||
err = t.stream.MoveListenerTo(&t.listener, stream)
|
||||
|
Loading…
Reference in New Issue
Block a user