mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
Fixed crash on music volume change when no track is played using FluidSynth device
This commit is contained in:
parent
5364116354
commit
51d7340288
1 changed files with 2 additions and 2 deletions
|
@ -540,7 +540,7 @@ bool MIDIStreamer::IsPlaying()
|
|||
|
||||
void MIDIStreamer::MusicVolumeChanged()
|
||||
{
|
||||
if (MIDI->FakeVolume())
|
||||
if (MIDI != NULL && MIDI->FakeVolume())
|
||||
{
|
||||
float realvolume = clamp<float>(snd_musicvolume * relative_volume, 0.f, 1.f);
|
||||
Volume = clamp<DWORD>((DWORD)(realvolume * 65535.f), 0, 65535);
|
||||
|
@ -622,7 +622,7 @@ void MIDIStreamer::FluidSettingStr(const char *setting, const char *value)
|
|||
|
||||
void MIDIStreamer::OutputVolume (DWORD volume)
|
||||
{
|
||||
if (MIDI->FakeVolume())
|
||||
if (MIDI != NULL && MIDI->FakeVolume())
|
||||
{
|
||||
NewVolume = volume;
|
||||
VolumeChanged = true;
|
||||
|
|
Loading…
Reference in a new issue