Skip to content

Commit

Permalink
audio/mumble{,-server}: fix build on i386
Browse files Browse the repository at this point in the history
Upstream issue: mumble-voip/mumble#6377

Reported by:	pkg-fallout
Approved by:	arrowd (mentor, implicit)
  • Loading branch information
VVD committed Apr 5, 2024
1 parent 0c61e69 commit f2a60bd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions audio/mumble-server/Makefile
Expand Up @@ -28,6 +28,8 @@ CXXFLAGS+= -Wno-deprecated-declarations
USE_RC_SUBR= mumble_server
SUB_LIST+= USERS="${USERS}" GROUPS="${GROUPS}"

EXTRA_PATCHES+= ${.CURDIR}/../mumble/files/patch-src_MumbleProtocol.cpp

OPTIONS_DEFINE= AVAHI DOCS ICE LTO
OPTIONS_DEFAULT= AVAHI LTO MYSQL SQLITE
OPTIONS_MULTI= SQL
Expand Down
11 changes: 11 additions & 0 deletions audio/mumble/files/patch-src_MumbleProtocol.cpp
@@ -0,0 +1,11 @@
--- src/MumbleProtocol.cpp.orig 2024-03-03 17:26:27 UTC
+++ src/MumbleProtocol.cpp
@@ -781,7 +781,7 @@ namespace Protocol {
}


- m_audioData.payload = gsl::span< byte >(payloadBegin, payloadSize);
+ m_audioData.payload = gsl::span< byte >(payloadBegin, static_cast< size_t >(payloadSize));

if (stream.left() == 3 * sizeof(float)) {
// If there are further bytes after the audio payload, this means that there is positional data attached to
11 changes: 11 additions & 0 deletions audio/mumble/files/patch-src_mumble_Audio.cpp
@@ -0,0 +1,11 @@
--- src/mumble/Audio.cpp.orig 2024-03-03 17:26:27 UTC
+++ src/mumble/Audio.cpp
@@ -43,7 +43,7 @@ void LoopUser::addFrame(const Mumble::Protocol::AudioD
QMutexLocker l(&qmLock);
bool restart = (qetLastFetch.elapsed() > 100);

- long time = qetTicker.elapsed();
+ long long time = qetTicker.elapsed();

float r;
if (restart)
16 changes: 16 additions & 0 deletions audio/mumble/files/patch-src_mumble_AudioOutput.cpp
@@ -0,0 +1,16 @@
--- src/mumble/AudioOutput.cpp.orig 2024-03-03 17:26:27 UTC
+++ src/mumble/AudioOutput.cpp
@@ -617,11 +617,11 @@ bool AudioOutput::mix(void *outbuff, unsigned int fram
// Mix down stereo to mono. TODO: stereo record support
// frame: for a stereo stream, the [LR] pair inside ...[LR]LRLRLR.... is a frame
for (unsigned int i = 0; i < frameCount; ++i) {
- recbuff[i] += (pfBuffer[2 * i] / 2.0f + pfBuffer[2 * i + 1] / 2.0f) * volumeAdjustment;
+ recbuff[static_cast< int >(i)] += (pfBuffer[2 * i] / 2.0f + pfBuffer[2 * i + 1] / 2.0f) * volumeAdjustment;
}
} else {
for (unsigned int i = 0; i < frameCount; ++i) {
- recbuff[i] += pfBuffer[i] * volumeAdjustment;
+ recbuff[static_cast< int >(i)] += pfBuffer[i] * volumeAdjustment;
}
}

0 comments on commit f2a60bd

Please sign in to comment.