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
This commit is contained in:
Glenn Rice 2011-02-11 21:30:53 +00:00
parent 6cbaa360a1
commit cb832f2298
3 changed files with 6 additions and 6 deletions

View File

@ -57,6 +57,7 @@ namespace AudioCommon
if (ac_Config.m_DumpAudio) { if (ac_Config.m_DumpAudio) {
char audio_file_name[255]; char audio_file_name[255];
snprintf(audio_file_name, 255, "%saudiodump.wav", File::GetUserPath(D_DUMPAUDIO_IDX)); snprintf(audio_file_name, 255, "%saudiodump.wav", File::GetUserPath(D_DUMPAUDIO_IDX));
File::CreateFullPath(audio_file_name);
mixer->StartLogAudio(audio_file_name); mixer->StartLogAudio(audio_file_name);
//soundStream->StartLogAudio(audio_file_name); //soundStream->StartLogAudio(audio_file_name);
} }

View File

@ -16,6 +16,7 @@
// http://code.google.com/p/dolphin-emu/ // http://code.google.com/p/dolphin-emu/
#include "AVIDump.h" #include "AVIDump.h"
#include "HW/VideoInterface.h" //for TargetRefreshRate
#ifdef _WIN32 #ifdef _WIN32
@ -30,8 +31,6 @@
#include "CommonPaths.h" #include "CommonPaths.h"
#include "Log.h" #include "Log.h"
#include "HW/VideoInterface.h" //for TargetRefreshRate
HWND m_emuWnd; HWND m_emuWnd;
LONG m_byteBuffer; LONG m_byteBuffer;
LONG m_frameCount; LONG m_frameCount;
@ -203,8 +202,6 @@ bool AVIDump::SetVideoFormat()
#include "StringUtil.h" #include "StringUtil.h"
#include "Log.h" #include "Log.h"
#include "HW/VideoInterface.h" //for TargetRefreshRate
extern "C" { extern "C" {
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
#include <libavformat/avformat.h> #include <libavformat/avformat.h>

View File

@ -63,7 +63,9 @@
#ifdef _WIN32 #ifdef _WIN32
#include "EmuWindow.h" #include "EmuWindow.h"
#endif #endif
#if defined _WIN32 || defined HAVE_LIBAV
#include "AVIDump.h" #include "AVIDump.h"
#endif
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
#include <wx/image.h> #include <wx/image.h>
@ -966,7 +968,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
if (g_ActiveConfig.bDumpFrames && data) if (g_ActiveConfig.bDumpFrames && data)
#ifdef _WIN32 #ifdef _WIN32
AVIDump::AddFrame((char *) data); AVIDump::AddFrame((char *) data);
#else #elif defined HAVE_LIBAV
AVIDump::AddFrame(data); AVIDump::AddFrame(data);
#endif #endif
Core::Callback_VideoCopiedToXFB(false); 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) if (g_ActiveConfig.bDumpFrames && data)
#ifdef _WIN32 #ifdef _WIN32
AVIDump::AddFrame((char *) data); AVIDump::AddFrame((char *) data);
#else #elif defined HAVE_LIBAV
AVIDump::AddFrame(data); AVIDump::AddFrame(data);
#endif #endif
Core::Callback_VideoCopiedToXFB(false); Core::Callback_VideoCopiedToXFB(false);