Skip to content

Commit

Permalink
#1948 Audio Stream starts are now spun off to a cached thread pool to…
Browse files Browse the repository at this point in the history
… prevent any initial stream connections from delaying the application startup. (#1968)

Co-authored-by: Dennis Sheirer <[email protected]>
  • Loading branch information
DSheirer and Dennis Sheirer authored Sep 3, 2024
1 parent 5d8d3e4 commit e6a8048
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2022 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -344,14 +344,13 @@ private void createBroadcaster(BroadcastConfiguration broadcastConfiguration)
deleteBroadcaster(configuredBroadcast);
}

AbstractAudioBroadcaster audioBroadcaster = BroadcastFactory.getBroadcaster(broadcastConfiguration,
final AbstractAudioBroadcaster audioBroadcaster = BroadcastFactory.getBroadcaster(broadcastConfiguration,
mAliasModel, mUserPreferences);

if(audioBroadcaster != null)
{
configuredBroadcast.setAudioBroadcaster(audioBroadcaster);
audioBroadcaster.setListener(mBroadcastEventListener);
audioBroadcaster.start();
mBroadcasterMap.put(audioBroadcaster.getBroadcastConfiguration().getId(), audioBroadcaster);

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

broadcast(new BroadcastEvent(audioBroadcaster, BroadcastEvent.Event.BROADCASTER_ADD));
ThreadPool.CACHED.submit(audioBroadcaster::start);
}
}
}
Expand Down

0 comments on commit e6a8048

Please sign in to comment.