Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AudioOutputUser.cpp « mumble « src - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 331fb43f04f853c4e8b4e774457b880932f4c763 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2011-2021 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.

#include "AudioOutputUser.h"

AudioOutputUser::AudioOutputUser(const QString &name) : qsName(name) {
}

AudioOutputUser::~AudioOutputUser() {
	delete[] pfBuffer;
	delete[] pfVolume;
}

void AudioOutputUser::resizeBuffer(unsigned int newsize) {
	if (newsize > iBufferSize) {
		float *n = new float[newsize];
		if (pfBuffer) {
			memcpy(n, pfBuffer, sizeof(float) * iBufferSize);
			delete[] pfBuffer;
		}
		pfBuffer    = n;
		iBufferSize = newsize;
	}
}