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

@@ -351,8 +351,12 @@ public class Trellis_3_4_Rate
{ {
Node current = getLastNode(); Node current = getLastNode();
Tribit input = INPUT_FROM_CONSTELLATION_MAP Tribit input = null;
.get( con )[ current.getState().getValue() ];
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 /* A non-null input tribit from the lookup table is valid, otherwise
* create 8 alternate branches from the original path to explore * 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.cic.ComplexPrimeCICDecimate;
import io.github.dsheirer.dsp.filter.design.FilterDesignException; import io.github.dsheirer.dsp.filter.design.FilterDesignException;
import io.github.dsheirer.dsp.mixer.IOscillator; 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.IOverflowListener;
import io.github.dsheirer.sample.Listener; import io.github.dsheirer.sample.Listener;
import io.github.dsheirer.sample.buffer.OverflowableReusableBufferTransferQueue; import io.github.dsheirer.sample.buffer.OverflowableReusableBufferTransferQueue;
@@ -81,7 +81,7 @@ public class CICTunerChannelSource extends TunerChannelSource implements Listene
mTunerFrequency = tunerChannel.getFrequency(); mTunerFrequency = tunerChannel.getFrequency();
long frequencyOffset = mTunerFrequency - getTunerChannel().getFrequency(); long frequencyOffset = mTunerFrequency - getTunerChannel().getFrequency();
mFrequencyCorrectionMixer = new LowPhaseNoiseOscillator(frequencyOffset, sampleRate); mFrequencyCorrectionMixer = new Oscillator(frequencyOffset, sampleRate);
} }
/** /**

View File

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