mirror of https://github.com/ZDoom/gzdoom-gles.git
Fixed crash on music volume change when no track is played using FluidSynth device
This commit is contained in:
parent
5364116354
commit
51d7340288
|
@ -540,7 +540,7 @@ bool MIDIStreamer::IsPlaying()
|
||||||
|
|
||||||
void MIDIStreamer::MusicVolumeChanged()
|
void MIDIStreamer::MusicVolumeChanged()
|
||||||
{
|
{
|
||||||
if (MIDI->FakeVolume())
|
if (MIDI != NULL && MIDI->FakeVolume())
|
||||||
{
|
{
|
||||||
float realvolume = clamp<float>(snd_musicvolume * relative_volume, 0.f, 1.f);
|
float realvolume = clamp<float>(snd_musicvolume * relative_volume, 0.f, 1.f);
|
||||||
Volume = clamp<DWORD>((DWORD)(realvolume * 65535.f), 0, 65535);
|
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)
|
void MIDIStreamer::OutputVolume (DWORD volume)
|
||||||
{
|
{
|
||||||
if (MIDI->FakeVolume())
|
if (MIDI != NULL && MIDI->FakeVolume())
|
||||||
{
|
{
|
||||||
NewVolume = volume;
|
NewVolume = volume;
|
||||||
VolumeChanged = true;
|
VolumeChanged = true;
|
||||||
|
|
Loading…
Reference in New Issue