1
0
Fork 0
forked from len0rd/rockbox

sdl: fix freeze on startup on PP targets

Using the coprocessor was a good idea in theory, but didn't actually work.
This moves all SDL threads to the main core, which isn't ideal, but at
least works. Additionally, this also adds some good-practice stuff such as
setting the default sample rate on exit.

Change-Id: If1636b33d439000ec7c4e50f46e8d002708d3121
This commit is contained in:
Franklin Wei 2018-01-11 19:44:36 -05:00
parent 0d794c0c06
commit ccd612345c
3 changed files with 4 additions and 2 deletions

View file

@ -413,6 +413,7 @@ int Mix_OpenAudio(int frequency, Uint16 format, int nchannels, int chunksize)
}
while ( audio_opened ) {
Mix_CloseAudio();
rb->yield();
}
}

View file

@ -222,6 +222,7 @@ static void ROCKBOXAUD_CloseAudio(_THIS)
SDL_FreeAudioMem(this->hidden->rb_buf[i]);
}
rb->pcm_play_stop();
rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
}
static int ROCKBOXAUD_OpenAudio(_THIS, SDL_AudioSpec *spec)

View file

@ -58,7 +58,7 @@ int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
thread->handle = rb->create_thread(rbsdl_runthread, stacks[threadnum], DEFAULT_STACK_SIZE,
0, names[threadnum] /* collisions allowed? */
IF_PRIO(, PRIORITY_USER_INTERFACE)
IF_COP(, COP));
IF_COP(, CPU));
threadnum++;