#jira UE-63558 fix crash that occurs when attempting to recover an interrupted recording on audio device shutdown.

#rb none

#ROBOMERGE-OWNER: ryan.gerleve
#ROBOMERGE-AUTHOR: ethan.geller
#ROBOMERGE-SOURCE: CL 8664067 via CL 8670457 via CL 8670622
#ROBOMERGE-BOT: ENGINE (Main -> Dev-Networking) (v422-8689730)

[CL 8764690 by ethan geller in Dev-Networking branch]
This commit is contained in:
ethan geller
2019-09-17 16:00:21 -04:00
parent c37a3aed61
commit 44125154c9

View File

@@ -10,6 +10,14 @@
// Link to "Audio" profiling category
CSV_DECLARE_CATEGORY_MODULE_EXTERN(AUDIOMIXERCORE_API, Audio);
static int32 RecoverRecordingOnShutdownCVar = 0;
FAutoConsoleVariableRef CVarRecoverRecordingOnShutdown(
TEXT("au.RecoverRecordingOnShutdown"),
RecoverRecordingOnShutdownCVar,
TEXT("When set to 1, we will attempt to bounce the recording to a wav file if the game is shutdown while a recording is in flight.\n")
TEXT("0: Disabled, 1: Enabled"),
ECVF_Default);
namespace Audio
{
// Unique IDs for mixer submixe's
@@ -49,7 +57,7 @@ namespace Audio
TearDownAmbisonicsDecoder();
}
if (OwningSubmixObject && bIsRecording)
if (RecoverRecordingOnShutdownCVar && OwningSubmixObject && bIsRecording)
{
FString InterruptedFileName = TEXT("InterruptedRecording.wav");
UE_LOG(LogAudioMixer, Warning, TEXT("Recording of Submix %s was interrupted. Saving interrupted recording as %s."), *(OwningSubmixObject->GetName()), *InterruptedFileName);