diff --git a/src/kits/midi/MidiStore.cpp b/src/kits/midi/MidiStore.cpp index 4820191647..2648594848 100644 --- a/src/kits/midi/MidiStore.cpp +++ b/src/kits/midi/MidiStore.cpp @@ -725,7 +725,7 @@ BMidiStore::ReadChunk() ReadTrack(); else { TRACE(("Skipping '%c%c%c%c' chunk (%lu bytes)", - fourcc[0], fourcc[1], fourcc[2], fourcc[3], byteCount)) + fourcc[0], fourcc[1], fourcc[2], fourcc[3], fByteCount)) SkipBytes(fByteCount); } diff --git a/src/kits/midi/SoftSynth.cpp b/src/kits/midi/SoftSynth.cpp index ccccbd0c9f..69e0c5dc07 100644 --- a/src/kits/midi/SoftSynth.cpp +++ b/src/kits/midi/SoftSynth.cpp @@ -23,7 +23,8 @@ using namespace BPrivate; BSoftSynth::BSoftSynth() -: fSynth(NULL), +: fInitCheck(false), + fSynth(NULL), fSettings(NULL), fSoundPlayer(NULL) { @@ -147,9 +148,10 @@ BSoftSynth::FlushInstrumentCache(bool startStopCache) void BSoftSynth::SetVolume(double volume) { - if (volume >= 0.0) { - fluid_synth_set_gain(fSynth, volume); - } + if (InitCheck()) + if (volume >= 0.0) { + fluid_synth_set_gain(fSynth, volume); + } } @@ -434,8 +436,10 @@ BSoftSynth::_Init() return; err = fluid_synth_sfload(fSynth, fInstrumentsFile, 1); - if (err < B_OK) + if (err < B_OK) { + fprintf(stderr, "error in fluid_synth_sfload\n"); return; + } media_raw_audio_format format = media_raw_audio_format::wildcard; format.channel_count = 2; @@ -444,8 +448,10 @@ BSoftSynth::_Init() fSoundPlayer = new BSoundPlayer(&format, "Soft Synth", &PlayBuffer, NULL, this); err = fSoundPlayer->InitCheck(); - if (err != B_OK) + if (err != B_OK) { + fprintf(stderr, "error in BSoundPlayer\n"); return; + } fSoundPlayer->SetHasData(true); fSoundPlayer->Start();