mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Add the thread state check into test_codec as used in mpegplayer which makes it should make it less prone to trash the codec thread after use.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15203 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
df1f0d6429
commit
9ec00d7f25
1 changed files with 6 additions and 1 deletions
|
@ -655,6 +655,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
return PLUGIN_ERROR;
|
||||
}
|
||||
|
||||
codec_mallocbuf = rb->plugin_get_audio_buffer(&audiosize);
|
||||
|
||||
#ifdef SIMULATOR
|
||||
/* The simulator thread implementation doesn't have stack buffers */
|
||||
(void)i;
|
||||
|
@ -666,6 +668,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
{
|
||||
if (rb->strcmp(rb->threads[i].name,"codec")==0)
|
||||
{
|
||||
/* Wait to ensure the codec thread has blocked */
|
||||
while (rb->threads[i].state!=STATE_BLOCKED)
|
||||
rb->yield();
|
||||
|
||||
codec_stack = rb->threads[i].stack;
|
||||
codec_stack_size = rb->threads[i].stack_size;
|
||||
break;
|
||||
|
@ -679,7 +685,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
}
|
||||
#endif
|
||||
|
||||
codec_mallocbuf = rb->plugin_get_audio_buffer(&audiosize);
|
||||
codec_stack_copy = codec_mallocbuf + 512*1024;
|
||||
audiobuf = codec_stack_copy + codec_stack_size;
|
||||
audiosize -= 512*1024 + codec_stack_size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue