Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.79 KB | None | 0 0
  1. static void *event_loop(void *data)
  2. {
  3.    ps3_audio_t *aud = data;
  4.    sys_event_queue_t id;
  5.    sys_ipc_key_t key;
  6.    sys_event_t event;
  7.  
  8.    cellAudioCreateNotifyEventQueue(&id, &key);
  9.    cellAudioSetNotifyEventQueue(key);
  10.  
  11.    resampler_t *resampler = resampler_new(drain_fifo, 2.1, 2, data);
  12.  
  13.    float out_tmp[CELL_AUDIO_BLOCK_SAMPLES * AUDIO_CHANNELS] __attribute__((aligned(16)));
  14.  
  15.    while (!aud->quit_thread)
  16.    {
  17.       sys_event_queue_receive(id, &event, SYS_NO_TIMEOUT);
  18.       resampler_cb_read(resampler, CELL_AUDIO_BLOCK_SAMPLES, out_tmp);
  19.       cellAudioAddData(aud->audio_port, out_tmp, CELL_AUDIO_BLOCK_SAMPLES, 1.0);
  20.       pthread_cond_signal(&aud->cond);
  21.    }
  22.  
  23.    cellAudioRemoveNotifyEventQueue(key);
  24.    resampler_free(resampler);
  25.    pthread_exit(NULL);
  26.    return NULL;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement