Skip to content

Commit e6a8048

Browse files
DSheirerDennis Sheirer
andauthored
#1948 Audio Stream starts are now spun off to a cached thread pool to prevent any initial stream connections from delaying the application startup. (#1968)
Co-authored-by: Dennis Sheirer <[email protected]>
1 parent 5d8d3e4 commit e6a8048

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* *****************************************************************************
3-
* Copyright (C) 2014-2022 Dennis Sheirer
3+
* Copyright (C) 2014-2024 Dennis Sheirer
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -344,14 +344,13 @@ private void createBroadcaster(BroadcastConfiguration broadcastConfiguration)
344344
deleteBroadcaster(configuredBroadcast);
345345
}
346346

347-
AbstractAudioBroadcaster audioBroadcaster = BroadcastFactory.getBroadcaster(broadcastConfiguration,
347+
final AbstractAudioBroadcaster audioBroadcaster = BroadcastFactory.getBroadcaster(broadcastConfiguration,
348348
mAliasModel, mUserPreferences);
349349

350350
if(audioBroadcaster != null)
351351
{
352352
configuredBroadcast.setAudioBroadcaster(audioBroadcaster);
353353
audioBroadcaster.setListener(mBroadcastEventListener);
354-
audioBroadcaster.start();
355354
mBroadcasterMap.put(audioBroadcaster.getBroadcastConfiguration().getId(), audioBroadcaster);
356355

357356
int index = mConfiguredBroadcasts.indexOf(configuredBroadcast);
@@ -362,6 +361,7 @@ private void createBroadcaster(BroadcastConfiguration broadcastConfiguration)
362361
}
363362

364363
broadcast(new BroadcastEvent(audioBroadcaster, BroadcastEvent.Event.BROADCASTER_ADD));
364+
ThreadPool.CACHED.submit(audioBroadcaster::start);
365365
}
366366
}
367367
}

0 commit comments

Comments
 (0)