From cb832f22989a0e92c1f68c3b0331f5cf3714dda2 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Fri, 11 Feb 2011 21:30:53 +0000 Subject: [PATCH] Make sure the audio dump directory exists when dumping audio. Otherwise a segmentation fault ensues after several panic alerts. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7135 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/AudioCommon/Src/AudioCommon.cpp | 1 + Source/Core/VideoCommon/Src/AVIDump.cpp | 5 +---- Source/Plugins/Plugin_VideoOGL/Src/Render.cpp | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/Core/AudioCommon/Src/AudioCommon.cpp b/Source/Core/AudioCommon/Src/AudioCommon.cpp index 043d07d151..22758c53b4 100644 --- a/Source/Core/AudioCommon/Src/AudioCommon.cpp +++ b/Source/Core/AudioCommon/Src/AudioCommon.cpp @@ -57,6 +57,7 @@ namespace AudioCommon if (ac_Config.m_DumpAudio) { char audio_file_name[255]; snprintf(audio_file_name, 255, "%saudiodump.wav", File::GetUserPath(D_DUMPAUDIO_IDX)); + File::CreateFullPath(audio_file_name); mixer->StartLogAudio(audio_file_name); //soundStream->StartLogAudio(audio_file_name); } diff --git a/Source/Core/VideoCommon/Src/AVIDump.cpp b/Source/Core/VideoCommon/Src/AVIDump.cpp index 539e209cc0..f276fb3483 100644 --- a/Source/Core/VideoCommon/Src/AVIDump.cpp +++ b/Source/Core/VideoCommon/Src/AVIDump.cpp @@ -16,6 +16,7 @@ // http://code.google.com/p/dolphin-emu/ #include "AVIDump.h" +#include "HW/VideoInterface.h" //for TargetRefreshRate #ifdef _WIN32 @@ -30,8 +31,6 @@ #include "CommonPaths.h" #include "Log.h" -#include "HW/VideoInterface.h" //for TargetRefreshRate - HWND m_emuWnd; LONG m_byteBuffer; LONG m_frameCount; @@ -203,8 +202,6 @@ bool AVIDump::SetVideoFormat() #include "StringUtil.h" #include "Log.h" -#include "HW/VideoInterface.h" //for TargetRefreshRate - extern "C" { #include #include diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 71906fe1bc..ef50045de6 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -63,7 +63,9 @@ #ifdef _WIN32 #include "EmuWindow.h" #endif +#if defined _WIN32 || defined HAVE_LIBAV #include "AVIDump.h" +#endif #if defined(HAVE_WX) && HAVE_WX #include @@ -966,7 +968,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons if (g_ActiveConfig.bDumpFrames && data) #ifdef _WIN32 AVIDump::AddFrame((char *) data); - #else + #elif defined HAVE_LIBAV AVIDump::AddFrame(data); #endif Core::Callback_VideoCopiedToXFB(false); @@ -984,7 +986,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons if (g_ActiveConfig.bDumpFrames && data) #ifdef _WIN32 AVIDump::AddFrame((char *) data); - #else + #elif defined HAVE_LIBAV AVIDump::AddFrame(data); #endif Core::Callback_VideoCopiedToXFB(false);