mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 11:33:44 +02:00
Pointer fixes
This commit is contained in:
parent
302354aa5d
commit
6bf05fbf1f
2 changed files with 8 additions and 8 deletions
|
@ -172,7 +172,7 @@ void AudioInjector::injectToMixer() {
|
|||
audioPacketStream << loopbackFlag;
|
||||
|
||||
// pack the position for injected audio
|
||||
int positionOptionOffset = audioPacket.pos();
|
||||
int positionOptionOffset = audioPacket->pos();
|
||||
audioPacketStream.writeRawData(reinterpret_cast<const char*>(&_options.position),
|
||||
sizeof(_options.position));
|
||||
|
||||
|
@ -185,13 +185,13 @@ void AudioInjector::injectToMixer() {
|
|||
audioPacketStream << radius;
|
||||
|
||||
// pack 255 for attenuation byte
|
||||
int volumeOptionOffset = audioPacket.pos();
|
||||
int volumeOptionOffset = audioPacket->pos();
|
||||
quint8 volume = MAX_INJECTOR_VOLUME * _options.volume;
|
||||
audioPacketStream << volume;
|
||||
|
||||
audioPacketStream << _options.ignorePenumbra;
|
||||
|
||||
int audioDataOffset = audioPacket.pos();
|
||||
int audioDataOffset = audioPacket->pos();
|
||||
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
|
@ -216,17 +216,17 @@ void AudioInjector::injectToMixer() {
|
|||
_loudness /= (float)(bytesToCopy / sizeof(int16_t));
|
||||
|
||||
audioPacket->seek(positionOptionOffset);
|
||||
audioPacket->write(&_options.position, sizeof(_options.position));
|
||||
audioPacket.write(&_options.orientation, sizeof(_options.orientation));
|
||||
audioPacket->write(reinterpret_cast<char*>(&_options.position), sizeof(_options.position));
|
||||
audioPacket->write(reinterpret_cast<char*>(&_options.orientation), sizeof(_options.orientation));
|
||||
|
||||
volume = MAX_INJECTOR_VOLUME * _options.volume;
|
||||
audioPacket->seek(volumeOptionOffset);
|
||||
audioPacket->write(&volume, sizeof(volume));
|
||||
audioPacket->write(reinterpret_cast<char*>(&volume), sizeof(volume));
|
||||
|
||||
audioPacket->seek(audioDataOffset);
|
||||
|
||||
// pack the sequence number
|
||||
audioPacket->write(&outgoingInjectedAudioSequenceNumber, sizeof(quint16));
|
||||
audioPacket->write(reinterpret_cast<char*>(&outgoingInjectedAudioSequenceNumber), sizeof(quint16));
|
||||
|
||||
// copy the next NETWORK_BUFFER_LENGTH_BYTES_PER_CHANNEL bytes to the packet
|
||||
audioPacket->write(_audioData.data() + _currentSendPosition, bytesToCopy);
|
||||
|
|
|
@ -209,7 +209,7 @@ public:
|
|||
T* _at;
|
||||
};
|
||||
|
||||
Iterator begin() { return Iterator(&_buffer.first(), &_buffer.last(), &_buffer[_newestEntryAtIndex], &_buffer[_newestEntryAtIndex]); }
|
||||
Iterator begin() { return Iterator(&_buffer.front(), &_buffer.back(), &_buffer[_newestEntryAtIndex], &_buffer[_newestEntryAtIndex]); }
|
||||
|
||||
Iterator end() {
|
||||
int endAtIndex = _newestEntryAtIndex - _numEntries;
|
||||
|
|
Loading…
Reference in a new issue