This commit is contained in:
Christoph Oelckers 2016-01-15 12:56:56 +01:00
commit 48232f548d
2 changed files with 6 additions and 12 deletions

View file

@ -462,14 +462,12 @@ public:
Stream->release();
Channel = NULL;
Stream = NULL;
Owner->Sys->setStreamBufferSize(64*1024, FMOD_TIMEUNIT_RAWBYTES);
// Open the stream asynchronously, so we don't hang the game while trying to reconnect.
// (It would be nice to do the initial open asynchronously as well, but I'd need to rethink
// the music system design to pull that off.)
result = Owner->Sys->createSound(URL, (Loop ? FMOD_LOOP_NORMAL : FMOD_LOOP_OFF) | FMOD_SOFTWARE | FMOD_2D |
FMOD_CREATESTREAM | FMOD_NONBLOCKING, NULL, &Stream);
JustStarted = true;
Owner->Sys->setStreamBufferSize(16*1024, FMOD_TIMEUNIT_RAWBYTES);
return result != FMOD_OK;
}
if (JustStarted && openstate == FMOD_OPENSTATE_PLAYING)
@ -1170,6 +1168,9 @@ bool FMODSoundRenderer::Init()
}
Sys->set3DSettings(0.5f, 96.f, 1.f);
Sys->set3DRolloffCallback(RolloffCallback);
// The default is 16k, which periodically starves later FMOD versions
// when streaming FLAC files.
Sys->setStreamBufferSize(64*1024, FMOD_TIMEUNIT_RAWBYTES);
snd_sfxvolume.Callback ();
return true;
}
@ -1733,10 +1734,6 @@ SoundStream *FMODSoundRenderer::OpenStream(const char *url, int flags)
exinfo.dlsname = patches;
}
// Use a larger buffer for URLs so that it's less likely to be effected
// by hiccups in the data rate from the remote server.
Sys->setStreamBufferSize(64*1024, FMOD_TIMEUNIT_RAWBYTES);
result = Sys->createSound(url, mode, &exinfo, &stream);
if(result == FMOD_ERR_FORMAT && exinfo.dlsname != NULL)
{
@ -1748,9 +1745,6 @@ SoundStream *FMODSoundRenderer::OpenStream(const char *url, int flags)
}
}
// Restore standard buffer size.
Sys->setStreamBufferSize(16*1024, FMOD_TIMEUNIT_RAWBYTES);
if(result != FMOD_OK)
return NULL;

View file

@ -2439,7 +2439,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FadeIn)
if (flags & FTF_CLAMP)
self->alpha = (FRACUNIT * 1);
if (flags & FTF_REMOVE)
self->Destroy();
P_RemoveThing(self);
}
}
@ -2467,7 +2467,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FadeOut)
if (flags & FTF_CLAMP)
self->alpha = 0;
if (flags & FTF_REMOVE)
self->Destroy();
P_RemoveThing(self);
}
}
@ -2515,7 +2515,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FadeTo)
}
if (self->alpha == target && (flags & FTF_REMOVE))
{
self->Destroy();
P_RemoveThing(self);
}
}