do fast scan for remote players on startup

This commit is contained in:
Drew Weymouth
2025-03-29 15:15:13 -07:00
parent 6a7f06769d
commit d4c1b560d5
2 changed files with 11 additions and 3 deletions
+9 -1
View File
@@ -96,7 +96,15 @@ func (p *PlaybackManager) addOnTrackChangeHook() {
})
}
func (p *PlaybackManager) ScanRemotePlayers(ctx context.Context, waitSec int) {
func (p *PlaybackManager) ScanRemotePlayers(ctx context.Context, fastScan bool) {
if fastScan {
p.scanRemotePlayers(ctx, 1 /*waitSec*/)
// continue to slow scan to detect players that take longer to respond
}
p.scanRemotePlayers(ctx, 10 /*waitSec*/)
}
func (p *PlaybackManager) scanRemotePlayers(ctx context.Context, waitSec int) {
devices, _ := device.SearchMediaRenderers(ctx, waitSec, services.AVTransport, services.RenderingControl)
var discovered []remotePlayer