From e6a804836b6f9ba0d77f113f624970d212ec2615 Mon Sep 17 00:00:00 2001 From: Denny Sheirer Date: Tue, 3 Sep 2024 04:13:25 -0400 Subject: [PATCH] #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 --- .../io/github/dsheirer/audio/broadcast/BroadcastModel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java index 6cd6fdf5f..63402d9d9 100644 --- a/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java +++ b/src/main/java/io/github/dsheirer/audio/broadcast/BroadcastModel.java @@ -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 @@ -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); @@ -362,6 +361,7 @@ private void createBroadcaster(BroadcastConfiguration broadcastConfiguration) } broadcast(new BroadcastEvent(audioBroadcaster, BroadcastEvent.Event.BROADCASTER_ADD)); + ThreadPool.CACHED.submit(audioBroadcaster::start); } } }