(PS3) Crashes in find_audio_driver (driver.c)

This commit is contained in:
TwinAphex51224 2011-12-02 03:32:04 +01:00
parent 8d5bf997a9
commit d03f351f33
2 changed files with 11 additions and 2 deletions

View File

@ -4,7 +4,7 @@
##
###
##
DEBUG=0
DEBUG=1
CELL_BUILD_TOOLS = GCC
## Platform detection from nall/Makefile. Only two applicable hosts for PS3 SDK.
@ -47,7 +47,7 @@ OBJ = ps3/buffer.o ps3/ps3_audio.o ps3/resampler.o ps3/ps3_input.o ps3/pad_input
LIBS = -ldbgfont -lPSGL -lgcm_cmd -lgcm_sys_stub -lsnes -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysmodule_stub -laudio_stub -lnet_stub -lpthread
DEFINES = -DHAVE_OPENGL=1 -DHAVE_CG=1 -DHAVE_FBO=1 -D__CELLOS_LV2__ -DPACKAGE_VERSION=\"0.9.2\" -Dmain=ssnes_main -mno-sn-ld
DEFINES = -DHAVE_OPENGL=1 -DHAVE_CG=1 -DHAVE_FBO=1 -D__CELLOS_LV2__ -DPACKAGE_VERSION=\"0.9.2\" -Dmain=ssnes_main
# Wrap it up, son!
#LIBS += -Wl,-wrap,fopen -Wl,-wrap,fclose -Wl,-wrap,fwrite -Wl,-wrap,fread -Wl,-wrap,fseek -Wl,-wrap,ftell -Wl,-wrap,fflush -Wl,-wrap,rewind -Wl,-wrap,fgetpos -Wl,-wrap,fsetpos -Wl,-wrap,setbuf -Wl,-wrap,setvbuf -Wl,-wrap,ungetc -Wl,-wrap,feof

View File

@ -97,15 +97,21 @@ static const input_driver_t *input_drivers[] = {
#endif
};
static int test_counter = 0;
static void find_audio_driver(void)
{
SSNES_LOG("Entered find_audio_driver\n");
for (unsigned i = 0; i < sizeof(audio_drivers) / sizeof(audio_driver_t*); i++)
{
SSNES_LOG("looking for audio driver\n");
if (strcasecmp(g_settings.audio.driver, audio_drivers[i]->ident) == 0)
{
SSNES_LOG("looked for audio driver: %d\n", test_counter++);
driver.audio = audio_drivers[i];
return;
}
SSNES_LOG("looked for audio driver, and failed: %d\n", test_counter++);
}
SSNES_ERR("Couldn't find any audio driver named \"%s\"\n", g_settings.audio.driver);
fprintf(stderr, "Available audio drivers are:\n");
@ -292,6 +298,7 @@ void init_audio(void)
adjust_audio_input_rate();
find_audio_driver();
SSNES_LOG("SSNES 2.1\n");
g_extern.audio_data.block_chunk_size = AUDIO_CHUNK_SIZE_BLOCKING;
g_extern.audio_data.nonblock_chunk_size = AUDIO_CHUNK_SIZE_NONBLOCKING;
@ -310,6 +317,7 @@ void init_audio(void)
driver.audio->set_nonblock_state(driver.audio_data, true);
g_extern.audio_data.chunk_size = g_extern.audio_data.nonblock_chunk_size;
}
SSNES_LOG("SSNES 2.2\n");
g_extern.audio_data.source = hermite_new();
if (!g_extern.audio_data.source)
@ -322,6 +330,7 @@ void init_audio(void)
g_extern.audio_data.src_ratio =
(double)g_settings.audio.out_rate / g_settings.audio.in_rate;
SSNES_LOG("SSNES 2.3\n");
#ifdef HAVE_DYLIB
init_dsp_plugin();