kopia lustrzana https://gitlab.com/eliggett/wfview
Fix codec selection issue in both QT5 and 6
rodzic
91ce6040e0
commit
32528a02b8
|
@ -326,7 +326,7 @@ bool audioConverter::convert(audioPacket audio)
|
||||||
As we currently don't have a float based uLaw encoder, this must be done
|
As we currently don't have a float based uLaw encoder, this must be done
|
||||||
after all other conversion has taken place.
|
after all other conversion has taken place.
|
||||||
*/
|
*/
|
||||||
if (inCodec == PCMU)
|
if (outCodec == PCMU)
|
||||||
{
|
{
|
||||||
QByteArray outPacket((int)audio.data.length() / 2, (char)0xff);
|
QByteArray outPacket((int)audio.data.length() / 2, (char)0xff);
|
||||||
qint16* in = (qint16*)audio.data.data();
|
qint16* in = (qint16*)audio.data.data();
|
||||||
|
|
|
@ -69,7 +69,7 @@ audioHandler::~audioHandler()
|
||||||
", uLaw" << setup.ulaw;
|
", uLaw" << setup.ulaw;
|
||||||
|
|
||||||
inFormat = toQAudioFormat(setup.codec, setup.sampleRate);
|
inFormat = toQAudioFormat(setup.codec, setup.sampleRate);
|
||||||
codecType codec = LPCM;
|
codec = LPCM;
|
||||||
if (setup.codec == 0x01 || setup.codec == 0x20)
|
if (setup.codec == 0x01 || setup.codec == 0x20)
|
||||||
codec = PCMU;
|
codec = PCMU;
|
||||||
else if (setup.codec == 0x40 || setup.codec == 0x40)
|
else if (setup.codec == 0x40 || setup.codec == 0x40)
|
||||||
|
@ -80,7 +80,7 @@ audioHandler::~audioHandler()
|
||||||
|
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
|
||||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Preferred Format: SampleSize" << outFormat.sampleSize() << "Channel Count" << outFormat.channelCount() <<
|
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Preferred Format: SampleSize" << outFormat.sampleSize() << "Channel Count" << outFormat.channelCount() <<
|
||||||
"Sample Rate" << outFormat.sampleRate() << "Codec" << outFormat.codec() << "Sample Type" << outFormat.sampleType();
|
"Sample Rate" << outFormat.sampleRate() << "Codec" << codec << "Sample Type" << outFormat.sampleType();
|
||||||
#else
|
#else
|
||||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Preferred Format: SampleFormat" << outFormat.sampleFormat() << "Channel Count" << outFormat.channelCount() <<
|
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Preferred Format: SampleFormat" << outFormat.sampleFormat() << "Channel Count" << outFormat.channelCount() <<
|
||||||
"Sample Rate" << outFormat.sampleRate();
|
"Sample Rate" << outFormat.sampleRate();
|
||||||
|
|
|
@ -138,6 +138,7 @@ private:
|
||||||
OpusEncoder* encoder = Q_NULLPTR;
|
OpusEncoder* encoder = Q_NULLPTR;
|
||||||
OpusDecoder* decoder = Q_NULLPTR;
|
OpusDecoder* decoder = Q_NULLPTR;
|
||||||
QTimer* underTimer;
|
QTimer* underTimer;
|
||||||
|
codecType codec;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue