SHA256
1
0
forked from pool/scummvm
scummvm/0001-FLUIDSYNTH-Make-FluidSynth-logging-less-noisy-by-default.patch
Ferdinand Thiessen 1499fe8af5 Accepting request 886072 from home:alarrosa:branches:games
- Add patches from upstream to fix build with fluidsynth 2.2
  * 0001-FLUIDSYNTH-Make-FluidSynth-logging-less-noisy-by-default.patch
  * 0002-FLUIDSYNTH-Swapped-debug-levels-for-FLUID_WARN-and-FLUID_INFO.patch
  * 0003-FLUIDSYNTH-Fix-build.patch
  * 0004-AUDIO-Fix-compilation-with-Fluidsynth2.patch
  * 0005-FLUIDSYNTH-Simplify-FluidSynth-version-check.patch
  * 0006-FLUIDSYNTH-Fix-compilation-with-Fluidsynth-2.2.patch

OBS-URL: https://build.opensuse.org/request/show/886072
OBS-URL: https://build.opensuse.org/package/show/games/scummvm?expand=0&rev=65
2021-04-16 19:01:31 +00:00

58 lines
1.8 KiB
Diff

From 08b54f489b663793168764986c1d1a834c33add3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?=
<eriktorbjorn@users.sourceforge.net>
Date: Wed, 13 Jan 2021 09:44:44 +0100
Subject: [PATCH] FLUIDSYNTH: Make FluidSynth logging less noisy by default
---
audio/softsynth/fluidsynth.cpp | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp
index e0d7c4e3df33..fe2b0689c283 100644
--- a/audio/softsynth/fluidsynth.cpp
+++ b/audio/softsynth/fluidsynth.cpp
@@ -46,6 +46,29 @@
#include "backends/platform/ios7/ios7_common.h"
#endif
+static void logHandler(int level, const char *message, void *data) {
+ switch (level) {
+ case FLUID_PANIC:
+ error("FluidSynth: %s", message);
+ break;
+ case FLUID_ERR:
+ warning("FluidSynth: %s", message);
+ break;
+ case FLUID_WARN:
+ debug(2, "FluidSynth: %s", message);
+ break;
+ case FLUID_INFO:
+ debug(1, "FluidSynth: %s", message);
+ break;
+ case FLUID_DBG:
+ debug(3, "FluidSynth: %s", message);
+ break;
+ default:
+ fluid_default_log_function(level, message, data);
+ break;
+ }
+}
+
class MidiDriver_FluidSynth : public MidiDriver_Emulated {
private:
MidiChannel_MPU401 _midiChannels[16];
@@ -166,6 +189,12 @@ int MidiDriver_FluidSynth::open() {
if (_isOpen)
return MERR_ALREADY_OPEN;
+ fluid_set_log_function(FLUID_PANIC, logHandler, NULL);
+ fluid_set_log_function(FLUID_ERR, logHandler, NULL);
+ fluid_set_log_function(FLUID_WARN, logHandler, NULL);
+ fluid_set_log_function(FLUID_INFO, logHandler, NULL);
+ fluid_set_log_function(FLUID_DBG, logHandler, NULL);
+
#if defined(FLUIDSYNTH_VERSION_MAJOR) && FLUIDSYNTH_VERSION_MAJOR > 1
// When provided with in-memory SoundFont data, only use the configured
// SoundFont instead if it's explicitly configured on the current game.