summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/spc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/codecs/spc.c b/apps/codecs/spc.c
index da91eb0391..a2b6fabf99 100644
--- a/apps/codecs/spc.c
+++ b/apps/codecs/spc.c
@@ -230,7 +230,7 @@ static struct
230 int head, tail; 230 int head, tail;
231 struct semaphore emu_sem_head; 231 struct semaphore emu_sem_head;
232 struct semaphore emu_sem_tail; 232 struct semaphore emu_sem_tail;
233 struct event emu_evt_reply; 233 struct semaphore emu_evt_reply;
234 intptr_t retval; 234 intptr_t retval;
235 struct sample_queue_chunk wav_chunk[WAV_NUM_CHUNKS]; 235 struct sample_queue_chunk wav_chunk[WAV_NUM_CHUNKS];
236} sample_queue SHAREDBSS_ATTR; 236} sample_queue SHAREDBSS_ATTR;
@@ -284,7 +284,7 @@ static intptr_t emu_thread_send_msg(long id, intptr_t data)
284 284
285 if (id != SPC_EMU_QUIT) { 285 if (id != SPC_EMU_QUIT) {
286 /* Wait for a response */ 286 /* Wait for a response */
287 ci->event_wait(&sample_queue.emu_evt_reply, STATE_SIGNALED); 287 ci->semaphore_wait(&sample_queue.emu_evt_reply);
288 } 288 }
289 289
290 return sample_queue.retval; 290 return sample_queue.retval;
@@ -316,7 +316,7 @@ static bool emu_thread_process_msg(struct sample_queue_chunk *chunk)
316 } 316 }
317 317
318 if (id != SPC_EMU_QUIT) { 318 if (id != SPC_EMU_QUIT) {
319 ci->event_set_state(&sample_queue.emu_evt_reply, STATE_SIGNALED); 319 ci->semaphore_release(&sample_queue.emu_evt_reply);
320 } 320 }
321 321
322 return ret; 322 return ret;
@@ -361,8 +361,7 @@ static bool spc_emu_start(void)
361 361
362 /* Initialize audio queue as full to prevent emu thread from trying to run the 362 /* Initialize audio queue as full to prevent emu thread from trying to run the
363 emulator before loading something */ 363 emulator before loading something */
364 ci->event_init(&sample_queue.emu_evt_reply, 364 ci->semaphore_init(&sample_queue.emu_evt_reply, 1, 0);
365 EVENT_AUTOMATIC | STATE_NONSIGNALED);
366 ci->semaphore_init(&sample_queue.emu_sem_tail, 2, 0); 365 ci->semaphore_init(&sample_queue.emu_sem_tail, 2, 0);
367 ci->semaphore_init(&sample_queue.emu_sem_head, 2, 2); 366 ci->semaphore_init(&sample_queue.emu_sem_head, 2, 2);
368 sample_queue.head = 0; 367 sample_queue.head = 0;