mirror of
https://github.com/lubosz/overte.git
synced 2025-08-29 09:47:00 +02:00
log audio device framing errors, copy as much data as we can, but don't assert
This commit is contained in:
parent
ca4d1375f5
commit
18975aef57
1 changed files with 10 additions and 2 deletions
|
@ -110,8 +110,16 @@ public:
|
|||
if ( !_frameBuffer || !frames) {
|
||||
return;
|
||||
}
|
||||
assert(channelCount <= _channelCountMax);
|
||||
assert(frameCount <= _frameCountMax);
|
||||
|
||||
if (channelCount >_channelCountMax || frameCount >_frameCountMax) {
|
||||
qDebug() << "Audio framing error: _channelCount=" << _channelCount << "channelCountMax=" << _channelCountMax;
|
||||
qDebug() << "Audio framing error: _frameCount=" << _frameCount << "frameCountMax=" << _frameCountMax;
|
||||
|
||||
// This condition should never happen; however, we do our best to recover here copying as many frames
|
||||
// as we have allocated
|
||||
_channelCount = std::min(_channelCount,_channelCountMax);
|
||||
_frameCount = std::min(_frameCount,_frameCountMax);
|
||||
}
|
||||
|
||||
_frameCount = frameCount; // we allow copying fewer frames than we've allocated
|
||||
_channelCount = channelCount; // we allow copying fewer channels that we've allocated
|
||||
|
|
Loading…
Reference in a new issue