Skip to content

Commit 6e51b7d

Browse files
committed
Apply client volume to audio buffer streams
1 parent 5c51adc commit 6e51b7d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

mumble/audio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ void audio_transmission_event(lua_State *l, MumbleClient *client) {
743743
for (int j = 0; j < context->channels; j++) {
744744
float sample;
745745
buffer_readFloat(buffer, &sample);
746-
input_buffer[i * context->channels + j] = sample;
746+
input_buffer[i * context->channels + j] = sample * client->volume;
747747
}
748748
}
749749

mumble/pipe.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static void mumble_pipe_on_read(uv_stream_t *handle, ssize_t nread, const uv_buf
1010
static void mumble_pipe_close_cb(uv_handle_t* handle) {
1111
MumblePipe* lpipe = (MumblePipe*)handle->data;
1212
if (lpipe->pipe) {
13-
free(lpipe->pipe); // Safe to free now
13+
free(lpipe->pipe); // Safe to free now
1414
}
1515
}
1616

@@ -69,18 +69,18 @@ static void mumble_pipe_reopen(uv_handle_t* handle) {
6969
return;
7070
}
7171

72-
free(lpipe->pipe);
73-
lpipe->pipe = new_pipe;
74-
lpipe->pipe->data = lpipe;
75-
7672
// Restart reading on the new pipe
77-
error = uv_read_start((uv_stream_t*)lpipe->pipe, mumble_pipe_alloc_buffer, mumble_pipe_on_read);
73+
error = uv_read_start((uv_stream_t*) new_pipe, mumble_pipe_alloc_buffer, mumble_pipe_on_read);
7874
if (error != 0) {
79-
mumble_log(LOG_ERROR, "failed to restart reading from pipe %s (%s)", lpipe->path, uv_strerror(error));
75+
mumble_log(LOG_ERROR, "failed to restart reading from pipe %s (%s)", new_pipe, uv_strerror(error));
8076
mumble_pipe_close(lpipe);
8177
return;
8278
}
8379

80+
free(lpipe->pipe);
81+
lpipe->pipe = new_pipe;
82+
lpipe->pipe->data = lpipe;
83+
8484
mumble_log(LOG_TRACE, "%s: %p pipe successfully reopened for reading", METATABLE_PIPE, lpipe);
8585
}
8686

0 commit comments

Comments
 (0)