Closed f4exb closed 4 years ago
There is a second issue with DSDDecoder::setDecodeMode
because it does not return to initial state after having changed the sync lookup settings. The same code used in the constructor should be used to reset initial state:
resetFrameSync();
noCarrier();
m_squelchTimeoutCount = 0;
m_nxdnInterSyncCount = -1; // reset to quiet state
Fixed in v1.8.6
This has been discovered in SDRangel because the decoder parameter settings and the sample feed run in different threads. It is reported here: https://github.com/f4exb/sdrangel/issues/406
This becomes an issue with this line of code: https://github.com/f4exb/dsdcc/blob/master/dsd_symbol.cpp#L265
This can cause a divide by zero if
m_count
is reset in a different thread. It could be possible to use mutexes but a simple guard code like this could fix the issue:In fact if
m_count
is 0 it means we should restart symbol search from the beginning and that no symbol was discovered.