diff --git a/pcsx2/gui/GlobalCommands.cpp b/pcsx2/gui/GlobalCommands.cpp index 7f264f18af..f39adcf734 100644 --- a/pcsx2/gui/GlobalCommands.cpp +++ b/pcsx2/gui/GlobalCommands.cpp @@ -383,8 +383,26 @@ namespace Implementations g_Pcsx2Recording ^= 1; GetMTGS().WaitGS(); // make sure GS is in sync with the audio stream when we start. - if( GSsetupRecording != NULL ) GSsetupRecording(g_Pcsx2Recording, NULL); - if( SPU2setupRecording != NULL ) SPU2setupRecording(g_Pcsx2Recording, NULL); + if (g_Pcsx2Recording) { + // start recording + if (GSsetupRecording) { + // GSsetupRecording can be aborted/canceled by the user. Don't go on to record the audio if that happens. + if (GSsetupRecording(g_Pcsx2Recording, NULL)) { + if (SPU2setupRecording) SPU2setupRecording(g_Pcsx2Recording, NULL); + } else { + // recording dialog canceled by the user. align our state + g_Pcsx2Recording ^= 1; + } + } else { + // the GS doesn't support recording. + if (SPU2setupRecording) SPU2setupRecording(g_Pcsx2Recording, NULL); + } + + } else { + // stop recording + if (GSsetupRecording) GSsetupRecording(g_Pcsx2Recording, NULL); + if (SPU2setupRecording) SPU2setupRecording(g_Pcsx2Recording, NULL); + } } void Cpu_DumpRegisters() diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index 784b57e52c..1447d7c5ee 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -873,8 +873,12 @@ EXPORT_C_(int) GSsetupRecording(int start, void* data) if(start & 1) { printf("GSdx: Recording start command\n"); - if( s_gs->BeginCapture() ) + if (s_gs->BeginCapture()) { pt(" - Capture started\n"); + } else { + pt(" - Capture cancelled\n"); + return 0; + } } else {