- send silence to audio decoder if packet is lost
This commit is contained in:
parent
f30e111ebe
commit
efbf9c5bf8
|
|
@ -522,7 +522,17 @@ AudioReceiver::DecodeResult AudioReceiver::getAudio(Audio::DataWindow& output, i
|
||||||
if (options & DecodeOptions_SkipDecode)
|
if (options & DecodeOptions_SkipDecode)
|
||||||
mDecodedLength = 0;
|
mDecodedLength = 0;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
mDecodedLength = mCodec->plc(mFrameCount, mDecodedFrame, sizeof mDecodedFrame);
|
mDecodedLength = mCodec->plc(mFrameCount, mDecodedFrame, sizeof mDecodedFrame);
|
||||||
|
if (!mDecodedLength)
|
||||||
|
{
|
||||||
|
// PLC is not support or failed
|
||||||
|
// So substitute the silence
|
||||||
|
size_t nr_of_samples = mCodec->frameTime() * mCodec->samplerate() / 1000 * sizeof(short);
|
||||||
|
mDecodedLength = nr_of_samples * sizeof(short);
|
||||||
|
memset(mDecodedFrame, 0, mDecodedLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mDecodedLength)
|
if (mDecodedLength)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue