Merge pull request #428 from DSheirer/377-npe-in-trellis-decoder

377 NPE in P25 3/4 Rate Trellis Decoder
This commit is contained in:
Denny Sheirer
2018-09-22 02:53:16 -04:00
committed by GitHub
3 changed files with 34 additions and 9 deletions

View File

@@ -350,9 +350,13 @@ public class Trellis_3_4_Rate
public void add( Con con )
{
Node current = getLastNode();
Tribit input = INPUT_FROM_CONSTELLATION_MAP
.get( con )[ current.getState().getValue() ];
Tribit input = null;
if(current != null)
{
input = INPUT_FROM_CONSTELLATION_MAP.get( con )[ current.getState().getValue() ];
}
/* A non-null input tribit from the lookup table is valid, otherwise
* create 8 alternate branches from the original path to explore

View File

@@ -18,7 +18,7 @@ package io.github.dsheirer.source.tuner.channel;
import io.github.dsheirer.dsp.filter.cic.ComplexPrimeCICDecimate;
import io.github.dsheirer.dsp.filter.design.FilterDesignException;
import io.github.dsheirer.dsp.mixer.IOscillator;
import io.github.dsheirer.dsp.mixer.LowPhaseNoiseOscillator;
import io.github.dsheirer.dsp.mixer.Oscillator;
import io.github.dsheirer.sample.IOverflowListener;
import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.buffer.OverflowableReusableBufferTransferQueue;
@@ -81,7 +81,7 @@ public class CICTunerChannelSource extends TunerChannelSource implements Listene
mTunerFrequency = tunerChannel.getFrequency();
long frequencyOffset = mTunerFrequency - getTunerChannel().getFrequency();
mFrequencyCorrectionMixer = new LowPhaseNoiseOscillator(frequencyOffset, sampleRate);
mFrequencyCorrectionMixer = new Oscillator(frequencyOffset, sampleRate);
}
/**

View File

@@ -286,8 +286,22 @@ public abstract class TunerChannelSource extends ComplexSource implements ISourc
{
if(!mStopped)
{
getHeartbeatManager().broadcast();
processSamples();
try
{
getHeartbeatManager().broadcast();
}
catch(Throwable t)
{
mLog.error("Error while sending heartbeat", t);
}
try
{
processSamples();
}
catch(Throwable t)
{
mLog.error("Error while processing samples", t);
}
}
if(mStopped)
@@ -300,8 +314,15 @@ public abstract class TunerChannelSource extends ComplexSource implements ISourc
mScheduledFuture = null;
getHeartbeatManager().broadcast();
performDisposal();
try
{
getHeartbeatManager().broadcast();
performDisposal();
}
catch(Throwable t)
{
mLog.error("Error during final shutdown processing of samples", t);
}
}
}
}