Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2055 MultiFrequencyTunerChannelSource Null Pointer Error On Channel … #2070

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,16 @@ private void stopChannelSource(PolyphaseChannelSource channelSource)
synchronized(mBufferDispatcher)
{
mChannelSources.remove(channelSource);
mPolyphaseChannelizer.removeChannel(channelSource);

if(mPolyphaseChannelizer != null)
{
mPolyphaseChannelizer.removeChannel(channelSource);
}

mSourceEventBroadcaster.broadcast(SourceEvent.channelCountChange(getTunerChannelCount()));

//If this is the last/only channel, deregister to stop the sample buffers
if(mPolyphaseChannelizer.getRegisteredChannelCount() == 0)
if(mPolyphaseChannelizer != null && mPolyphaseChannelizer.getRegisteredChannelCount() == 0)
{
mNativeBufferProvider.removeBufferListener(mBufferDispatcher);
mBufferDispatcher.stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,18 @@ private void requestTrafficChannelStart(Channel trafficChannel, APCO25Channel ap
startChannelRequest.addPreloadDataContent(new P25FrequencyBandPreloadDataContent(mFrequencyBandMap.values()));
getInterModuleEventBus().post(startChannelRequest);
}
else
{
//Return the channel to the traffic channel pool since we didn't start it.
if(mManagedPhase1TrafficChannels.contains(trafficChannel))
{
mAvailablePhase1TrafficChannelQueue.add(trafficChannel);
}
else if(mManagedPhase2TrafficChannels.contains(trafficChannel))
{
mAvailablePhase2TrafficChannelQueue.add(trafficChannel);
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,13 @@ public void start()
@Override
public void stop()
{
//Don't perform stop sequence if we haven't been started. There can be a small window on startup where the
//channel rotation monitor can get ahead of the channel source and cause it to try to stop and rotate before
//it has even started, causing an error in the polyphase channel source.
if(mStarted)
{
mStarted = false;
mStarted = false;

if(mTunerChannelSource != null)
{
mTunerChannelSource.stop();
mTunerChannelSource.removeSourceEventListener();
mTunerChannelSource = null;
}
if(mTunerChannelSource != null)
{
mTunerChannelSource.stop();
mTunerChannelSource.removeSourceEventListener();
mTunerChannelSource = null;
}
}

Expand Down
Loading