SDRDaemonSink: 16/24 bit support (2): works for 16 bit stream

This commit is contained in:
f4exb 2018-09-09 22:35:25 +02:00
parent 7158107e58
commit 22746ff813
2 changed files with 2 additions and 9 deletions

View File

@ -174,7 +174,7 @@ void SDRdaemonSourceBuffer::checkSlotData(int slotIndex)
if (sampleRate > 0) if (sampleRate > 0)
{ {
int64_t ts = m_currentMeta.m_tv_sec * 1000000LL + m_currentMeta.m_tv_usec; int64_t ts = m_currentMeta.m_tv_sec * 1000000LL + m_currentMeta.m_tv_usec;
ts -= (rwDelayBytes * 1000000LL) / (sampleRate * sizeof(SDRdaemonSample)); ts -= (rwDelayBytes * 1000000LL) / (sampleRate * 2 * m_currentMeta.m_sampleBytes);
m_tvOut_sec = ts / 1000000LL; m_tvOut_sec = ts / 1000000LL;
m_tvOut_usec = ts - (m_tvOut_sec * 1000000LL); m_tvOut_usec = ts - (m_tvOut_sec * 1000000LL);
} }

View File

@ -57,12 +57,6 @@ public:
} }
}; };
struct SDRdaemonSample
{
int16_t i;
int16_t q;
};
struct Header struct Header
{ {
uint16_t frameIndex; uint16_t frameIndex;
@ -70,12 +64,11 @@ public:
uint8_t filler; uint8_t filler;
}; };
static const int samplesPerBlock = (SDRDAEMONSOURCE_UDPSIZE - sizeof(Header)) / sizeof(SDRdaemonSample);
static const int framesSize = SDRDAEMONSOURCE_NBDECODERSLOTS * (SDRDAEMONSOURCE_NBORIGINALBLOCKS - 1) * (SDRDAEMONSOURCE_UDPSIZE - sizeof(Header)); static const int framesSize = SDRDAEMONSOURCE_NBDECODERSLOTS * (SDRDAEMONSOURCE_NBORIGINALBLOCKS - 1) * (SDRDAEMONSOURCE_UDPSIZE - sizeof(Header));
struct ProtectedBlock struct ProtectedBlock
{ {
SDRdaemonSample samples[samplesPerBlock]; uint8_t buf[SDRDAEMONSOURCE_UDPSIZE - sizeof(Header)];
}; };
struct SuperBlock struct SuperBlock