kopia lustrzana https://gitlab.com/eliggett/wfview
Only start audio when stream is ready
rodzic
05d9c16eb9
commit
f4cdcccfec
|
@ -350,7 +350,9 @@ qint64 audioHandler::readData(char* buffer, qint64 nBytes)
|
|||
#endif
|
||||
// Calculate output length, always full samples
|
||||
int sentlen = 0;
|
||||
|
||||
if (!isReady) {
|
||||
isReady = true;
|
||||
}
|
||||
if (ringBuf->size()>0)
|
||||
{
|
||||
// Output buffer is ALWAYS 16 bit.
|
||||
|
@ -439,6 +441,9 @@ int audioHandler::writeData(void* outputBuffer, void* inputBuffer, unsigned int
|
|||
qint64 audioHandler::writeData(const char* data, qint64 nBytes)
|
||||
{
|
||||
#endif
|
||||
if (!isReady) {
|
||||
isReady = true;
|
||||
}
|
||||
int sentlen = 0;
|
||||
//qDebug(logAudio()) << "nFrames" << nFrames << "nBytes" << nBytes;
|
||||
int chunkBytes = chunkSize * devChannels * 2;
|
||||
|
@ -481,7 +486,7 @@ void audioHandler::incomingAudio(audioPacket inPacket)
|
|||
// Regardless of the radio stream format, the buffered audio will ALWAYS be
|
||||
// 16bit sample interleaved stereo 48K (or whatever the native sample rate is)
|
||||
|
||||
if (!isInitialized)
|
||||
if (!isInitialized && !isReady)
|
||||
{
|
||||
qDebug(logAudio()) << "Packet received when stream was not ready";
|
||||
return;
|
||||
|
|
|
@ -141,6 +141,7 @@ private:
|
|||
|
||||
void reinit();
|
||||
bool isInitialized=false;
|
||||
bool isReady = false;
|
||||
|
||||
#if defined(RTAUDIO)
|
||||
RtAudio* audio = Q_NULLPTR;
|
||||
|
|
Ładowanie…
Reference in New Issue