kopia lustrzana https://gitlab.com/eliggett/wfview
Merge branch 'audio-enhance'
commit
1503ecd9f7
|
@ -575,7 +575,6 @@ qint64 audioHandler::writeData(const char* data, qint64 nBytes)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
void audioHandler::incomingAudio(audioPacket inPacket)
|
||||
{
|
||||
// No point buffering audio until stream is actually running.
|
||||
|
@ -594,8 +593,13 @@ void audioHandler::incomingAudio(audioPacket inPacket)
|
|||
/* Decode the frame. */
|
||||
QByteArray outPacket((setup.samplerate / 50) * sizeof(qint16) * setup.radioChan, (char)0xff); // Preset the output buffer size.
|
||||
qint16* out = (qint16*)outPacket.data();
|
||||
|
||||
int nSamples = opus_decode(decoder, in, inPacket.data.size(), out, (setup.samplerate / 50), 0);
|
||||
int nSamples = opus_packet_get_nb_samples(in, inPacket.data.size(),setup.samplerate);
|
||||
if (nSamples != setup.samplerate / 50)
|
||||
{
|
||||
qInfo(logAudio()) << "Opus nSamples=" << nSamples << " expected:" << (setup.samplerate / 50);
|
||||
return;
|
||||
}
|
||||
nSamples = opus_decode(decoder, in, inPacket.data.size(), out, (setup.samplerate / 50), 0);
|
||||
|
||||
if (nSamples < 0)
|
||||
{
|
||||
|
|
Ładowanie…
Reference in New Issue