Perform unsubscribe in parallel to avoid blocking (#1760)

* Perform unsubscribe in parallel to avoid blocking

When unsubscribing from tracks, we flush a blank frame in order to prepare
the transceivers for re-use. This process is blocking for ~200ms. If
the unsubscribes are performed serially, it would prevent other subscribe
operation from continuing.

This PR parallelizes that operation, and ensures subsequent subscribe
operations could reuse the existing transceivers.

* also perform in parallel when uptrack close

* fix a few log fields
This commit is contained in:
David Zhao
2023-06-02 00:13:18 -07:00
committed by GitHub
parent 9a698736d1
commit b5c8fe5294
8 changed files with 53 additions and 20 deletions
+1 -1
View File
@@ -830,7 +830,7 @@ func (d *DownTrack) Close() {
d.CloseWithFlush(true)
}
// Close track, flush used to indicate whether send blank frame to flush
// CloseWithFlush - flush used to indicate whether send blank frame to flush
// decoder of client.
// 1. When transceiver is reused by other participant's video track,
// set flush=true to avoid previous video shows before new stream is displayed.