mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-19 20:17:25 -05:00
Fix #2377: add null check for mAudioOutput in processAudioSegments to prevent NPE when no audio outputs present (#2378)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -189,28 +189,31 @@ public class AudioPlaybackManager implements Listener<AudioSegment>, IAudioContr
|
|||||||
}
|
}
|
||||||
else if(audioSegment.isLinked())
|
else if(audioSegment.isLinked())
|
||||||
{
|
{
|
||||||
mAudioChannelsLock.lock();
|
if(mAudioOutput != null)
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
for(AudioChannel audioOutput: mAudioOutput.getAudioProvider().getAudioChannels())
|
mAudioChannelsLock.lock();
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if(audioOutput.isLinkedTo(audioSegment))
|
for(AudioChannel audioOutput: mAudioOutput.getAudioProvider().getAudioChannels())
|
||||||
{
|
{
|
||||||
it.remove();
|
if(audioOutput.isLinkedTo(audioSegment))
|
||||||
audioOutput.play(audioSegment);
|
{
|
||||||
|
it.remove();
|
||||||
|
audioOutput.play(audioSegment);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
finally
|
||||||
finally
|
{
|
||||||
{
|
mAudioChannelsLock.unlock();
|
||||||
mAudioChannelsLock.unlock();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Sort audio segments by playback priority and assign to empty audio outputs
|
//Sort audio segments by playback priority and assign to empty audio outputs
|
||||||
if(!mAudioSegments.isEmpty())
|
if(!mAudioSegments.isEmpty() && mAudioOutput != null)
|
||||||
{
|
{
|
||||||
mAudioSegments.sort(mAudioSegmentPrioritySorter);
|
mAudioSegments.sort(mAudioSegmentPrioritySorter);
|
||||||
mAudioChannelsLock.lock();
|
mAudioChannelsLock.lock();
|
||||||
|
|||||||
Reference in New Issue
Block a user