mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
[AFV] Handle stereo in- and output devices
This commit is contained in:
committed by
Mat Sutcliffe
parent
a06205efbd
commit
9f497c1b60
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "output.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blacksound/audioutilities.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStringBuilder>
|
||||
@@ -61,16 +62,13 @@ namespace BlackCore
|
||||
m_maxSampleOutput = 0;
|
||||
}
|
||||
|
||||
// if (maxlen > buffer.size()) { maxlen = buffer.size(); }
|
||||
// memcpy(data, buffer.constData(), maxlen > buffer.size() ? buffer.size() : maxlen);
|
||||
qint16 *p = reinterpret_cast<qint16 *>(data);
|
||||
int index = 0;
|
||||
for (int n = 0; n < count; n++)
|
||||
if (channelCount == 2)
|
||||
{
|
||||
p[index++] = buffer[n];
|
||||
if (channelCount == 2) p[index++] = buffer[n];
|
||||
buffer = convertFromMonoToStereo(buffer);
|
||||
}
|
||||
|
||||
memcpy(data, buffer.constData(), maxlen);
|
||||
|
||||
return maxlen;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user